diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ed5cb6857f86..b17c8433bd55 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41047,6 +41047,390 @@ components: - id - type type: object + GovernanceBestPracticeDefinition: + description: |- + The best practice associated with an insight. Populated with the first active best practice + matched to the insight; `null` when no best practice is attached. + properties: + category: + description: |- + The value driver the best practice is grouped under, such as `access_governance`, + `security`, `compliance`, or `operational_hygiene`. + example: "access_governance" + type: string + deep_link: + description: A relative link to the configuration page where the best practice can be acted upon. + example: "/organization-settings/users?status=inactive" + type: string + description: + description: The full rationale and guidance for the best practice. + example: "Review and deactivate users who have not logged in within the last 90 days." + type: string + detection_type: + description: An optional association to a control's detection type. `null` when not associated with a control. + example: + nullable: true + type: string + id: + description: The unique identifier of the best practice. + example: "bp_monitor_inactive_users" + type: string + impact: + description: The expected impact of following the best practice. + example: "Reduces unauthorized access risk." + type: string + impact_hint: + description: |- + A priority hint for ordering best practices by expected impact. Lower values indicate + higher priority. + example: 1 + format: int64 + type: integer + permissions: + description: The permissions required for the user to act on the best practice. + example: + - "user_access_manage" + items: + description: A permission required to act on the best practice. + type: string + type: array + status: + description: Whether the best practice is currently `active` or `deprecated`. + example: "active" + type: string + summary: + description: A one-line explanation of why this best practice matters. + example: "Inactive users with access increase your security surface area." + type: string + title: + description: A short, human-readable name for the best practice. + example: "Monitor inactive users" + type: string + trigger_condition: + description: |- + The condition that surfaces the best practice. For an `insight` trigger, the insight + slug; for a `static` trigger, a descriptive condition key. + example: "active_users" + type: string + trigger_type: + description: |- + How the best practice is surfaced. `insight` ties it to an insight; `static` surfaces it + unless its condition is met. + example: "insight" + type: string + required: + - id + - title + - summary + - description + - category + - impact + - trigger_type + - trigger_condition + - deep_link + - permissions + - impact_hint + - status + type: object + GovernanceInsightAttributes: + description: The attributes of a governance insight. + properties: + audit_query: + $ref: "#/components/schemas/GovernanceInsightAuditQuery" + nullable: true + best_practice: + $ref: "#/components/schemas/GovernanceBestPracticeDefinition" + nullable: true + deep_link: + description: A relative link to the product surface where the insight can be acted upon. + example: "" + type: string + description: + description: A human-readable description of what the insight measures. + example: "Number of users who have used the Dashboard in the last 30 days" + type: string + display_name: + description: Human-readable name of the insight. + example: "Active Dashboards" + type: string + event_query: + $ref: "#/components/schemas/GovernanceInsightEventQuery" + nullable: true + metric_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + nullable: true + old_value: + description: |- + The value of the insight over the previous comparison window. `null` when values were + not requested or could not be computed. + example: 3274 + format: double + nullable: true + type: number + percentage_query: + $ref: "#/components/schemas/GovernanceInsightPercentageQuery" + nullable: true + product: + description: The product the insight belongs to. + example: "Usage" + type: string + query_config: + $ref: "#/components/schemas/GovernanceInsightQueryConfig" + nullable: true + sort_order: + description: The relative order in which the insight should be displayed. + example: 1 + format: int64 + type: integer + state: + description: |- + The state of the insight. A `critical` insight receives extra UI treatment to draw + attention to it. + example: "critical" + type: string + sub_product: + description: The sub-product the insight belongs to, if any. + example: "Indexes" + type: string + time_range: + description: The time range the insight value is computed over, if applicable. + example: "month" + type: string + unit_name: + description: The unit that the insight's value is measured in. + example: "active dashboards" + type: string + usage_query: + $ref: "#/components/schemas/GovernanceInsightUsageQuery" + nullable: true + value: + description: The current value of the insight. `null` when values were not requested or could not be computed. + example: 3601 + format: double + nullable: true + type: number + required: + - display_name + - product + - best_practice + - sub_product + - unit_name + - description + - time_range + - state + - deep_link + - value + - old_value + - metric_query + - event_query + - usage_query + - audit_query + - percentage_query + type: object + GovernanceInsightAuditCompute: + description: The aggregation applied to an audit log query. + properties: + aggregation: + description: The aggregation function to apply. + example: "cardinality" + type: string + interval: + description: The aggregation time window, in milliseconds. + example: 86400000 + format: int64 + type: integer + metric: + description: The metric or attribute to aggregate. + example: "@usr.id" + type: string + rollup: + description: An optional secondary aggregation applied to the audit query result. + example: "" + type: string + required: + - aggregation + - metric + - interval + type: object + GovernanceInsightAuditQuery: + description: An audit log query used to compute an insight value. + properties: + compute: + $ref: "#/components/schemas/GovernanceInsightAuditCompute" + indexes: + description: The audit log indexes the query runs against. + example: + - "main" + items: + description: An audit log index name. + type: string + type: array + query: + description: The audit log search query string. + example: "@evt.name:Dashboard" + type: string + source: + description: The data source the query runs against. + example: "audit" + type: string + required: + - source + - query + - indexes + - compute + type: object + GovernanceInsightData: + description: A governance insight resource. + properties: + attributes: + $ref: "#/components/schemas/GovernanceInsightAttributes" + id: + description: The unique identifier of the insight. + example: "498ee21f-8037-48b8-a961-a488692902f4" + type: string + type: + $ref: "#/components/schemas/GovernanceInsightResourceType" + required: + - id + - type + - attributes + type: object + GovernanceInsightEventCompute: + description: The aggregation applied to an event query. + properties: + aggregation: + description: The aggregation function to apply. + example: "count" + type: string + interval: + description: The aggregation time window, in milliseconds. + example: 86400000 + format: int64 + type: integer + required: + - aggregation + - interval + type: object + GovernanceInsightEventQuery: + description: An event query used to compute an insight value. + properties: + compute: + $ref: "#/components/schemas/GovernanceInsightEventCompute" + nullable: true + indexes: + description: The event indexes the query runs against. + example: + - "main" + items: + description: An event index name. + type: string + type: array + query: + description: The event search query string. + example: "source:cloudtrail" + type: string + required: + - query + - indexes + type: object + GovernanceInsightMetricQuery: + description: A metric query used to compute an insight value. + properties: + query: + description: The query string. + example: "avg:system.cpu.user{*}" + type: string + reducer: + description: How the query result series is reduced to a single value. + example: "avg" + type: string + source: + description: The data source the query runs against. + example: "metrics" + type: string + required: + - source + - query + - reducer + type: object + GovernanceInsightPercentageQuery: + description: A percentage query that computes an insight value as a ratio of two metric queries. + properties: + denominator_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + numerator_query: + $ref: "#/components/schemas/GovernanceInsightMetricQuery" + required: + - numerator_query + - denominator_query + type: object + GovernanceInsightQueryConfig: + description: Query execution context that allows the frontend to execute insight queries directly. + properties: + chart_type: + description: The chart type the frontend should use to render the insight. + example: "line" + type: string + comparison_shift: + description: The window used for the previous value comparison, for example `week` or `month`. + example: "month" + type: string + default_value: + description: The default value to display when no data is available. + example: 0 + format: int64 + type: integer + directionality: + description: |- + Whether an increase in the value is good, bad, or neutral. One of `neutral`, + `increase_better`, or `decrease_better`. + example: "neutral" + type: string + effective_time_window_days: + description: The number of days the insight value is computed over. + example: 30 + format: int64 + type: integer + required: + - effective_time_window_days + - comparison_shift + type: object + GovernanceInsightResourceType: + description: JSON:API resource type for a governance insight. + enum: + - insight + example: "insight" + type: string + x-enum-varnames: + - INSIGHT + GovernanceInsightUsageQuery: + description: A usage query used to compute an insight value. + properties: + query: + description: The usage query string. + example: "logs_indexed_events" + type: string + reducer: + description: How the query result series is reduced to a single value. + example: "sum" + type: string + required: + - query + - reducer + type: object + GovernanceInsightsDataArray: + description: An array of governance insight resources. + items: + $ref: "#/components/schemas/GovernanceInsightData" + type: array + GovernanceInsightsResponse: + description: A list of governance insights. + properties: + data: + $ref: "#/components/schemas/GovernanceInsightsDataArray" + required: + - data + type: object GreyNoiseAPIKey: description: The definition of the `GreyNoiseAPIKey` object. properties: @@ -131857,6 +132241,135 @@ paths: operator: OR permissions: - user_access_read + /api/v2/governance/insights: + get: + description: |- + Retrieve the list of governance insights available to the organization. By default, only + insight metadata is returned; pass `withValues=true` to also compute and include each + insight's current and previous values. Insights can be filtered by product. + operationId: ListGovernanceInsights + parameters: + - description: |- + Whether to compute and include the current and previous value of each insight. + Defaults to `false`, in which case only insight metadata is returned. + example: true + in: query + name: withValues + required: false + schema: + type: boolean + - description: |- + The UUID of the organization to compute insights for. Defaults to the organization of + the authenticated user. Used to retrieve insights for a child organization from a + parent organization. + example: "11111111-2222-3333-4444-555555555555" + in: query + name: orgUuid + required: false + schema: + type: string + - description: |- + Restrict the results to insights belonging to the given products. May be repeated to + filter by multiple products. Matching is case-insensitive. + example: + - "Usage" + - "Logs Settings" + in: query + name: filter[product] + required: false + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + audit_query: + best_practice: + deep_link: "" + description: "" + display_name: "Active Dashboards" + event_query: + metric_query: + old_value: 3274 + percentage_query: + product: "Usage" + state: "" + sub_product: "" + time_range: "" + unit_name: "active dashboards" + usage_query: + value: 3601 + id: "498ee21f-8037-48b8-a961-a488692902f4" + type: "insight" + - attributes: + audit_query: + best_practice: + category: "access_governance" + deep_link: "/organization-settings/users?status=inactive" + description: "Review and deactivate users who have not logged in within the last 90 days." + detection_type: + id: "bp_monitor_inactive_users" + impact: "Reduces unauthorized access risk." + impact_hint: 1 + permissions: + - "user_access_manage" + status: "active" + summary: "Inactive users with access increase your security surface area." + title: "Monitor inactive users" + trigger_condition: "active_users" + trigger_type: "insight" + deep_link: "" + description: "Number of users who have used the Dashboard in the last 30 days" + display_name: "Active Users" + event_query: + metric_query: + old_value: 1173 + percentage_query: + product: "Usage" + state: "" + sub_product: "" + time_range: "month" + unit_name: "active users" + usage_query: + value: 1291 + id: "a3248d1b-5578-4345-a34e-fe9657300f22" + type: "insight" + schema: + $ref: "#/components/schemas/GovernanceInsightsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List governance insights + tags: + - Governance Insights + 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/hamr: get: description: |- @@ -190013,6 +190526,12 @@ tags: description: For more information about the Datadog Google Chat integration, see the integration page. url: https://docs.datadoghq.com/integrations/google-hangouts-chat/ name: Google Chat Integration + - description: |- + Governance Insights surface key usage, configuration, and best-practice signals for an + organization within the Governance Console. Each insight reports a current value (and, + optionally, a previous value for comparison) along with the query used to compute it, so + that the Console can render trends and highlight areas that need attention. + name: Governance Insights - description: |- Configure High Availability Multi-Region (HAMR) connections between Datadog organizations. HAMR provides disaster recovery capabilities by maintaining synchronized data between primary diff --git a/CHANGELOG.md b/CHANGELOG.md index a5933f58828b..0509236f1a99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,140 @@ # CHANGELOG +## 2.55.0/2026-06-17 + +### Added +* Add captureNetworkPayloads for Synthetics Browser tests [#3494](https://github.com/DataDog/datadog-api-client-ruby/pull/3494) +* Set x-keep-typed-in-additional-properties on UsageSummary schemas [#3493](https://github.com/DataDog/datadog-api-client-ruby/pull/3493) +* add OpenAPI spec for Tag Policies API [#3489](https://github.com/DataDog/datadog-api-client-ruby/pull/3489) +* Mark ServiceNow triage endpoints as stable [#3487](https://github.com/DataDog/datadog-api-client-ruby/pull/3487) +* Add restore rule version endpoint in detection rules [#3480](https://github.com/DataDog/datadog-api-client-ruby/pull/3480) +* Document LLM Observability Patterns API [#3478](https://github.com/DataDog/datadog-api-client-ruby/pull/3478) +* Add OpenAPI spec for max session duration endpoint [#3476](https://github.com/DataDog/datadog-api-client-ruby/pull/3476) +* Additional Forms v2 API endpoints [#3475](https://github.com/DataDog/datadog-api-client-ruby/pull/3475) +* Add observability pipelines Generate metrics processor [#3472](https://github.com/DataDog/datadog-api-client-ruby/pull/3472) +* Add GET /api/v2/integration/slack/user-bindings to Slack integration spec [#3470](https://github.com/DataDog/datadog-api-client-ruby/pull/3470) +* Add OpenAPI spec for CSM settings endpoints [#3469](https://github.com/DataDog/datadog-api-client-ruby/pull/3469) +* Add OpenAPI spec for CSM ownership-api endpoints [#3468](https://github.com/DataDog/datadog-api-client-ruby/pull/3468) +* Add configuration field to deployment gates evaluation API [#3464](https://github.com/DataDog/datadog-api-client-ruby/pull/3464) +* Add triage endpoint and fields to IoC Explorer API docs [#3463](https://github.com/DataDog/datadog-api-client-ruby/pull/3463) +* Add GetSingleEntityContext endpoint to security monitoring spec [#3461](https://github.com/DataDog/datadog-api-client-ruby/pull/3461) +* Add int64 format and extract inline schemas [#3460](https://github.com/DataDog/datadog-api-client-ruby/pull/3460) +* Add metric filter query parameter to Cloud Cost Management tag metadata tag sources endpoint [#3459](https://github.com/DataDog/datadog-api-client-ruby/pull/3459) +* Document SendSecurityMonitoringNotificationPreview endpoint [#3456](https://github.com/DataDog/datadog-api-client-ruby/pull/3456) +* Add filter[owned_by] parameter to GET /api/v2/application_keys [#3455](https://github.com/DataDog/datadog-api-client-ruby/pull/3455) +* Add OpenAPI spec for App Builder Forms v2 API [#3453](https://github.com/DataDog/datadog-api-client-ruby/pull/3453) +* Add JWT authentication type for Synthetics HTTP API tests [#3452](https://github.com/DataDog/datadog-api-client-ruby/pull/3452) +* Add shared dashboard list OpenAPI spec [#3449](https://github.com/DataDog/datadog-api-client-ruby/pull/3449) +* Expose usage summary keys for June SKUs [#3448](https://github.com/DataDog/datadog-api-client-ruby/pull/3448) +* Add slo_query to SLO Correction API for global correction support [#3447](https://github.com/DataDog/datadog-api-client-ruby/pull/3447) +* Add OpenAPI spec for SAML configuration endpoints [#3446](https://github.com/DataDog/datadog-api-client-ruby/pull/3446) +* Add OpenAPI spec for /api/v2/network-health-insights [#3444](https://github.com/DataDog/datadog-api-client-ruby/pull/3444) +* [error-tracking] Add Linear issue to API endpoints response schemas [#3443](https://github.com/DataDog/datadog-api-client-ruby/pull/3443) +* Add OpenAPI spec for ASM services v2 endpoint [#3442](https://github.com/DataDog/datadog-api-client-ruby/pull/3442) +* Add OpenAPI spec for stegadography get-widgets endpoint [#3438](https://github.com/DataDog/datadog-api-client-ruby/pull/3438) +* Add OpenAPI spec for OAuth2 well-known sites endpoint [#3436](https://github.com/DataDog/datadog-api-client-ruby/pull/3436) +* Add available_fields endpoint to usage summary [#3435](https://github.com/DataDog/datadog-api-client-ruby/pull/3435) +* add issue_stream to public spec [#3433](https://github.com/DataDog/datadog-api-client-ruby/pull/3433) +* Add public OpenAPI spec for report schedule create and update [#3432](https://github.com/DataDog/datadog-api-client-ruby/pull/3432) +* Add ListWorkflows endpoint to Workflow Automation [#3431](https://github.com/DataDog/datadog-api-client-ruby/pull/3431) +* Add edited_before and viewed_before filters to ListDashboardsUsage [#3427](https://github.com/DataDog/datadog-api-client-ruby/pull/3427) +* Add tag indexing rule APIs to v2 metrics spec [#3426](https://github.com/DataDog/datadog-api-client-ruby/pull/3426) +* Add OpenAPI spec for global orgs endpoint [#3424](https://github.com/DataDog/datadog-api-client-ruby/pull/3424) +* doc ml obs Expose LLM Observability annotation endpoints [#3423](https://github.com/DataDog/datadog-api-client-ruby/pull/3423) +* Add OpenAPI spec for sourcemap-admin public endpoints [#3421](https://github.com/DataDog/datadog-api-client-ruby/pull/3421) +* RUM - Add OpenAPI spec for hardcoded retention filters [#3420](https://github.com/DataDog/datadog-api-client-ruby/pull/3420) +* Add missing query parameter to CNM aggregated connections and DNS endpoints [#3419](https://github.com/DataDog/datadog-api-client-ruby/pull/3419) +* Add RUM rate limit configuration v2 endpoints [#3418](https://github.com/DataDog/datadog-api-client-ruby/pull/3418) +* Update ListVolumesByMetricName description for Metric Name Pricing [#3417](https://github.com/DataDog/datadog-api-client-ruby/pull/3417) +* Add status-page resource to restriction policy API docs [#3415](https://github.com/DataDog/datadog-api-client-ruby/pull/3415) +* Add public OpenAPI ops for Salesforce-incidents orgs and templates [#3414](https://github.com/DataDog/datadog-api-client-ruby/pull/3414) +* Add partitioning_attributes and lookup_attributes to Log Archives spec [#3412](https://github.com/DataDog/datadog-api-client-ruby/pull/3412) +* Add OpenAPI spec for security monitoring bulk convert rules endpoint [#3411](https://github.com/DataDog/datadog-api-client-ruby/pull/3411) +* Add public OpenAPI ops for Webhooks OAuth2 client credentials [#3410](https://github.com/DataDog/datadog-api-client-ruby/pull/3410) +* Add public OpenAPI ops for Statuspage account and URL settings [#3409](https://github.com/DataDog/datadog-api-client-ruby/pull/3409) +* Add new Host Map widget infrastructure request type [#3408](https://github.com/DataDog/datadog-api-client-ruby/pull/3408) +* Add public OpenAPI ops for Opsgenie accounts CRUD [#3407](https://github.com/DataDog/datadog-api-client-ruby/pull/3407) +* Allow llm-observability data source in formula event queries [#3405](https://github.com/DataDog/datadog-api-client-ruby/pull/3405) +* Add OpenAPI spec for APM spans-public-api trace endpoints [#3403](https://github.com/DataDog/datadog-api-client-ruby/pull/3403) +* Add DeleteSyncConfig OpenAPI endpoint for Storage Management [#3401](https://github.com/DataDog/datadog-api-client-ruby/pull/3401) +* Add OpenAPI spec for OAuth2 client endpoints [#3400](https://github.com/DataDog/datadog-api-client-ruby/pull/3400) +* Add OpenAPI specs for SCA licenses and dependency scan endpoints [#3399](https://github.com/DataDog/datadog-api-client-ruby/pull/3399) +* Allow apm metrics data source for distribution histogram request [#3395](https://github.com/DataDog/datadog-api-client-ruby/pull/3395) +* Add is_backfilled to our Status Pages degradations and maintenances API responses. [#3391](https://github.com/DataDog/datadog-api-client-ruby/pull/3391) +* Add OpenAPI for LLM Observability dataset export batch_update clone restore and records upload SSE [#3389](https://github.com/DataDog/datadog-api-client-ruby/pull/3389) +* Add OpenAPI specs for secmon-public-api datasets endpoints [#3387](https://github.com/DataDog/datadog-api-client-ruby/pull/3387) +* Add OpenAPI specs for static-analysis-api missing endpoints [#3385](https://github.com/DataDog/datadog-api-client-ruby/pull/3385) +* RUM - add API endpoints for permanent retention filters [#3384](https://github.com/DataDog/datadog-api-client-ruby/pull/3384) +* Add siem_12mo_retention and siem_6mo_retention to usage API [#3381](https://github.com/DataDog/datadog-api-client-ruby/pull/3381) +* Add serverless_apps_dsm_fargate_tasks fields to usage metering API [#3380](https://github.com/DataDog/datadog-api-client-ruby/pull/3380) +* Add Cloud Cost Management tag_metadata months endpoint [#3379](https://github.com/DataDog/datadog-api-client-ruby/pull/3379) +* Add observability pipelines splunk HEC metrics destination [#3378](https://github.com/DataDog/datadog-api-client-ruby/pull/3378) +* Add comparison to QueryValueWidgetRequest for surfacing the change indicator feature [#3377](https://github.com/DataDog/datadog-api-client-ruby/pull/3377) +* Support for In-App WAF policies operations [#3376](https://github.com/DataDog/datadog-api-client-ruby/pull/3376) +* Add OpenAPI for LLM Observability dataset draft state and versions [#3374](https://github.com/DataDog/datadog-api-client-ruby/pull/3374) +* Document LLM Observability org config endpoints [#3372](https://github.com/DataDog/datadog-api-client-ruby/pull/3372) +* Add OpenAPI spec for IDP entity integration configs [#3371](https://github.com/DataDog/datadog-api-client-ruby/pull/3371) +* Add OpenAPI specs for app-builder blueprints, tags, and private query endpoints [#3370](https://github.com/DataDog/datadog-api-client-ruby/pull/3370) +* Add buffer support to remaining Observability Pipelines destinations [#3369](https://github.com/DataDog/datadog-api-client-ruby/pull/3369) +* Add critical_query / critical_recovery_query to MonitorThresholds [#3368](https://github.com/DataDog/datadog-api-client-ruby/pull/3368) +* Sync 'status_pages.yaml' files with backend [#3367](https://github.com/DataDog/datadog-api-client-ruby/pull/3367) +* Add OpenAPI spec for v2 customer org disable endpoint [#3366](https://github.com/DataDog/datadog-api-client-ruby/pull/3366) +* Add Annotations API v2 spec [#3365](https://github.com/DataDog/datadog-api-client-ruby/pull/3365) +* Document LLM Observability LLM provider integration endpoints [#3363](https://github.com/DataDog/datadog-api-client-ruby/pull/3363) +* Add ValidateAWSCCMConfig operation to AWS integration v2 spec [#3362](https://github.com/DataDog/datadog-api-client-ruby/pull/3362) +* Add baselineUserLocationsDuration to Impossible Travel rule options [#3361](https://github.com/DataDog/datadog-api-client-ruby/pull/3361) +* Add OpenAPI spec for RUM insight aggregation endpoints [#3359](https://github.com/DataDog/datadog-api-client-ruby/pull/3359) +* Add OpenAPI definitions for path-param tag_description endpoints [#3358](https://github.com/DataDog/datadog-api-client-ruby/pull/3358) +* Monitors Augmented Query Add Group By Source [#3357](https://github.com/DataDog/datadog-api-client-ruby/pull/3357) +* Add mcp step subtype to synthetics multi-step api tests [#3356](https://github.com/DataDog/datadog-api-client-ruby/pull/3356) +* Document Cloud SIEM Growth and Content owned endpoints [#3354](https://github.com/DataDog/datadog-api-client-ruby/pull/3354) +* Add API fields for jobs_monitoring_orchestrators [#3352](https://github.com/DataDog/datadog-api-client-ruby/pull/3352) +* Add OpenAPI specs for 36 undocumented case-rapid-api v2 endpoints [#3351](https://github.com/DataDog/datadog-api-client-ruby/pull/3351) +* Document LLM Observability Experiments search endpoints [#3350](https://github.com/DataDog/datadog-api-client-ruby/pull/3350) +* Add new metrics processors in Observability Pipelines [#3348](https://github.com/DataDog/datadog-api-client-ruby/pull/3348) +* Add OpenAPI spec for Model Lab API v2 endpoints [#3347](https://github.com/DataDog/datadog-api-client-ruby/pull/3347) +* Update observability pipelines databricks_zerobus destination endpoint fields to be secret [#3346](https://github.com/DataDog/datadog-api-client-ruby/pull/3346) +* Add csm_host_pro hosts agentless scanners to usage metering API [#3345](https://github.com/DataDog/datadog-api-client-ruby/pull/3345) +* Add Dashboards Usage v2 endpoints [#3344](https://github.com/DataDog/datadog-api-client-ruby/pull/3344) +* observability pipelines add tls.verify_certificate field to multiple push sources [#3343](https://github.com/DataDog/datadog-api-client-ruby/pull/3343) +* Update Synthetics downtime spec: gate write ops on default-settings and add monthly weekday positions [#3342](https://github.com/DataDog/datadog-api-client-ruby/pull/3342) +* Add TCP congestion signals to CNM aggregated connections spec [#3341](https://github.com/DataDog/datadog-api-client-ruby/pull/3341) +* Add ListReferenceTableRows endpoint to Reference Tables [#3339](https://github.com/DataDog/datadog-api-client-ruby/pull/3339) +* Cloud Cost Recommendations Search API [#3334](https://github.com/DataDog/datadog-api-client-ruby/pull/3334) +* Add Cloud Cost Management tag_metadata endpoints [#3333](https://github.com/DataDog/datadog-api-client-ruby/pull/3333) +* feat - Add data-jobs alert monitor type support [#3330](https://github.com/DataDog/datadog-api-client-ruby/pull/3330) +* Add display_block interaction type to LLM Obs annotation queues [#3328](https://github.com/DataDog/datadog-api-client-ruby/pull/3328) +* Add exclude-attribute processor to logs pipelines [#3316](https://github.com/DataDog/datadog-api-client-ruby/pull/3316) +* Add missing scorecards OpenAPI specs [#3315](https://github.com/DataDog/datadog-api-client-ruby/pull/3315) +* Adding valid tokens to Splunk and HTTP server source [#3311](https://github.com/DataDog/datadog-api-client-ruby/pull/3311) +* Add escalation policy routing action with support hours and acknowledgment timeout to On-Call routing rules [#3294](https://github.com/DataDog/datadog-api-client-ruby/pull/3294) +* Add created_at/modified_at to LLM Obs annotation queue interaction responses [#3244](https://github.com/DataDog/datadog-api-client-ruby/pull/3244) + +### Removed +* Remove deprecated incident services APIs (/api/v2/services) [#3483](https://github.com/DataDog/datadog-api-client-ruby/pull/3483) +* Make fleet-automation clusters and instrumented_pods specs private [#3473](https://github.com/DataDog/datadog-api-client-ruby/pull/3473) + +### Changed +* Add DELETE user-binding endpoint to Microsoft Teams Integration spec [#3477](https://github.com/DataDog/datadog-api-client-ruby/pull/3477) +* Add Google Chat organizations, delegated-user, and target-audience OpenAPI operations [#3454](https://github.com/DataDog/datadog-api-client-ruby/pull/3454) +* Update param spec for GET experiments in LLM Observability [#3429](https://github.com/DataDog/datadog-api-client-ruby/pull/3429) +* Add risk-scores entityID spec [#3422](https://github.com/DataDog/datadog-api-client-ruby/pull/3422) +* Update PAT and SAT api spec [#3404](https://github.com/DataDog/datadog-api-client-ruby/pull/3404) +* Rename Tiers for Org Group Policies and Remove Include Memberships Support [#3373](https://github.com/DataDog/datadog-api-client-ruby/pull/3373) +* Document LLM Observability span search and data deletion endpoints [#3360](https://github.com/DataDog/datadog-api-client-ruby/pull/3360) + +### Deprecated +* Deprecate bulk tag config API endpoints [#3471](https://github.com/DataDog/datadog-api-client-ruby/pull/3471) +* Move MuteFindings operation to private spec [#3462](https://github.com/DataDog/datadog-api-client-ruby/pull/3462) + +### Fixed +* Fix RUM casing in descriptions and summaries [#3434](https://github.com/DataDog/datadog-api-client-ruby/pull/3434) +* Reconcile SIEM historical detections OpenAPI with current schema [#3390](https://github.com/DataDog/datadog-api-client-ruby/pull/3390) +* security-monitoring - Change histsignals/search method from GET to POST [#3386](https://github.com/DataDog/datadog-api-client-ruby/pull/3386) + +### Security +* [CRED-2625] Redact Authorization (Bearer) header in sanitize_request_header [#3340](https://github.com/DataDog/datadog-api-client-ruby/pull/3340) + ## 2.54.0/2026-05-15 ### Added diff --git a/Gemfile b/Gemfile index ecd825afdd40..e9fd9435cc2d 100644 --- a/Gemfile +++ b/Gemfile @@ -22,6 +22,7 @@ group :development, :test do gem 'webmock' gem 'zstandard' gem 'pry' + gem 'i18n', '~> 1.14.0' end group :docs do diff --git a/examples/v2/governance-insights/ListGovernanceInsights.rb b/examples/v2/governance-insights/ListGovernanceInsights.rb new file mode 100644 index 000000000000..aeab3d10fb1e --- /dev/null +++ b/examples/v2/governance-insights/ListGovernanceInsights.rb @@ -0,0 +1,8 @@ +# List governance insights returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_governance_insights".to_sym] = true +end +api_instance = DatadogAPIClient::V2::GovernanceInsightsAPI.new +p api_instance.list_governance_insights() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f852751d3040..1642b73b84bb 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3293,6 +3293,11 @@ "saml_config_uuid" => "String", "body" => "SAMLConfigurationUpdateRequest", }, + "v2.ListGovernanceInsights" => { + "with_values" => "Boolean", + "org_uuid" => "String", + "filter_product" => "Array", + }, "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, diff --git a/features/v2/governance_insights.feature b/features/v2/governance_insights.feature new file mode 100644 index 000000000000..0327e119c540 --- /dev/null +++ b/features/v2/governance_insights.feature @@ -0,0 +1,24 @@ +@endpoint(governance-insights) @endpoint(governance-insights-v2) +Feature: Governance Insights + Governance Insights surface key usage, configuration, and best-practice + signals for an organization within the Governance Console. Each insight + reports a current value (and, optionally, a previous value for comparison) + along with the query used to compute it, so that the Console can render + trends and highlight areas that need attention. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "GovernanceInsights" API + And operation "ListGovernanceInsights" enabled + And new "ListGovernanceInsights" request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance insights returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List governance insights returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 8729c7318e64..049cc1252219 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2762,6 +2762,12 @@ "type": "safe" } }, + "ListGovernanceInsights": { + "tag": "Governance Insights", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index e872b0cc9907..b76c33e4fa5f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -468,6 +468,7 @@ def initialize "v2.upsert_and_publish_form_version": false, "v2.upsert_form_version": false, "v2.update_org_saml_configurations": false, + "v2.list_governance_insights": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, "v2.delete_entity_integration_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ab79d2d1ec26..e4100cdd86e0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3508,6 +3508,19 @@ def overrides "v2.google_chat_update_organization_handle_request_data" => "GoogleChatUpdateOrganizationHandleRequestData", "v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference", "v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData", + "v2.governance_best_practice_definition" => "GovernanceBestPracticeDefinition", + "v2.governance_insight_attributes" => "GovernanceInsightAttributes", + "v2.governance_insight_audit_compute" => "GovernanceInsightAuditCompute", + "v2.governance_insight_audit_query" => "GovernanceInsightAuditQuery", + "v2.governance_insight_data" => "GovernanceInsightData", + "v2.governance_insight_event_compute" => "GovernanceInsightEventCompute", + "v2.governance_insight_event_query" => "GovernanceInsightEventQuery", + "v2.governance_insight_metric_query" => "GovernanceInsightMetricQuery", + "v2.governance_insight_percentage_query" => "GovernanceInsightPercentageQuery", + "v2.governance_insight_query_config" => "GovernanceInsightQueryConfig", + "v2.governance_insight_resource_type" => "GovernanceInsightResourceType", + "v2.governance_insights_response" => "GovernanceInsightsResponse", + "v2.governance_insight_usage_query" => "GovernanceInsightUsageQuery", "v2.grey_noise_api_key" => "GreyNoiseAPIKey", "v2.grey_noise_api_key_type" => "GreyNoiseAPIKeyType", "v2.grey_noise_api_key_update" => "GreyNoiseAPIKeyUpdate", @@ -7768,6 +7781,7 @@ def overrides "v2.forms_api" => "FormsAPI", "v2.gcp_integration_api" => "GCPIntegrationAPI", "v2.google_chat_integration_api" => "GoogleChatIntegrationAPI", + "v2.governance_insights_api" => "GovernanceInsightsAPI", "v2.high_availability_multi_region_api" => "HighAvailabilityMultiRegionAPI", "v2.incidents_api" => "IncidentsAPI", "v2.integrations_api" => "IntegrationsAPI", diff --git a/lib/datadog_api_client/v2/api/governance_insights_api.rb b/lib/datadog_api_client/v2/api/governance_insights_api.rb new file mode 100644 index 000000000000..3c95d8cc2004 --- /dev/null +++ b/lib/datadog_api_client/v2/api/governance_insights_api.rb @@ -0,0 +1,101 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class GovernanceInsightsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # List governance insights. + # + # @see #list_governance_insights_with_http_info + def list_governance_insights(opts = {}) + data, _status_code, _headers = list_governance_insights_with_http_info(opts) + data + end + + # List governance insights. + # + # Retrieve the list of governance insights available to the organization. By default, only + # insight metadata is returned; pass `withValues=true` to also compute and include each + # insight's current and previous values. Insights can be filtered by product. + # + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :with_values Whether to compute and include the current and previous value of each insight. Defaults to `false`, in which case only insight metadata is returned. + # @option opts [String] :org_uuid The UUID of the organization to compute insights for. Defaults to the organization of the authenticated user. Used to retrieve insights for a child organization from a parent organization. + # @option opts [Array] :filter_product Restrict the results to insights belonging to the given products. May be repeated to filter by multiple products. Matching is case-insensitive. + # @return [Array<(GovernanceInsightsResponse, Integer, Hash)>] GovernanceInsightsResponse data, response status code and response headers + def list_governance_insights_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_governance_insights".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_governance_insights") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_governance_insights")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GovernanceInsightsAPI.list_governance_insights ...' + end + # resource path + local_var_path = '/api/v2/governance/insights' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'withValues'] = opts[:'with_values'] if !opts[:'with_values'].nil? + query_params[:'orgUuid'] = opts[:'org_uuid'] if !opts[:'org_uuid'].nil? + query_params[:'filter[product]'] = @api_client.build_collection_param(opts[:'filter_product'], :multi) if !opts[:'filter_product'].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] || 'GovernanceInsightsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_governance_insights, + :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" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + 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: GovernanceInsightsAPI#list_governance_insights\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/governance_best_practice_definition.rb b/lib/datadog_api_client/v2/models/governance_best_practice_definition.rb new file mode 100644 index 000000000000..f6d4c411b31e --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_best_practice_definition.rb @@ -0,0 +1,379 @@ +=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 best practice associated with an insight. Populated with the first active best practice + # matched to the insight; `null` when no best practice is attached. + class GovernanceBestPracticeDefinition + include BaseGenericModel + + # The value driver the best practice is grouped under, such as `access_governance`, + # `security`, `compliance`, or `operational_hygiene`. + attr_reader :category + + # A relative link to the configuration page where the best practice can be acted upon. + attr_reader :deep_link + + # The full rationale and guidance for the best practice. + attr_reader :description + + # An optional association to a control's detection type. `null` when not associated with a control. + attr_accessor :detection_type + + # The unique identifier of the best practice. + attr_reader :id + + # The expected impact of following the best practice. + attr_reader :impact + + # A priority hint for ordering best practices by expected impact. Lower values indicate + # higher priority. + attr_reader :impact_hint + + # The permissions required for the user to act on the best practice. + attr_reader :permissions + + # Whether the best practice is currently `active` or `deprecated`. + attr_reader :status + + # A one-line explanation of why this best practice matters. + attr_reader :summary + + # A short, human-readable name for the best practice. + attr_reader :title + + # The condition that surfaces the best practice. For an `insight` trigger, the insight + # slug; for a `static` trigger, a descriptive condition key. + attr_reader :trigger_condition + + # How the best practice is surfaced. `insight` ties it to an insight; `static` surfaces it + # unless its condition is met. + attr_reader :trigger_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'deep_link' => :'deep_link', + :'description' => :'description', + :'detection_type' => :'detection_type', + :'id' => :'id', + :'impact' => :'impact', + :'impact_hint' => :'impact_hint', + :'permissions' => :'permissions', + :'status' => :'status', + :'summary' => :'summary', + :'title' => :'title', + :'trigger_condition' => :'trigger_condition', + :'trigger_type' => :'trigger_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'deep_link' => :'String', + :'description' => :'String', + :'detection_type' => :'String', + :'id' => :'String', + :'impact' => :'String', + :'impact_hint' => :'Integer', + :'permissions' => :'Array', + :'status' => :'String', + :'summary' => :'String', + :'title' => :'String', + :'trigger_condition' => :'String', + :'trigger_type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'detection_type', + ]) + 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::GovernanceBestPracticeDefinition` 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?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'deep_link') + self.deep_link = attributes[:'deep_link'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'detection_type') + self.detection_type = attributes[:'detection_type'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'impact') + self.impact = attributes[:'impact'] + end + + if attributes.key?(:'impact_hint') + self.impact_hint = attributes[:'impact_hint'] + end + + if attributes.key?(:'permissions') + if (value = attributes[:'permissions']).is_a?(Array) + self.permissions = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'trigger_condition') + self.trigger_condition = attributes[:'trigger_condition'] + end + + if attributes.key?(:'trigger_type') + self.trigger_type = attributes[:'trigger_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 @category.nil? + return false if @deep_link.nil? + return false if @description.nil? + return false if @id.nil? + return false if @impact.nil? + return false if @impact_hint.nil? + return false if @permissions.nil? + return false if @status.nil? + return false if @summary.nil? + return false if @title.nil? + return false if @trigger_condition.nil? + return false if @trigger_type.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param deep_link [Object] Object to be assigned + # @!visibility private + def deep_link=(deep_link) + if deep_link.nil? + fail ArgumentError, 'invalid value for "deep_link", deep_link cannot be nil.' + end + @deep_link = deep_link + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + 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 impact [Object] Object to be assigned + # @!visibility private + def impact=(impact) + if impact.nil? + fail ArgumentError, 'invalid value for "impact", impact cannot be nil.' + end + @impact = impact + end + + # Custom attribute writer method with validation + # @param impact_hint [Object] Object to be assigned + # @!visibility private + def impact_hint=(impact_hint) + if impact_hint.nil? + fail ArgumentError, 'invalid value for "impact_hint", impact_hint cannot be nil.' + end + @impact_hint = impact_hint + end + + # Custom attribute writer method with validation + # @param permissions [Object] Object to be assigned + # @!visibility private + def permissions=(permissions) + if permissions.nil? + fail ArgumentError, 'invalid value for "permissions", permissions cannot be nil.' + end + @permissions = permissions + 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 + + # Custom attribute writer method with validation + # @param summary [Object] Object to be assigned + # @!visibility private + def summary=(summary) + if summary.nil? + fail ArgumentError, 'invalid value for "summary", summary cannot be nil.' + end + @summary = summary + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param trigger_condition [Object] Object to be assigned + # @!visibility private + def trigger_condition=(trigger_condition) + if trigger_condition.nil? + fail ArgumentError, 'invalid value for "trigger_condition", trigger_condition cannot be nil.' + end + @trigger_condition = trigger_condition + end + + # Custom attribute writer method with validation + # @param trigger_type [Object] Object to be assigned + # @!visibility private + def trigger_type=(trigger_type) + if trigger_type.nil? + fail ArgumentError, 'invalid value for "trigger_type", trigger_type cannot be nil.' + end + @trigger_type = trigger_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 && + category == o.category && + deep_link == o.deep_link && + description == o.description && + detection_type == o.detection_type && + id == o.id && + impact == o.impact && + impact_hint == o.impact_hint && + permissions == o.permissions && + status == o.status && + summary == o.summary && + title == o.title && + trigger_condition == o.trigger_condition && + trigger_type == o.trigger_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, deep_link, description, detection_type, id, impact, impact_hint, permissions, status, summary, title, trigger_condition, trigger_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_attributes.rb b/lib/datadog_api_client/v2/models/governance_insight_attributes.rb new file mode 100644 index 000000000000..e178bf83e78e --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_attributes.rb @@ -0,0 +1,448 @@ +=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 attributes of a governance insight. + class GovernanceInsightAttributes + include BaseGenericModel + + # An audit log query used to compute an insight value. + attr_reader :audit_query + + # The best practice associated with an insight. Populated with the first active best practice + # matched to the insight; `null` when no best practice is attached. + attr_reader :best_practice + + # A relative link to the product surface where the insight can be acted upon. + attr_reader :deep_link + + # A human-readable description of what the insight measures. + attr_reader :description + + # Human-readable name of the insight. + attr_reader :display_name + + # An event query used to compute an insight value. + attr_reader :event_query + + # A metric query used to compute an insight value. + attr_reader :metric_query + + # The value of the insight over the previous comparison window. `null` when values were + # not requested or could not be computed. + attr_accessor :old_value + + # A percentage query that computes an insight value as a ratio of two metric queries. + attr_reader :percentage_query + + # The product the insight belongs to. + attr_reader :product + + # Query execution context that allows the frontend to execute insight queries directly. + attr_accessor :query_config + + # The relative order in which the insight should be displayed. + attr_accessor :sort_order + + # The state of the insight. A `critical` insight receives extra UI treatment to draw + # attention to it. + attr_reader :state + + # The sub-product the insight belongs to, if any. + attr_reader :sub_product + + # The time range the insight value is computed over, if applicable. + attr_reader :time_range + + # The unit that the insight's value is measured in. + attr_reader :unit_name + + # A usage query used to compute an insight value. + attr_reader :usage_query + + # The current value of the insight. `null` when values were not requested or could not be computed. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'audit_query' => :'audit_query', + :'best_practice' => :'best_practice', + :'deep_link' => :'deep_link', + :'description' => :'description', + :'display_name' => :'display_name', + :'event_query' => :'event_query', + :'metric_query' => :'metric_query', + :'old_value' => :'old_value', + :'percentage_query' => :'percentage_query', + :'product' => :'product', + :'query_config' => :'query_config', + :'sort_order' => :'sort_order', + :'state' => :'state', + :'sub_product' => :'sub_product', + :'time_range' => :'time_range', + :'unit_name' => :'unit_name', + :'usage_query' => :'usage_query', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'audit_query' => :'GovernanceInsightAuditQuery', + :'best_practice' => :'GovernanceBestPracticeDefinition', + :'deep_link' => :'String', + :'description' => :'String', + :'display_name' => :'String', + :'event_query' => :'GovernanceInsightEventQuery', + :'metric_query' => :'GovernanceInsightMetricQuery', + :'old_value' => :'Float', + :'percentage_query' => :'GovernanceInsightPercentageQuery', + :'product' => :'String', + :'query_config' => :'GovernanceInsightQueryConfig', + :'sort_order' => :'Integer', + :'state' => :'String', + :'sub_product' => :'String', + :'time_range' => :'String', + :'unit_name' => :'String', + :'usage_query' => :'GovernanceInsightUsageQuery', + :'value' => :'Float' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'old_value', + :'value', + ]) + 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::GovernanceInsightAttributes` 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?(:'audit_query') + self.audit_query = attributes[:'audit_query'] + end + + if attributes.key?(:'best_practice') + self.best_practice = attributes[:'best_practice'] + end + + if attributes.key?(:'deep_link') + self.deep_link = attributes[:'deep_link'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'event_query') + self.event_query = attributes[:'event_query'] + end + + if attributes.key?(:'metric_query') + self.metric_query = attributes[:'metric_query'] + end + + if attributes.key?(:'old_value') + self.old_value = attributes[:'old_value'] + end + + if attributes.key?(:'percentage_query') + self.percentage_query = attributes[:'percentage_query'] + end + + if attributes.key?(:'product') + self.product = attributes[:'product'] + end + + if attributes.key?(:'query_config') + self.query_config = attributes[:'query_config'] + end + + if attributes.key?(:'sort_order') + self.sort_order = attributes[:'sort_order'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'sub_product') + self.sub_product = attributes[:'sub_product'] + end + + if attributes.key?(:'time_range') + self.time_range = attributes[:'time_range'] + end + + if attributes.key?(:'unit_name') + self.unit_name = attributes[:'unit_name'] + end + + if attributes.key?(:'usage_query') + self.usage_query = attributes[:'usage_query'] + 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 @audit_query.nil? + return false if @best_practice.nil? + return false if @deep_link.nil? + return false if @description.nil? + return false if @display_name.nil? + return false if @event_query.nil? + return false if @metric_query.nil? + return false if @percentage_query.nil? + return false if @product.nil? + return false if @state.nil? + return false if @sub_product.nil? + return false if @time_range.nil? + return false if @unit_name.nil? + return false if @usage_query.nil? + true + end + + # Custom attribute writer method with validation + # @param audit_query [Object] Object to be assigned + # @!visibility private + def audit_query=(audit_query) + if audit_query.nil? + fail ArgumentError, 'invalid value for "audit_query", audit_query cannot be nil.' + end + @audit_query = audit_query + end + + # Custom attribute writer method with validation + # @param best_practice [Object] Object to be assigned + # @!visibility private + def best_practice=(best_practice) + if best_practice.nil? + fail ArgumentError, 'invalid value for "best_practice", best_practice cannot be nil.' + end + @best_practice = best_practice + end + + # Custom attribute writer method with validation + # @param deep_link [Object] Object to be assigned + # @!visibility private + def deep_link=(deep_link) + if deep_link.nil? + fail ArgumentError, 'invalid value for "deep_link", deep_link cannot be nil.' + end + @deep_link = deep_link + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param display_name [Object] Object to be assigned + # @!visibility private + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'invalid value for "display_name", display_name cannot be nil.' + end + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param event_query [Object] Object to be assigned + # @!visibility private + def event_query=(event_query) + if event_query.nil? + fail ArgumentError, 'invalid value for "event_query", event_query cannot be nil.' + end + @event_query = event_query + end + + # Custom attribute writer method with validation + # @param metric_query [Object] Object to be assigned + # @!visibility private + def metric_query=(metric_query) + if metric_query.nil? + fail ArgumentError, 'invalid value for "metric_query", metric_query cannot be nil.' + end + @metric_query = metric_query + end + + # Custom attribute writer method with validation + # @param percentage_query [Object] Object to be assigned + # @!visibility private + def percentage_query=(percentage_query) + if percentage_query.nil? + fail ArgumentError, 'invalid value for "percentage_query", percentage_query cannot be nil.' + end + @percentage_query = percentage_query + end + + # Custom attribute writer method with validation + # @param product [Object] Object to be assigned + # @!visibility private + def product=(product) + if product.nil? + fail ArgumentError, 'invalid value for "product", product cannot be nil.' + end + @product = product + end + + # Custom attribute writer method with validation + # @param state [Object] Object to be assigned + # @!visibility private + def state=(state) + if state.nil? + fail ArgumentError, 'invalid value for "state", state cannot be nil.' + end + @state = state + end + + # Custom attribute writer method with validation + # @param sub_product [Object] Object to be assigned + # @!visibility private + def sub_product=(sub_product) + if sub_product.nil? + fail ArgumentError, 'invalid value for "sub_product", sub_product cannot be nil.' + end + @sub_product = sub_product + end + + # Custom attribute writer method with validation + # @param time_range [Object] Object to be assigned + # @!visibility private + def time_range=(time_range) + if time_range.nil? + fail ArgumentError, 'invalid value for "time_range", time_range cannot be nil.' + end + @time_range = time_range + end + + # Custom attribute writer method with validation + # @param unit_name [Object] Object to be assigned + # @!visibility private + def unit_name=(unit_name) + if unit_name.nil? + fail ArgumentError, 'invalid value for "unit_name", unit_name cannot be nil.' + end + @unit_name = unit_name + end + + # Custom attribute writer method with validation + # @param usage_query [Object] Object to be assigned + # @!visibility private + def usage_query=(usage_query) + if usage_query.nil? + fail ArgumentError, 'invalid value for "usage_query", usage_query cannot be nil.' + end + @usage_query = usage_query + 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 && + audit_query == o.audit_query && + best_practice == o.best_practice && + deep_link == o.deep_link && + description == o.description && + display_name == o.display_name && + event_query == o.event_query && + metric_query == o.metric_query && + old_value == o.old_value && + percentage_query == o.percentage_query && + product == o.product && + query_config == o.query_config && + sort_order == o.sort_order && + state == o.state && + sub_product == o.sub_product && + time_range == o.time_range && + unit_name == o.unit_name && + usage_query == o.usage_query && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [audit_query, best_practice, deep_link, description, display_name, event_query, metric_query, old_value, percentage_query, product, query_config, sort_order, state, sub_product, time_range, unit_name, usage_query, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_audit_compute.rb b/lib/datadog_api_client/v2/models/governance_insight_audit_compute.rb new file mode 100644 index 000000000000..694f5802dbf4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_audit_compute.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 + # The aggregation applied to an audit log query. + class GovernanceInsightAuditCompute + include BaseGenericModel + + # The aggregation function to apply. + attr_reader :aggregation + + # The aggregation time window, in milliseconds. + attr_reader :interval + + # The metric or attribute to aggregate. + attr_reader :metric + + # An optional secondary aggregation applied to the audit query result. + attr_accessor :rollup + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'interval' => :'interval', + :'metric' => :'metric', + :'rollup' => :'rollup' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'interval' => :'Integer', + :'metric' => :'String', + :'rollup' => :'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::GovernanceInsightAuditCompute` 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?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'rollup') + self.rollup = attributes[:'rollup'] + 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 @interval.nil? + return false if @metric.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 interval [Object] Object to be assigned + # @!visibility private + def interval=(interval) + if interval.nil? + fail ArgumentError, 'invalid value for "interval", interval cannot be nil.' + end + @interval = interval + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + 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 && + interval == o.interval && + metric == o.metric && + rollup == o.rollup && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, interval, metric, rollup, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_audit_query.rb b/lib/datadog_api_client/v2/models/governance_insight_audit_query.rb new file mode 100644 index 000000000000..813e6d5aa530 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_audit_query.rb @@ -0,0 +1,188 @@ +=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 + # An audit log query used to compute an insight value. + class GovernanceInsightAuditQuery + include BaseGenericModel + + # The aggregation applied to an audit log query. + attr_reader :compute + + # The audit log indexes the query runs against. + attr_reader :indexes + + # The audit log search query string. + attr_reader :query + + # The data source the query runs against. + attr_reader :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compute' => :'compute', + :'indexes' => :'indexes', + :'query' => :'query', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compute' => :'GovernanceInsightAuditCompute', + :'indexes' => :'Array', + :'query' => :'String', + :'source' => :'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::GovernanceInsightAuditQuery` 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?(:'compute') + self.compute = attributes[:'compute'] + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + 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 @compute.nil? + return false if @indexes.nil? + return false if @query.nil? + return false if @source.nil? + true + end + + # Custom attribute writer method with validation + # @param compute [Object] Object to be assigned + # @!visibility private + def compute=(compute) + if compute.nil? + fail ArgumentError, 'invalid value for "compute", compute cannot be nil.' + end + @compute = compute + end + + # Custom attribute writer method with validation + # @param indexes [Object] Object to be assigned + # @!visibility private + def indexes=(indexes) + if indexes.nil? + fail ArgumentError, 'invalid value for "indexes", indexes cannot be nil.' + end + @indexes = indexes + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + 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 && + compute == o.compute && + indexes == o.indexes && + query == o.query && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compute, indexes, query, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_data.rb b/lib/datadog_api_client/v2/models/governance_insight_data.rb new file mode 100644 index 000000000000..c4a5dd49b268 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_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 + # A governance insight resource. + class GovernanceInsightData + include BaseGenericModel + + # The attributes of a governance insight. + attr_reader :attributes + + # The unique identifier of the insight. + attr_reader :id + + # JSON:API resource type for a governance insight. + 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' => :'GovernanceInsightAttributes', + :'id' => :'String', + :'type' => :'GovernanceInsightResourceType' + } + 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::GovernanceInsightData` 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/governance_insight_event_compute.rb b/lib/datadog_api_client/v2/models/governance_insight_event_compute.rb new file mode 100644 index 000000000000..308e0c36d43f --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_event_compute.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 + # The aggregation applied to an event query. + class GovernanceInsightEventCompute + include BaseGenericModel + + # The aggregation function to apply. + attr_reader :aggregation + + # The aggregation time window, in milliseconds. + attr_reader :interval + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'interval' => :'interval' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'interval' => :'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::GovernanceInsightEventCompute` 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?(:'interval') + self.interval = attributes[:'interval'] + 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 @interval.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 interval [Object] Object to be assigned + # @!visibility private + def interval=(interval) + if interval.nil? + fail ArgumentError, 'invalid value for "interval", interval cannot be nil.' + end + @interval = interval + 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 && + interval == o.interval && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, interval, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_event_query.rb b/lib/datadog_api_client/v2/models/governance_insight_event_query.rb new file mode 100644 index 000000000000..19740bc624f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_event_query.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 + # An event query used to compute an insight value. + class GovernanceInsightEventQuery + include BaseGenericModel + + # The aggregation applied to an event query. + attr_accessor :compute + + # The event indexes the query runs against. + attr_reader :indexes + + # The event search query string. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compute' => :'compute', + :'indexes' => :'indexes', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compute' => :'GovernanceInsightEventCompute', + :'indexes' => :'Array', + :'query' => :'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::GovernanceInsightEventQuery` 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?(:'compute') + self.compute = attributes[:'compute'] + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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 @indexes.nil? + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param indexes [Object] Object to be assigned + # @!visibility private + def indexes=(indexes) + if indexes.nil? + fail ArgumentError, 'invalid value for "indexes", indexes cannot be nil.' + end + @indexes = indexes + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + 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 && + compute == o.compute && + indexes == o.indexes && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compute, indexes, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_metric_query.rb b/lib/datadog_api_client/v2/models/governance_insight_metric_query.rb new file mode 100644 index 000000000000..03e1a29db8f6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_metric_query.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 + # A metric query used to compute an insight value. + class GovernanceInsightMetricQuery + include BaseGenericModel + + # The query string. + attr_reader :query + + # How the query result series is reduced to a single value. + attr_reader :reducer + + # The data source the query runs against. + attr_reader :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query', + :'reducer' => :'reducer', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'String', + :'reducer' => :'String', + :'source' => :'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::GovernanceInsightMetricQuery` 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?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'reducer') + self.reducer = attributes[:'reducer'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + 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 @query.nil? + return false if @reducer.nil? + return false if @source.nil? + true + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param reducer [Object] Object to be assigned + # @!visibility private + def reducer=(reducer) + if reducer.nil? + fail ArgumentError, 'invalid value for "reducer", reducer cannot be nil.' + end + @reducer = reducer + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + 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 && + query == o.query && + reducer == o.reducer && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, reducer, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_percentage_query.rb b/lib/datadog_api_client/v2/models/governance_insight_percentage_query.rb new file mode 100644 index 000000000000..418c78f2462b --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_percentage_query.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 + # A percentage query that computes an insight value as a ratio of two metric queries. + class GovernanceInsightPercentageQuery + include BaseGenericModel + + # A metric query used to compute an insight value. + attr_reader :denominator_query + + # A metric query used to compute an insight value. + attr_reader :numerator_query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'denominator_query' => :'denominator_query', + :'numerator_query' => :'numerator_query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'denominator_query' => :'GovernanceInsightMetricQuery', + :'numerator_query' => :'GovernanceInsightMetricQuery' + } + 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::GovernanceInsightPercentageQuery` 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?(:'denominator_query') + self.denominator_query = attributes[:'denominator_query'] + end + + if attributes.key?(:'numerator_query') + self.numerator_query = attributes[:'numerator_query'] + 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 @denominator_query.nil? + return false if @numerator_query.nil? + true + end + + # Custom attribute writer method with validation + # @param denominator_query [Object] Object to be assigned + # @!visibility private + def denominator_query=(denominator_query) + if denominator_query.nil? + fail ArgumentError, 'invalid value for "denominator_query", denominator_query cannot be nil.' + end + @denominator_query = denominator_query + end + + # Custom attribute writer method with validation + # @param numerator_query [Object] Object to be assigned + # @!visibility private + def numerator_query=(numerator_query) + if numerator_query.nil? + fail ArgumentError, 'invalid value for "numerator_query", numerator_query cannot be nil.' + end + @numerator_query = numerator_query + 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 && + denominator_query == o.denominator_query && + numerator_query == o.numerator_query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [denominator_query, numerator_query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_query_config.rb b/lib/datadog_api_client/v2/models/governance_insight_query_config.rb new file mode 100644 index 000000000000..4f05b2434e59 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_query_config.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 + # Query execution context that allows the frontend to execute insight queries directly. + class GovernanceInsightQueryConfig + include BaseGenericModel + + # The chart type the frontend should use to render the insight. + attr_accessor :chart_type + + # The window used for the previous value comparison, for example `week` or `month`. + attr_reader :comparison_shift + + # The default value to display when no data is available. + attr_accessor :default_value + + # Whether an increase in the value is good, bad, or neutral. One of `neutral`, + # `increase_better`, or `decrease_better`. + attr_accessor :directionality + + # The number of days the insight value is computed over. + attr_reader :effective_time_window_days + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'chart_type' => :'chart_type', + :'comparison_shift' => :'comparison_shift', + :'default_value' => :'default_value', + :'directionality' => :'directionality', + :'effective_time_window_days' => :'effective_time_window_days' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'chart_type' => :'String', + :'comparison_shift' => :'String', + :'default_value' => :'Integer', + :'directionality' => :'String', + :'effective_time_window_days' => :'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::GovernanceInsightQueryConfig` 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?(:'chart_type') + self.chart_type = attributes[:'chart_type'] + end + + if attributes.key?(:'comparison_shift') + self.comparison_shift = attributes[:'comparison_shift'] + end + + if attributes.key?(:'default_value') + self.default_value = attributes[:'default_value'] + end + + if attributes.key?(:'directionality') + self.directionality = attributes[:'directionality'] + end + + if attributes.key?(:'effective_time_window_days') + self.effective_time_window_days = attributes[:'effective_time_window_days'] + 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 @comparison_shift.nil? + return false if @effective_time_window_days.nil? + true + end + + # Custom attribute writer method with validation + # @param comparison_shift [Object] Object to be assigned + # @!visibility private + def comparison_shift=(comparison_shift) + if comparison_shift.nil? + fail ArgumentError, 'invalid value for "comparison_shift", comparison_shift cannot be nil.' + end + @comparison_shift = comparison_shift + end + + # Custom attribute writer method with validation + # @param effective_time_window_days [Object] Object to be assigned + # @!visibility private + def effective_time_window_days=(effective_time_window_days) + if effective_time_window_days.nil? + fail ArgumentError, 'invalid value for "effective_time_window_days", effective_time_window_days cannot be nil.' + end + @effective_time_window_days = effective_time_window_days + 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 && + chart_type == o.chart_type && + comparison_shift == o.comparison_shift && + default_value == o.default_value && + directionality == o.directionality && + effective_time_window_days == o.effective_time_window_days && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [chart_type, comparison_shift, default_value, directionality, effective_time_window_days, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_resource_type.rb b/lib/datadog_api_client/v2/models/governance_insight_resource_type.rb new file mode 100644 index 000000000000..0cab5e6a39d1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_resource_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 + # JSON:API resource type for a governance insight. + class GovernanceInsightResourceType + include BaseEnumModel + + INSIGHT = "insight".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insight_usage_query.rb b/lib/datadog_api_client/v2/models/governance_insight_usage_query.rb new file mode 100644 index 000000000000..4cbed9ecad8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insight_usage_query.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 + # A usage query used to compute an insight value. + class GovernanceInsightUsageQuery + include BaseGenericModel + + # The usage query string. + attr_reader :query + + # How the query result series is reduced to a single value. + attr_reader :reducer + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query', + :'reducer' => :'reducer' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'String', + :'reducer' => :'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::GovernanceInsightUsageQuery` 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?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'reducer') + self.reducer = attributes[:'reducer'] + 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 @query.nil? + return false if @reducer.nil? + true + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param reducer [Object] Object to be assigned + # @!visibility private + def reducer=(reducer) + if reducer.nil? + fail ArgumentError, 'invalid value for "reducer", reducer cannot be nil.' + end + @reducer = reducer + 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 && + query == o.query && + reducer == o.reducer && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, reducer, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/governance_insights_response.rb b/lib/datadog_api_client/v2/models/governance_insights_response.rb new file mode 100644 index 000000000000..3791a7d69b78 --- /dev/null +++ b/lib/datadog_api_client/v2/models/governance_insights_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 + # A list of governance insights. + class GovernanceInsightsResponse + include BaseGenericModel + + # An array of governance insight resources. + 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::GovernanceInsightsResponse` 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/version.rb b/lib/datadog_api_client/version.rb index 805070be4c65..8e7514822019 100644 --- a/lib/datadog_api_client/version.rb +++ b/lib/datadog_api_client/version.rb @@ -1,5 +1,5 @@ # Define library version. module DatadogAPIClient - VERSION = '2.54.0' + VERSION = '2.55.0' end