diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dede702aea..c5a2287b3a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -93,6 +93,43 @@ components: required: true schema: type: string + AnnotationEndTimeQueryParameter: + description: End of the time window in milliseconds since the Unix epoch. + example: 1704153600000 + in: query + name: end_time + required: true + schema: + format: int64 + type: integer + AnnotationIDPathParameter: + description: The ID of the annotation. + example: "00000000-0000-0000-0000-000000000000" + in: path + name: annotation_id + required: true + schema: + format: uuid + type: string + AnnotationPageIDPathParameter: + description: |- + The ID of the page, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + in: path + name: page_id + required: true + schema: + type: string + AnnotationStartTimeQueryParameter: + description: Start of the time window in milliseconds since the Unix epoch. + example: 1704067200000 + in: query + name: start_time + required: true + schema: + format: int64 + type: integer AnomalyID: description: The UUID of the cost anomaly. in: path @@ -1034,6 +1071,15 @@ components: required: true schema: type: string + OAuthClientUUIDPathParameter: + description: UUID of the OAuth2 client. + in: path + name: client_uuid + required: true + schema: + example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + format: uuid + type: string OnDemandTaskId: description: The UUID of the task. example: "6d09294c-9ad9-42fd-a759-a0c1599b4828" @@ -5183,6 +5229,153 @@ components: - display - markdownTextAnnotation type: object + AnnotationAttributes: + description: Attributes of an annotation returned in a response. + properties: + author_id: + description: Identifier of the user who created the annotation. + example: "00000000-0000-0000-0000-000000000000" + type: string + color: + $ref: "#/components/schemas/AnnotationColor" + created_at: + description: Creation time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + description: + description: User-defined text attached to the annotation. + example: "Deployed v2.3.1 to production." + type: string + end_time: + description: End time of the annotation in milliseconds since the Unix epoch. Null for `pointInTime` annotations. + example: 1704070800000 + format: int64 + nullable: true + type: integer + modified_at: + description: Last modification time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + page_id: + description: |- + ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + type: string + start_time: + description: Start time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + type: + $ref: "#/components/schemas/AnnotationKind" + widget_ids: + description: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + example: + - "1234567890" + items: + description: Widget ID. + type: string + type: array + required: + - page_id + - description + - author_id + - type + - color + - start_time + - end_time + - created_at + - modified_at + type: object + AnnotationColor: + description: Color used to render the annotation in the UI. + enum: + - gray + - blue + - purple + - green + - yellow + - red + example: blue + type: string + x-enum-varnames: + - GRAY + - BLUE + - PURPLE + - GREEN + - YELLOW + - RED + AnnotationCreateAttributes: + description: Attributes for creating or updating an annotation. + properties: + color: + $ref: "#/components/schemas/AnnotationColor" + description: + description: User-defined text attached to the annotation. + example: "Deployed v2.3.1 to production." + type: string + end_time: + description: End time of the annotation in milliseconds since the Unix epoch. Required for `timeRegion` annotations; omit or set to null for `pointInTime` annotations. + example: 1704070800000 + format: int64 + nullable: true + type: integer + page_id: + description: |- + ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + type: string + start_time: + description: Start time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + type: + $ref: "#/components/schemas/AnnotationKind" + widget_ids: + description: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + example: + - "1234567890" + items: + description: Widget ID. + type: string + type: array + required: + - page_id + - description + - type + - color + - start_time + type: object + AnnotationCreateRequest: + description: Request body for creating an annotation. + properties: + data: + $ref: "#/components/schemas/AnnotationRequestData" + required: + - data + type: object + AnnotationData: + description: A single annotation resource. + properties: + attributes: + $ref: "#/components/schemas/AnnotationAttributes" + id: + description: Unique identifier of the annotation. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/AnnotationType" + required: + - id + - type + - attributes + type: object AnnotationDisplay: description: The definition of `AnnotationDisplay` object. properties: @@ -5209,6 +5402,85 @@ components: format: double type: number type: object + AnnotationInPage: + description: A flat annotation object as it appears within a page annotations response. + properties: + author_id: + description: Identifier of the user who created the annotation. + example: "00000000-0000-0000-0000-000000000000" + type: string + color: + $ref: "#/components/schemas/AnnotationColor" + created_at: + description: Creation time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + description: + description: User-defined text attached to the annotation. + example: "Deployed v2.3.1 to production." + type: string + end_time: + description: End time of the annotation in milliseconds since the Unix epoch. Null for `pointInTime` annotations. + example: 1704070800000 + format: int64 + nullable: true + type: integer + id: + description: Unique identifier of the annotation. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + modified_at: + description: Last modification time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + page_id: + description: |- + ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + type: string + start_time: + description: Start time of the annotation in milliseconds since the Unix epoch. + example: 1704067200000 + format: int64 + type: integer + type: + $ref: "#/components/schemas/AnnotationKind" + widget_ids: + description: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + example: + - "1234567890" + items: + description: Widget ID. + type: string + type: array + required: + - id + - page_id + - description + - author_id + - type + - color + - start_time + - end_time + - created_at + - modified_at + type: object + AnnotationKind: + description: |- + Kind of annotation. `pointInTime` annotations mark a single moment in time, + while `timeRegion` annotations span a window of time and require an `end_time`. + enum: + - pointInTime + - timeRegion + example: pointInTime + type: string + x-enum-varnames: + - POINT_IN_TIME + - TIME_REGION AnnotationMarkdownTextAnnotation: description: The definition of `AnnotationMarkdownTextAnnotation` object. properties: @@ -5216,6 +5488,73 @@ components: description: The `markdownTextAnnotation` `text`. type: string type: object + AnnotationRequestData: + description: Data for creating an annotation. + properties: + attributes: + $ref: "#/components/schemas/AnnotationCreateAttributes" + type: + $ref: "#/components/schemas/AnnotationType" + required: + - type + - attributes + type: object + AnnotationResponse: + description: Response containing a single annotation. + properties: + data: + $ref: "#/components/schemas/AnnotationData" + required: + - data + type: object + AnnotationType: + description: Annotation resource type. + enum: + - annotation + example: annotation + type: string + x-enum-varnames: + - ANNOTATION + AnnotationUpdateRequest: + description: Request body for updating an annotation. + properties: + data: + $ref: "#/components/schemas/AnnotationRequestData" + required: + - data + type: object + AnnotationsData: + description: List of annotation resources. + items: + $ref: "#/components/schemas/AnnotationData" + type: array + AnnotationsInPageMap: + additionalProperties: + $ref: "#/components/schemas/AnnotationInPage" + description: Map of annotation UUID to annotation object, keyed by annotation ID. + example: + "00000000-0000-0000-0000-000000000000": + author_id: "00000000-0000-0000-0000-000000000001" + color: blue + created_at: 1704067200000 + description: "Deployed v2.3.1 to production." + end_time: + id: "00000000-0000-0000-0000-000000000000" + modified_at: 1704067200000 + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + type: object + AnnotationsResponse: + description: Response containing a list of annotations. + properties: + data: + $ref: "#/components/schemas/AnnotationsData" + required: + - data + type: object AnonymizeUserError: description: Error encountered when anonymizing a specific user. properties: @@ -36582,6 +36921,15 @@ components: required: - type type: object + GlobalAnnotationIds: + description: List of annotation IDs that apply to the entire page rather than a specific widget. + example: + - "00000000-0000-0000-0000-000000000001" + items: + description: Annotation ID. + format: uuid + type: string + type: array GlobalIncidentSettingsAttributesRequest: description: Global incident settings attributes properties: @@ -54649,6 +54997,256 @@ components: - id - type type: object + OAuthClientRegistrationError: + description: Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. + properties: + error: + description: Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. + example: invalid_client_metadata + type: string + error_description: + description: Human-readable description of the error. + example: redirect URI is not well-formed + type: string + required: + - error + - error_description + type: object + OAuthClientRegistrationGrantType: + description: OAuth 2.0 grant type that a registered client may use. + enum: + - authorization_code + - refresh_token + example: authorization_code + type: string + x-enum-varnames: + - AUTHORIZATION_CODE + - REFRESH_TOKEN + OAuthClientRegistrationRequest: + description: Request payload for OAuth2 dynamic client registration as defined by RFC 7591. + properties: + client_name: + description: Human-readable name of the client. Control characters are rejected. + example: Example MCP Client + maxLength: 1000 + type: string + client_uri: + description: URL of the home page of the client. + example: https://example.com + maxLength: 1000 + type: string + grant_types: + description: |- + OAuth 2.0 grant types the client may use. + Defaults to `authorization_code` and `refresh_token` when omitted. + example: + - authorization_code + - refresh_token + items: + $ref: "#/components/schemas/OAuthClientRegistrationGrantType" + type: array + jwks_uri: + description: URL referencing the client's JSON Web Key Set. + example: https://example.com/.well-known/jwks.json + maxLength: 1000 + type: string + logo_uri: + description: URL referencing a logo for the client. + example: https://example.com/logo.png + maxLength: 1000 + type: string + policy_uri: + description: URL pointing to the client's privacy policy. + example: https://example.com/privacy + maxLength: 1000 + type: string + redirect_uris: + description: Array of redirection URI strings used by the client in redirect-based flows. + example: + - https://example.com/oauth/callback + items: + description: Redirection URI registered for the client. + example: https://example.com/oauth/callback + maxLength: 1000 + type: string + type: array + response_types: + description: OAuth 2.0 response types the client may use. Only `code` is supported. + example: + - code + items: + $ref: "#/components/schemas/OAuthClientRegistrationResponseType" + type: array + scope: + description: Space-separated list of scope values the client may request. + example: openid profile + maxLength: 1000 + type: string + token_endpoint_auth_method: + description: Requested authentication method for the token endpoint. Only `none` is supported. + example: none + maxLength: 20 + type: string + tos_uri: + description: URL pointing to the client's terms of service. + example: https://example.com/tos + maxLength: 1000 + type: string + required: + - client_name + - redirect_uris + type: object + OAuthClientRegistrationResponse: + description: Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. + properties: + client_id: + description: Unique identifier assigned to the registered client. + example: 72b68208-36a6-11f0-b21b-da7ad0900002 + format: uuid + type: string + client_name: + description: Human-readable name of the client. + example: Example MCP Client + type: string + grant_types: + description: OAuth 2.0 grant types registered for the client. + example: + - authorization_code + - refresh_token + items: + $ref: "#/components/schemas/OAuthClientRegistrationGrantType" + type: array + redirect_uris: + description: Redirection URIs registered for the client. + example: + - https://example.com/oauth/callback + items: + description: Redirection URI registered for the client. + example: https://example.com/oauth/callback + type: string + type: array + response_types: + description: OAuth 2.0 response types registered for the client. + example: + - code + items: + $ref: "#/components/schemas/OAuthClientRegistrationResponseType" + type: array + token_endpoint_auth_method: + description: Authentication method registered for the token endpoint. Always `none`. + example: none + type: string + required: + - client_id + - client_name + - redirect_uris + - token_endpoint_auth_method + - grant_types + - response_types + type: object + OAuthClientRegistrationResponseType: + description: OAuth 2.0 response type that a registered client may use. + enum: + - code + example: code + type: string + x-enum-varnames: + - CODE + OAuthOidcScope: + description: OIDC scope a client may be restricted to. + enum: + - openid + - profile + - email + - offline_access + example: openid + type: string + x-enum-varnames: + - OPENID + - PROFILE + - EMAIL + - OFFLINE_ACCESS + OAuthScopesRestriction: + description: Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + nullable: true + properties: + oidc_scopes: + description: OIDC scopes the client is restricted to. + example: + - openid + - email + items: + $ref: "#/components/schemas/OAuthOidcScope" + type: array + permission_scopes: + description: Datadog permission scopes the client is restricted to. + example: + - dashboards_read + - metrics_read + items: + description: Datadog permission scope name. + example: dashboards_read + type: string + type: array + required: + - oidc_scopes + - permission_scopes + type: object + OAuthScopesRestrictionResponse: + description: Response payload describing the scopes restriction of an OAuth2 client. + properties: + data: + $ref: "#/components/schemas/OAuthScopesRestrictionResponseData" + required: + - data + type: object + OAuthScopesRestrictionResponseAttributes: + description: Attributes of an OAuth2 client scopes restriction. + properties: + required_permission_scopes: + description: |- + Permission scopes automatically required for this client (for example, mobile-app permission scopes). + Returns `null` when no scopes are required. + example: + - mobile_app_access + items: + description: Datadog permission scope name. + example: mobile_app_access + type: string + nullable: true + type: array + scopes_restriction: + $ref: "#/components/schemas/OAuthScopesRestriction" + required: + - scopes_restriction + - required_permission_scopes + type: object + OAuthScopesRestrictionResponseData: + description: Data object of an OAuth2 client scopes restriction response. + properties: + attributes: + $ref: "#/components/schemas/OAuthScopesRestrictionResponseAttributes" + id: + description: UUID of the OAuth2 client this restriction applies to. + example: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + format: uuid + type: string + type: + $ref: "#/components/schemas/OAuthScopesRestrictionType" + required: + - id + - type + - attributes + type: object + OAuthScopesRestrictionType: + default: scopes_restriction + description: JSON:API resource type for an OAuth2 client scopes restriction. + enum: + - scopes_restriction + example: scopes_restriction + type: string + x-enum-varnames: + - SCOPES_RESTRICTION OCIConfig: description: OCI config. properties: @@ -62650,6 +63248,54 @@ components: required: - data type: object + PageAnnotationsAttributes: + description: Attributes of the annotations on a page. + properties: + annotations: + $ref: "#/components/schemas/AnnotationsInPageMap" + global_annotations: + $ref: "#/components/schemas/GlobalAnnotationIds" + widget_mapping: + $ref: "#/components/schemas/WidgetAnnotationsMap" + required: + - annotations + - widget_mapping + - global_annotations + type: object + PageAnnotationsData: + description: Annotations grouped by widget for a single page. + properties: + attributes: + $ref: "#/components/schemas/PageAnnotationsAttributes" + id: + description: |- + ID of the page, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + type: string + type: + $ref: "#/components/schemas/PageAnnotationsType" + required: + - id + - type + - attributes + type: object + PageAnnotationsResponse: + description: Response containing all annotations on a page, grouped by widget. + properties: + data: + $ref: "#/components/schemas/PageAnnotationsData" + required: + - data + type: object + PageAnnotationsType: + description: Page annotations resource type. + enum: + - page_annotations + example: page_annotations + type: string + x-enum-varnames: + - PAGE_ANNOTATIONS PageUrgency: default: high description: On-Call Page urgency level. @@ -92269,6 +92915,57 @@ components: - id - attributes type: object + UpsertOAuthScopesRestrictionData: + description: Data object of an upsert OAuth2 scopes restriction request. + properties: + attributes: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionDataAttributes" + type: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionType" + required: + - type + type: object + UpsertOAuthScopesRestrictionDataAttributes: + description: Attributes of an upsert OAuth2 scopes restriction request. + properties: + oidc_scopes: + description: OIDC scopes the client is allowed to request. + example: + - openid + - email + items: + $ref: "#/components/schemas/OAuthOidcScope" + type: array + permission_scopes: + description: |- + Datadog permission scopes the client is allowed to request. + Each value must be a valid permission name. + example: + - dashboards_read + - metrics_read + items: + description: Datadog permission scope name. + example: dashboards_read + type: string + type: array + type: object + UpsertOAuthScopesRestrictionRequest: + description: Request payload for creating or updating the scopes restriction of an OAuth2 client. + properties: + data: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionData" + required: + - data + type: object + UpsertOAuthScopesRestrictionType: + default: upsert_scopes_restriction + description: JSON:API resource type for an upsert OAuth2 client scopes restriction request. + enum: + - upsert_scopes_restriction + example: upsert_scopes_restriction + type: string + x-enum-varnames: + - UPSERT_SCOPES_RESTRICTION Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). enum: @@ -94099,6 +94796,23 @@ components: - FRIDAY - SATURDAY - SUNDAY + WidgetAnnotationIds: + description: List of annotation IDs displayed on a widget. + example: + - "00000000-0000-0000-0000-000000000000" + items: + description: Annotation ID. + format: uuid + type: string + type: array + WidgetAnnotationsMap: + additionalProperties: + $ref: "#/components/schemas/WidgetAnnotationIds" + description: Map from widget ID to the list of annotation IDs displayed on that widget. + example: + "1234567890": + - "00000000-0000-0000-0000-000000000000" + type: object WidgetAttributes: description: Attributes of a widget resource. properties: @@ -98338,6 +99052,363 @@ paths: operator: OR permissions: - security_monitoring_findings_read + /api/v2/annotation: + get: + description: Returns a flat list of annotations matching the given page, time window, and optional widget filter. + operationId: ListAnnotations + parameters: + - description: |- + ID of the page to list annotations for, prefixed with the page type and joined by a colon + (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + example: "dashboard:abc-def-xyz" + in: query + name: page_id + required: true + schema: + type: string + - $ref: "#/components/parameters/AnnotationStartTimeQueryParameter" + - $ref: "#/components/parameters/AnnotationEndTimeQueryParameter" + - description: Optional widget ID to restrict results to annotations on a specific widget. + in: query + name: widget_id + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + author_id: "00000000-0000-0000-0000-000000000001" + color: blue + created_at: 1704067200000 + description: "Deployed v2.3.1 to production." + end_time: + modified_at: 1704067200000 + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + id: "00000000-0000-0000-0000-000000000000" + type: annotation + schema: + $ref: "#/components/schemas/AnnotationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List annotations + tags: + - Annotations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Creates a new annotation on a dashboard or notebook page. + Valid `color` values: `gray`, `blue`, `purple`, `green`, `yellow`, `red`. + Valid `type` values: `pointInTime` (marks a single moment) or `timeRegion` (spans a range and requires `end_time`). + operationId: CreateAnnotation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + color: blue + description: "Deployed v2.3.1 to production." + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + type: annotation + schema: + $ref: "#/components/schemas/AnnotationCreateRequest" + description: Annotation to create. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author_id: "00000000-0000-0000-0000-000000000001" + color: blue + created_at: 1704067200000 + description: "Deployed v2.3.1 to production." + end_time: + modified_at: 1704067200000 + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + id: "00000000-0000-0000-0000-000000000000" + type: annotation + schema: + $ref: "#/components/schemas/AnnotationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create an annotation + tags: + - Annotations + 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/annotation/page/{page_id}: + get: + description: |- + Returns all annotations on a specific page for a given time window, grouped by widget. + Unlike `ListAnnotations`, this endpoint returns a single structured object with annotations + indexed by their ID and a widget-to-annotation mapping for easy UI rendering. + operationId: GetPageAnnotations + parameters: + - $ref: "#/components/parameters/AnnotationPageIDPathParameter" + - $ref: "#/components/parameters/AnnotationStartTimeQueryParameter" + - $ref: "#/components/parameters/AnnotationEndTimeQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + annotations: + "00000000-0000-0000-0000-000000000000": + author_id: "00000000-0000-0000-0000-000000000001" + color: blue + created_at: 1704067200000 + description: "Deployed v2.3.1 to production." + end_time: + id: "00000000-0000-0000-0000-000000000000" + modified_at: 1704067200000 + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + global_annotations: + - "00000000-0000-0000-0000-000000000002" + widget_mapping: + "1234567890": + - "00000000-0000-0000-0000-000000000000" + id: "dashboard:abc-def-xyz" + type: page_annotations + schema: + $ref: "#/components/schemas/PageAnnotationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get annotations for a page + tags: + - Annotations + 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/annotation/{annotation_id}: + delete: + description: |- + Deletes an existing annotation by ID. + Returns `204 No Content` if the annotation does not exist (idempotent). + operationId: DeleteAnnotation + parameters: + - $ref: "#/components/parameters/AnnotationIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete an annotation + tags: + - Annotations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: |- + Updates an existing annotation. + Valid `color` values: `gray`, `blue`, `purple`, `green`, `yellow`, `red`. + Valid `type` values: `pointInTime` (marks a single moment) or `timeRegion` (spans a range and requires `end_time`). + operationId: UpdateAnnotation + parameters: + - $ref: "#/components/parameters/AnnotationIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + color: green + description: "Deployed v2.3.1 to production (updated)." + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + type: annotation + schema: + $ref: "#/components/schemas/AnnotationUpdateRequest" + description: Updated annotation payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author_id: "00000000-0000-0000-0000-000000000001" + color: green + created_at: 1704067200000 + description: "Deployed v2.3.1 to production (updated)." + end_time: + modified_at: 1704070800000 + page_id: "dashboard:abc-def-xyz" + start_time: 1704067200000 + type: pointInTime + widget_ids: + - "1234567890" + id: "00000000-0000-0000-0000-000000000000" + type: annotation + schema: + $ref: "#/components/schemas/AnnotationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update an annotation + tags: + - Annotations + 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/anonymize_users: put: description: |- @@ -134428,6 +135499,223 @@ paths: summary: Get all aggregated DNS traffic tags: - Cloud Network Monitoring + /api/v2/oauth2/clients/{client_uuid}/scopes_restriction: + delete: + description: Delete the scopes restriction configured for the OAuth2 client. + operationId: DeleteScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the scopes restriction configured for the OAuth2 client. + operationId: GetScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + required_permission_scopes: + scopes_restriction: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + type: scopes_restriction + schema: + $ref: "#/components/schemas/OAuthScopesRestrictionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-permission: + operator: OR + permissions: + - org_authorized_apps_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create or update the scopes restriction configured for the OAuth2 client. + operationId: UpsertScopesRestriction + parameters: + - $ref: "#/components/parameters/OAuthClientUUIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + type: upsert_scopes_restriction + schema: + $ref: "#/components/schemas/UpsertOAuthScopesRestrictionRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + required_permission_scopes: + scopes_restriction: + oidc_scopes: + - openid + - email + permission_scopes: + - dashboards_read + - metrics_read + id: fafa8e1c-36a5-11f0-a83d-da7ad0900001 + type: scopes_restriction + schema: + $ref: "#/components/schemas/OAuthScopesRestrictionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Upsert an OAuth2 client scopes restriction + tags: + - OAuth2 Client Public + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - org_authorized_apps_write + 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/oauth2/register: + post: + description: Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + operationId: RegisterOAuthClient + requestBody: + content: + application/json: + examples: + default: + value: + client_name: Example MCP Client + grant_types: + - authorization_code + - refresh_token + redirect_uris: + - https://example.com/oauth/callback + response_types: + - code + token_endpoint_auth_method: none + schema: + $ref: "#/components/schemas/OAuthClientRegistrationRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + client_id: 72b68208-36a6-11f0-b21b-da7ad0900002 + client_name: Example MCP Client + grant_types: + - authorization_code + - refresh_token + redirect_uris: + - https://example.com/oauth/callback + response_types: + - code + token_endpoint_auth_method: none + schema: + $ref: "#/components/schemas/OAuthClientRegistrationResponse" + description: Created + "400": + content: + application/json: + examples: + default: + value: + error: invalid_client_metadata + error_description: redirect URI is not well-formed + schema: + $ref: "#/components/schemas/OAuthClientRegistrationError" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: [] + summary: Register an OAuth2 client + tags: + - OAuth2 Client Public + x-codegen-request-body-name: body + 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/obs-pipelines/pipelines: get: description: Retrieve a list of pipelines. @@ -167537,6 +168825,8 @@ tags: Agentless offers also Sensitive Data Scanning capabilities on your storage. Go to https://www.datadoghq.com/blog/agentless-scanning/ to learn more. name: "Agentless Scanning" + - description: Add annotations to dashboards and notebooks to mark events such as deployments, incidents, or other notable moments in time. + name: Annotations - description: |- Datadog App Builder provides a low-code solution to rapidly develop and integrate secure, customized applications into your monitoring stack that are built to accelerate remediation at scale. These API endpoints allow you to create, read, update, delete, and publish apps. name: App Builder @@ -167842,6 +169132,10 @@ tags: - description: |- The Network Device Monitoring API allows you to fetch devices and interfaces and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring + - description: |- + Configure OAuth2 clients for Datadog. + Supports RFC 7591 Dynamic Client Registration and management of OAuth2 client scopes restrictions. + name: OAuth2 Client Public - description: Auto-generated tag OCI Integration name: OCI Integration - description: |- diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index b983e4d251..f991708825 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -25,6 +25,13 @@ datadog\_api\_client.v2.api.agentless\_scanning\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.annotations\_api module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.annotations_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.api\_management\_api module ------------------------------------------------------- @@ -473,6 +480,13 @@ datadog\_api\_client.v2.api.network\_device\_monitoring\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.o\_auth2\_client\_public\_api module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.o_auth2_client_public_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.observability\_pipelines\_api module ---------------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 8c6243db4a..9e217994f2 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -767,6 +767,41 @@ datadog\_api\_client.v2.model.annotation module :members: :show-inheritance: +datadog\_api\_client.v2.model.annotation\_attributes module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_color module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.annotation_color + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_create\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_create\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_data module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.annotation\_display module -------------------------------------------------------- @@ -781,6 +816,20 @@ datadog\_api\_client.v2.model.annotation\_display\_bounds module :members: :show-inheritance: +datadog\_api\_client.v2.model.annotation\_in\_page module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_in_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_kind module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_kind + :members: + :show-inheritance: + datadog\_api\_client.v2.model.annotation\_markdown\_text\_annotation module --------------------------------------------------------------------------- @@ -788,6 +837,48 @@ datadog\_api\_client.v2.model.annotation\_markdown\_text\_annotation module :members: :show-inheritance: +datadog\_api\_client.v2.model.annotation\_request\_data module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_response module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_type module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotation\_update\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotation_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotations\_in\_page\_map module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotations_in_page_map + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.annotations\_response module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.annotations_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.anonymize\_user\_error module ----------------------------------------------------------- @@ -23447,6 +23538,83 @@ datadog\_api\_client.v2.model.nullable\_user\_relationship\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.o\_auth\_client\_registration\_error module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_client_registration_error + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_client\_registration\_grant\_type module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_client_registration_grant_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_client\_registration\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_client_registration_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_client\_registration\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_client_registration_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_client\_registration\_response\_type module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_client_registration_response_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_oidc\_scope module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_oidc_scope + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_scopes\_restriction module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_scopes_restriction + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_scopes\_restriction\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_scopes_restriction_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_scopes\_restriction\_response\_attributes module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_scopes_restriction_response_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_scopes\_restriction\_response\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_scopes_restriction_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.o\_auth\_scopes\_restriction\_type module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.o_auth_scopes_restriction_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.observability\_pipeline module ------------------------------------------------------------ @@ -26996,6 +27164,34 @@ datadog\_api\_client.v2.model.overwrite\_allocations\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.page\_annotations\_attributes module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.page_annotations_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.page\_annotations\_data module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.page_annotations_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.page\_annotations\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.page_annotations_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.page\_annotations\_type module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.page_annotations_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.page\_urgency module -------------------------------------------------- @@ -40261,6 +40457,34 @@ datadog\_api\_client.v2.model.upsert\_cloud\_inventory\_sync\_config\_request\_d :members: :show-inheritance: +datadog\_api\_client.v2.model.upsert\_o\_auth\_scopes\_restriction\_data module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.upsert\_o\_auth\_scopes\_restriction\_data\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.upsert\_o\_auth\_scopes\_restriction\_request module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.upsert\_o\_auth\_scopes\_restriction\_type module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.urgency module -------------------------------------------- @@ -41150,6 +41374,13 @@ datadog\_api\_client.v2.model.weekday module :members: :show-inheritance: +datadog\_api\_client.v2.model.widget\_annotations\_map module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_annotations_map + :members: + :show-inheritance: + datadog\_api\_client.v2.model.widget\_attributes module ------------------------------------------------------- diff --git a/examples/v2/annotations/CreateAnnotation.py b/examples/v2/annotations/CreateAnnotation.py new file mode 100644 index 0000000000..3ead88cc1c --- /dev/null +++ b/examples/v2/annotations/CreateAnnotation.py @@ -0,0 +1,36 @@ +""" +Create an annotation returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.annotations_api import AnnotationsApi +from datadog_api_client.v2.model.annotation_color import AnnotationColor +from datadog_api_client.v2.model.annotation_create_attributes import AnnotationCreateAttributes +from datadog_api_client.v2.model.annotation_create_request import AnnotationCreateRequest +from datadog_api_client.v2.model.annotation_kind import AnnotationKind +from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData +from datadog_api_client.v2.model.annotation_type import AnnotationType + +body = AnnotationCreateRequest( + data=AnnotationRequestData( + attributes=AnnotationCreateAttributes( + color=AnnotationColor.BLUE, + description="Deployed v2.3.1 to production.", + page_id="dashboard:abc-def-xyz", + start_time=1704067200000, + type=AnnotationKind.POINT_IN_TIME, + widget_ids=[ + "1234567890", + ], + ), + type=AnnotationType.ANNOTATION, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_annotation"] = True +with ApiClient(configuration) as api_client: + api_instance = AnnotationsApi(api_client) + response = api_instance.create_annotation(body=body) + + print(response) diff --git a/examples/v2/annotations/DeleteAnnotation.py b/examples/v2/annotations/DeleteAnnotation.py new file mode 100644 index 0000000000..392bf88de2 --- /dev/null +++ b/examples/v2/annotations/DeleteAnnotation.py @@ -0,0 +1,18 @@ +""" +Delete an annotation returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.annotations_api import AnnotationsApi + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ID = environ["ANNOTATION_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_annotation"] = True +with ApiClient(configuration) as api_client: + api_instance = AnnotationsApi(api_client) + api_instance.delete_annotation( + annotation_id=ANNOTATION_DATA_ID, + ) diff --git a/examples/v2/annotations/GetPageAnnotations.py b/examples/v2/annotations/GetPageAnnotations.py new file mode 100644 index 0000000000..1bc9843da8 --- /dev/null +++ b/examples/v2/annotations/GetPageAnnotations.py @@ -0,0 +1,22 @@ +""" +Get annotations for a page returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.annotations_api import AnnotationsApi + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = environ["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_page_annotations"] = True +with ApiClient(configuration) as api_client: + api_instance = AnnotationsApi(api_client) + response = api_instance.get_page_annotations( + page_id=ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, + start_time=1704067200000, + end_time=1704153600000, + ) + + print(response) diff --git a/examples/v2/annotations/ListAnnotations.py b/examples/v2/annotations/ListAnnotations.py new file mode 100644 index 0000000000..064d203907 --- /dev/null +++ b/examples/v2/annotations/ListAnnotations.py @@ -0,0 +1,22 @@ +""" +List annotations returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.annotations_api import AnnotationsApi + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = environ["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"] + +configuration = Configuration() +configuration.unstable_operations["list_annotations"] = True +with ApiClient(configuration) as api_client: + api_instance = AnnotationsApi(api_client) + response = api_instance.list_annotations( + page_id=ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, + start_time=1704067200000, + end_time=1704153600000, + ) + + print(response) diff --git a/examples/v2/annotations/UpdateAnnotation.py b/examples/v2/annotations/UpdateAnnotation.py new file mode 100644 index 0000000000..55714f5041 --- /dev/null +++ b/examples/v2/annotations/UpdateAnnotation.py @@ -0,0 +1,37 @@ +""" +Update an annotation returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.annotations_api import AnnotationsApi +from datadog_api_client.v2.model.annotation_color import AnnotationColor +from datadog_api_client.v2.model.annotation_create_attributes import AnnotationCreateAttributes +from datadog_api_client.v2.model.annotation_kind import AnnotationKind +from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData +from datadog_api_client.v2.model.annotation_type import AnnotationType +from datadog_api_client.v2.model.annotation_update_request import AnnotationUpdateRequest + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ID = environ["ANNOTATION_DATA_ID"] + +body = AnnotationUpdateRequest( + data=AnnotationRequestData( + attributes=AnnotationCreateAttributes( + color=AnnotationColor.GREEN, + description="Updated annotation.", + page_id="dashboard:abc-def-xyz", + start_time=1704067200000, + type=AnnotationKind.POINT_IN_TIME, + ), + type=AnnotationType.ANNOTATION, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_annotation"] = True +with ApiClient(configuration) as api_client: + api_instance = AnnotationsApi(api_client) + response = api_instance.update_annotation(annotation_id=ANNOTATION_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/oauth2-client-public/DeleteScopesRestriction.py b/examples/v2/oauth2-client-public/DeleteScopesRestriction.py new file mode 100644 index 0000000000..86101a3d85 --- /dev/null +++ b/examples/v2/oauth2-client-public/DeleteScopesRestriction.py @@ -0,0 +1,15 @@ +""" +Delete an OAuth2 client scopes restriction returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.o_auth2_client_public_api import OAuth2ClientPublicApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_scopes_restriction"] = True +with ApiClient(configuration) as api_client: + api_instance = OAuth2ClientPublicApi(api_client) + api_instance.delete_scopes_restriction( + client_uuid=UUID("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), + ) diff --git a/examples/v2/oauth2-client-public/GetScopesRestriction.py b/examples/v2/oauth2-client-public/GetScopesRestriction.py new file mode 100644 index 0000000000..5e4dde568c --- /dev/null +++ b/examples/v2/oauth2-client-public/GetScopesRestriction.py @@ -0,0 +1,17 @@ +""" +Get an OAuth2 client scopes restriction returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.o_auth2_client_public_api import OAuth2ClientPublicApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["get_scopes_restriction"] = True +with ApiClient(configuration) as api_client: + api_instance = OAuth2ClientPublicApi(api_client) + response = api_instance.get_scopes_restriction( + client_uuid=UUID("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), + ) + + print(response) diff --git a/examples/v2/oauth2-client-public/RegisterOAuthClient.py b/examples/v2/oauth2-client-public/RegisterOAuthClient.py new file mode 100644 index 0000000000..106acdbc6c --- /dev/null +++ b/examples/v2/oauth2-client-public/RegisterOAuthClient.py @@ -0,0 +1,38 @@ +""" +Register an OAuth2 client returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.o_auth2_client_public_api import OAuth2ClientPublicApi +from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType +from datadog_api_client.v2.model.o_auth_client_registration_request import OAuthClientRegistrationRequest +from datadog_api_client.v2.model.o_auth_client_registration_response_type import OAuthClientRegistrationResponseType + +body = OAuthClientRegistrationRequest( + client_name="Example MCP Client", + client_uri="https://example.com", + grant_types=[ + OAuthClientRegistrationGrantType.AUTHORIZATION_CODE, + OAuthClientRegistrationGrantType.REFRESH_TOKEN, + ], + jwks_uri="https://example.com/.well-known/jwks.json", + logo_uri="https://example.com/logo.png", + policy_uri="https://example.com/privacy", + redirect_uris=[ + "https://example.com/oauth/callback", + ], + response_types=[ + OAuthClientRegistrationResponseType.CODE, + ], + scope="openid profile", + token_endpoint_auth_method="none", + tos_uri="https://example.com/tos", +) + +configuration = Configuration() +configuration.unstable_operations["register_o_auth_client"] = True +with ApiClient(configuration) as api_client: + api_instance = OAuth2ClientPublicApi(api_client) + response = api_instance.register_o_auth_client(body=body) + + print(response) diff --git a/examples/v2/oauth2-client-public/UpsertScopesRestriction.py b/examples/v2/oauth2-client-public/UpsertScopesRestriction.py new file mode 100644 index 0000000000..ecda5c6b40 --- /dev/null +++ b/examples/v2/oauth2-client-public/UpsertScopesRestriction.py @@ -0,0 +1,40 @@ +""" +Upsert an OAuth2 client scopes restriction returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.o_auth2_client_public_api import OAuth2ClientPublicApi +from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data import UpsertOAuthScopesRestrictionData +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data_attributes import ( + UpsertOAuthScopesRestrictionDataAttributes, +) +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_request import UpsertOAuthScopesRestrictionRequest +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_type import UpsertOAuthScopesRestrictionType +from uuid import UUID + +body = UpsertOAuthScopesRestrictionRequest( + data=UpsertOAuthScopesRestrictionData( + attributes=UpsertOAuthScopesRestrictionDataAttributes( + oidc_scopes=[ + OAuthOidcScope.OPENID, + OAuthOidcScope.EMAIL, + ], + permission_scopes=[ + "dashboards_read", + "metrics_read", + ], + ), + type=UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION, + ), +) + +configuration = Configuration() +configuration.unstable_operations["upsert_scopes_restriction"] = True +with ApiClient(configuration) as api_client: + api_instance = OAuth2ClientPublicApi(api_client) + response = api_instance.upsert_scopes_restriction( + client_uuid=UUID("fafa8e1c-36a5-11f0-a83d-da7ad0900001"), body=body + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 3b007a97f4..1a19d51fb5 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -309,6 +309,11 @@ def __init__( "v2.update_llm_obs_dataset_records": False, "v2.update_llm_obs_experiment": False, "v2.update_llm_obs_project": False, + "v2.create_annotation": False, + "v2.delete_annotation": False, + "v2.get_page_annotations": False, + "v2.list_annotations": False, + "v2.update_annotation": False, "v2.anonymize_users": False, "v2.validate": False, "v2.create_open_api": False, @@ -578,6 +583,10 @@ def __init__( "v2.update_monitor_user_template": False, "v2.validate_existing_monitor_user_template": False, "v2.validate_monitor_user_template": False, + "v2.delete_scopes_restriction": False, + "v2.get_scopes_restriction": False, + "v2.register_o_auth_client": False, + "v2.upsert_scopes_restriction": False, "v2.bulk_update_org_group_memberships": False, "v2.create_org_group": False, "v2.create_org_group_policy": False, diff --git a/src/datadog_api_client/v2/api/annotations_api.py b/src/datadog_api_client/v2/api/annotations_api.py new file mode 100644 index 0000000000..a8eab57370 --- /dev/null +++ b/src/datadog_api_client/v2/api/annotations_api.py @@ -0,0 +1,300 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, + UUID, +) +from datadog_api_client.v2.model.annotations_response import AnnotationsResponse +from datadog_api_client.v2.model.annotation_response import AnnotationResponse +from datadog_api_client.v2.model.annotation_create_request import AnnotationCreateRequest +from datadog_api_client.v2.model.page_annotations_response import PageAnnotationsResponse +from datadog_api_client.v2.model.annotation_update_request import AnnotationUpdateRequest + + +class AnnotationsApi: + """ + Add annotations to dashboards and notebooks to mark events such as deployments, incidents, or other notable moments in time. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_annotation_endpoint = _Endpoint( + settings={ + "response_type": (AnnotationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/annotation", + "operation_id": "create_annotation", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AnnotationCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_annotation_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/annotation/{annotation_id}", + "operation_id": "delete_annotation", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "annotation_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "annotation_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_page_annotations_endpoint = _Endpoint( + settings={ + "response_type": (PageAnnotationsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/annotation/page/{page_id}", + "operation_id": "get_page_annotations", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_id": { + "required": True, + "openapi_types": (str,), + "attribute": "page_id", + "location": "path", + }, + "start_time": { + "required": True, + "openapi_types": (int,), + "attribute": "start_time", + "location": "query", + }, + "end_time": { + "required": True, + "openapi_types": (int,), + "attribute": "end_time", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_annotations_endpoint = _Endpoint( + settings={ + "response_type": (AnnotationsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/annotation", + "operation_id": "list_annotations", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_id": { + "required": True, + "openapi_types": (str,), + "attribute": "page_id", + "location": "query", + }, + "start_time": { + "required": True, + "openapi_types": (int,), + "attribute": "start_time", + "location": "query", + }, + "end_time": { + "required": True, + "openapi_types": (int,), + "attribute": "end_time", + "location": "query", + }, + "widget_id": { + "openapi_types": (str,), + "attribute": "widget_id", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_annotation_endpoint = _Endpoint( + settings={ + "response_type": (AnnotationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/annotation/{annotation_id}", + "operation_id": "update_annotation", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "annotation_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "annotation_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (AnnotationUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_annotation( + self, + body: AnnotationCreateRequest, + ) -> AnnotationResponse: + """Create an annotation. + + Creates a new annotation on a dashboard or notebook page. + Valid ``color`` values: ``gray`` , ``blue`` , ``purple`` , ``green`` , ``yellow`` , ``red``. + Valid ``type`` values: ``pointInTime`` (marks a single moment) or ``timeRegion`` (spans a range and requires ``end_time`` ). + + :param body: Annotation to create. + :type body: AnnotationCreateRequest + :rtype: AnnotationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_annotation_endpoint.call_with_http_info(**kwargs) + + def delete_annotation( + self, + annotation_id: UUID, + ) -> None: + """Delete an annotation. + + Deletes an existing annotation by ID. + Returns ``204 No Content`` if the annotation does not exist (idempotent). + + :param annotation_id: The ID of the annotation. + :type annotation_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["annotation_id"] = annotation_id + + return self._delete_annotation_endpoint.call_with_http_info(**kwargs) + + def get_page_annotations( + self, + page_id: str, + start_time: int, + end_time: int, + ) -> PageAnnotationsResponse: + """Get annotations for a page. + + Returns all annotations on a specific page for a given time window, grouped by widget. + Unlike ``ListAnnotations`` , this endpoint returns a single structured object with annotations + indexed by their ID and a widget-to-annotation mapping for easy UI rendering. + + :param page_id: The ID of the page, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type page_id: str + :param start_time: Start of the time window in milliseconds since the Unix epoch. + :type start_time: int + :param end_time: End of the time window in milliseconds since the Unix epoch. + :type end_time: int + :rtype: PageAnnotationsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["page_id"] = page_id + + kwargs["start_time"] = start_time + + kwargs["end_time"] = end_time + + return self._get_page_annotations_endpoint.call_with_http_info(**kwargs) + + def list_annotations( + self, + page_id: str, + start_time: int, + end_time: int, + *, + widget_id: Union[str, UnsetType] = unset, + ) -> AnnotationsResponse: + """List annotations. + + Returns a flat list of annotations matching the given page, time window, and optional widget filter. + + :param page_id: ID of the page to list annotations for, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type page_id: str + :param start_time: Start of the time window in milliseconds since the Unix epoch. + :type start_time: int + :param end_time: End of the time window in milliseconds since the Unix epoch. + :type end_time: int + :param widget_id: Optional widget ID to restrict results to annotations on a specific widget. + :type widget_id: str, optional + :rtype: AnnotationsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["page_id"] = page_id + + kwargs["start_time"] = start_time + + kwargs["end_time"] = end_time + + if widget_id is not unset: + kwargs["widget_id"] = widget_id + + return self._list_annotations_endpoint.call_with_http_info(**kwargs) + + def update_annotation( + self, + annotation_id: UUID, + body: AnnotationUpdateRequest, + ) -> AnnotationResponse: + """Update an annotation. + + Updates an existing annotation. + Valid ``color`` values: ``gray`` , ``blue`` , ``purple`` , ``green`` , ``yellow`` , ``red``. + Valid ``type`` values: ``pointInTime`` (marks a single moment) or ``timeRegion`` (spans a range and requires ``end_time`` ). + + :param annotation_id: The ID of the annotation. + :type annotation_id: UUID + :param body: Updated annotation payload. + :type body: AnnotationUpdateRequest + :rtype: AnnotationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["annotation_id"] = annotation_id + + kwargs["body"] = body + + return self._update_annotation_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/api/o_auth2_client_public_api.py b/src/datadog_api_client/v2/api/o_auth2_client_public_api.py new file mode 100644 index 0000000000..fb59506fc6 --- /dev/null +++ b/src/datadog_api_client/v2/api/o_auth2_client_public_api.py @@ -0,0 +1,191 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UUID, +) +from datadog_api_client.v2.model.o_auth_scopes_restriction_response import OAuthScopesRestrictionResponse +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_request import UpsertOAuthScopesRestrictionRequest +from datadog_api_client.v2.model.o_auth_client_registration_response import OAuthClientRegistrationResponse +from datadog_api_client.v2.model.o_auth_client_registration_request import OAuthClientRegistrationRequest + + +class OAuth2ClientPublicApi: + """ + Configure OAuth2 clients for Datadog. + Supports RFC 7591 Dynamic Client Registration and management of OAuth2 client scopes restrictions. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._delete_scopes_restriction_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction", + "operation_id": "delete_scopes_restriction", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "client_uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "client_uuid", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_scopes_restriction_endpoint = _Endpoint( + settings={ + "response_type": (OAuthScopesRestrictionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction", + "operation_id": "get_scopes_restriction", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "client_uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "client_uuid", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._register_o_auth_client_endpoint = _Endpoint( + settings={ + "response_type": (OAuthClientRegistrationResponse,), + "auth": [], + "endpoint_path": "/api/v2/oauth2/register", + "operation_id": "register_o_auth_client", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (OAuthClientRegistrationRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._upsert_scopes_restriction_endpoint = _Endpoint( + settings={ + "response_type": (OAuthScopesRestrictionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/oauth2/clients/{client_uuid}/scopes_restriction", + "operation_id": "upsert_scopes_restriction", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "client_uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "client_uuid", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpsertOAuthScopesRestrictionRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def delete_scopes_restriction( + self, + client_uuid: UUID, + ) -> None: + """Delete an OAuth2 client scopes restriction. + + Delete the scopes restriction configured for the OAuth2 client. + + :param client_uuid: UUID of the OAuth2 client. + :type client_uuid: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["client_uuid"] = client_uuid + + return self._delete_scopes_restriction_endpoint.call_with_http_info(**kwargs) + + def get_scopes_restriction( + self, + client_uuid: UUID, + ) -> OAuthScopesRestrictionResponse: + """Get an OAuth2 client scopes restriction. + + Get the scopes restriction configured for the OAuth2 client. + + :param client_uuid: UUID of the OAuth2 client. + :type client_uuid: UUID + :rtype: OAuthScopesRestrictionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["client_uuid"] = client_uuid + + return self._get_scopes_restriction_endpoint.call_with_http_info(**kwargs) + + def register_o_auth_client( + self, + body: OAuthClientRegistrationRequest, + ) -> OAuthClientRegistrationResponse: + """Register an OAuth2 client. + + Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + + :type body: OAuthClientRegistrationRequest + :rtype: OAuthClientRegistrationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._register_o_auth_client_endpoint.call_with_http_info(**kwargs) + + def upsert_scopes_restriction( + self, + client_uuid: UUID, + body: UpsertOAuthScopesRestrictionRequest, + ) -> OAuthScopesRestrictionResponse: + """Upsert an OAuth2 client scopes restriction. + + Create or update the scopes restriction configured for the OAuth2 client. + + :param client_uuid: UUID of the OAuth2 client. + :type client_uuid: UUID + :type body: UpsertOAuthScopesRestrictionRequest + :rtype: OAuthScopesRestrictionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["client_uuid"] = client_uuid + + kwargs["body"] = body + + return self._upsert_scopes_restriction_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 6f2ebf73d1..0e4e23400c 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -6,6 +6,7 @@ from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi from datadog_api_client.v2.api.actions_datastores_api import ActionsDatastoresApi from datadog_api_client.v2.api.agentless_scanning_api import AgentlessScanningApi +from datadog_api_client.v2.api.annotations_api import AnnotationsApi from datadog_api_client.v2.api.app_builder_api import AppBuilderApi from datadog_api_client.v2.api.application_security_api import ApplicationSecurityApi from datadog_api_client.v2.api.audit_api import AuditApi @@ -65,6 +66,7 @@ from datadog_api_client.v2.api.model_lab_api_api import ModelLabAPIApi from datadog_api_client.v2.api.monitors_api import MonitorsApi from datadog_api_client.v2.api.network_device_monitoring_api import NetworkDeviceMonitoringApi +from datadog_api_client.v2.api.o_auth2_client_public_api import OAuth2ClientPublicApi from datadog_api_client.v2.api.oci_integration_api import OCIIntegrationApi from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi from datadog_api_client.v2.api.okta_integration_api import OktaIntegrationApi @@ -122,6 +124,7 @@ "ActionConnectionApi", "ActionsDatastoresApi", "AgentlessScanningApi", + "AnnotationsApi", "AppBuilderApi", "ApplicationSecurityApi", "AuditApi", @@ -181,6 +184,7 @@ "ModelLabAPIApi", "MonitorsApi", "NetworkDeviceMonitoringApi", + "OAuth2ClientPublicApi", "OCIIntegrationApi", "ObservabilityPipelinesApi", "OktaIntegrationApi", diff --git a/src/datadog_api_client/v2/model/annotation_attributes.py b/src/datadog_api_client/v2/model/annotation_attributes.py new file mode 100644 index 0000000000..d79be626cc --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_attributes.py @@ -0,0 +1,115 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + +class AnnotationAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + return { + "author_id": (str,), + "color": (AnnotationColor,), + "created_at": (int,), + "description": (str,), + "end_time": (int, none_type), + "modified_at": (int,), + "page_id": (str,), + "start_time": (int,), + "type": (AnnotationKind,), + "widget_ids": ([str],), + } + + attribute_map = { + "author_id": "author_id", + "color": "color", + "created_at": "created_at", + "description": "description", + "end_time": "end_time", + "modified_at": "modified_at", + "page_id": "page_id", + "start_time": "start_time", + "type": "type", + "widget_ids": "widget_ids", + } + + def __init__( + self_, + author_id: str, + color: AnnotationColor, + created_at: int, + description: str, + end_time: Union[int, none_type], + modified_at: int, + page_id: str, + start_time: int, + type: AnnotationKind, + widget_ids: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes of an annotation returned in a response. + + :param author_id: Identifier of the user who created the annotation. + :type author_id: str + + :param color: Color used to render the annotation in the UI. + :type color: AnnotationColor + + :param created_at: Creation time of the annotation in milliseconds since the Unix epoch. + :type created_at: int + + :param description: User-defined text attached to the annotation. + :type description: str + + :param end_time: End time of the annotation in milliseconds since the Unix epoch. Null for ``pointInTime`` annotations. + :type end_time: int, none_type + + :param modified_at: Last modification time of the annotation in milliseconds since the Unix epoch. + :type modified_at: int + + :param page_id: ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type page_id: str + + :param start_time: Start time of the annotation in milliseconds since the Unix epoch. + :type start_time: int + + :param type: Kind of annotation. ``pointInTime`` annotations mark a single moment in time, + while ``timeRegion`` annotations span a window of time and require an ``end_time``. + :type type: AnnotationKind + + :param widget_ids: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + :type widget_ids: [str], optional + """ + if widget_ids is not unset: + kwargs["widget_ids"] = widget_ids + super().__init__(kwargs) + + self_.author_id = author_id + self_.color = color + self_.created_at = created_at + self_.description = description + self_.end_time = end_time + self_.modified_at = modified_at + self_.page_id = page_id + self_.start_time = start_time + self_.type = type diff --git a/src/datadog_api_client/v2/model/annotation_color.py b/src/datadog_api_client/v2/model/annotation_color.py new file mode 100644 index 0000000000..fc004acf87 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_color.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AnnotationColor(ModelSimple): + """ + Color used to render the annotation in the UI. + + :param value: Must be one of ["gray", "blue", "purple", "green", "yellow", "red"]. + :type value: str + """ + + allowed_values = { + "gray", + "blue", + "purple", + "green", + "yellow", + "red", + } + GRAY: ClassVar["AnnotationColor"] + BLUE: ClassVar["AnnotationColor"] + PURPLE: ClassVar["AnnotationColor"] + GREEN: ClassVar["AnnotationColor"] + YELLOW: ClassVar["AnnotationColor"] + RED: ClassVar["AnnotationColor"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AnnotationColor.GRAY = AnnotationColor("gray") +AnnotationColor.BLUE = AnnotationColor("blue") +AnnotationColor.PURPLE = AnnotationColor("purple") +AnnotationColor.GREEN = AnnotationColor("green") +AnnotationColor.YELLOW = AnnotationColor("yellow") +AnnotationColor.RED = AnnotationColor("red") diff --git a/src/datadog_api_client/v2/model/annotation_create_attributes.py b/src/datadog_api_client/v2/model/annotation_create_attributes.py new file mode 100644 index 0000000000..581173d217 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_create_attributes.py @@ -0,0 +1,95 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + +class AnnotationCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + return { + "color": (AnnotationColor,), + "description": (str,), + "end_time": (int, none_type), + "page_id": (str,), + "start_time": (int,), + "type": (AnnotationKind,), + "widget_ids": ([str],), + } + + attribute_map = { + "color": "color", + "description": "description", + "end_time": "end_time", + "page_id": "page_id", + "start_time": "start_time", + "type": "type", + "widget_ids": "widget_ids", + } + + def __init__( + self_, + color: AnnotationColor, + description: str, + page_id: str, + start_time: int, + type: AnnotationKind, + end_time: Union[int, none_type, UnsetType] = unset, + widget_ids: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating an annotation. + + :param color: Color used to render the annotation in the UI. + :type color: AnnotationColor + + :param description: User-defined text attached to the annotation. + :type description: str + + :param end_time: End time of the annotation in milliseconds since the Unix epoch. Required for ``timeRegion`` annotations; omit or set to null for ``pointInTime`` annotations. + :type end_time: int, none_type, optional + + :param page_id: ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type page_id: str + + :param start_time: Start time of the annotation in milliseconds since the Unix epoch. + :type start_time: int + + :param type: Kind of annotation. ``pointInTime`` annotations mark a single moment in time, + while ``timeRegion`` annotations span a window of time and require an ``end_time``. + :type type: AnnotationKind + + :param widget_ids: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + :type widget_ids: [str], optional + """ + if end_time is not unset: + kwargs["end_time"] = end_time + if widget_ids is not unset: + kwargs["widget_ids"] = widget_ids + super().__init__(kwargs) + + self_.color = color + self_.description = description + self_.page_id = page_id + self_.start_time = start_time + self_.type = type diff --git a/src/datadog_api_client/v2/model/annotation_create_request.py b/src/datadog_api_client/v2/model/annotation_create_request.py new file mode 100644 index 0000000000..4de777ab76 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData + + +class AnnotationCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData + + return { + "data": (AnnotationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AnnotationRequestData, **kwargs): + """ + Request body for creating an annotation. + + :param data: Data for creating an annotation. + :type data: AnnotationRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/annotation_data.py b/src/datadog_api_client/v2/model/annotation_data.py new file mode 100644 index 0000000000..8f18307784 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_attributes import AnnotationAttributes + from datadog_api_client.v2.model.annotation_type import AnnotationType + + +class AnnotationData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_attributes import AnnotationAttributes + from datadog_api_client.v2.model.annotation_type import AnnotationType + + return { + "attributes": (AnnotationAttributes,), + "id": (UUID,), + "type": (AnnotationType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: AnnotationAttributes, id: UUID, type: AnnotationType, **kwargs): + """ + A single annotation resource. + + :param attributes: Attributes of an annotation returned in a response. + :type attributes: AnnotationAttributes + + :param id: Unique identifier of the annotation. + :type id: UUID + + :param type: Annotation resource type. + :type type: AnnotationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/annotation_in_page.py b/src/datadog_api_client/v2/model/annotation_in_page.py new file mode 100644 index 0000000000..0ba27e62fe --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_in_page.py @@ -0,0 +1,123 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + +class AnnotationInPage(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_color import AnnotationColor + from datadog_api_client.v2.model.annotation_kind import AnnotationKind + + return { + "author_id": (str,), + "color": (AnnotationColor,), + "created_at": (int,), + "description": (str,), + "end_time": (int, none_type), + "id": (UUID,), + "modified_at": (int,), + "page_id": (str,), + "start_time": (int,), + "type": (AnnotationKind,), + "widget_ids": ([str],), + } + + attribute_map = { + "author_id": "author_id", + "color": "color", + "created_at": "created_at", + "description": "description", + "end_time": "end_time", + "id": "id", + "modified_at": "modified_at", + "page_id": "page_id", + "start_time": "start_time", + "type": "type", + "widget_ids": "widget_ids", + } + + def __init__( + self_, + author_id: str, + color: AnnotationColor, + created_at: int, + description: str, + end_time: Union[int, none_type], + id: UUID, + modified_at: int, + page_id: str, + start_time: int, + type: AnnotationKind, + widget_ids: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + A flat annotation object as it appears within a page annotations response. + + :param author_id: Identifier of the user who created the annotation. + :type author_id: str + + :param color: Color used to render the annotation in the UI. + :type color: AnnotationColor + + :param created_at: Creation time of the annotation in milliseconds since the Unix epoch. + :type created_at: int + + :param description: User-defined text attached to the annotation. + :type description: str + + :param end_time: End time of the annotation in milliseconds since the Unix epoch. Null for ``pointInTime`` annotations. + :type end_time: int, none_type + + :param id: Unique identifier of the annotation. + :type id: UUID + + :param modified_at: Last modification time of the annotation in milliseconds since the Unix epoch. + :type modified_at: int + + :param page_id: ID of the page the annotation belongs to, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type page_id: str + + :param start_time: Start time of the annotation in milliseconds since the Unix epoch. + :type start_time: int + + :param type: Kind of annotation. ``pointInTime`` annotations mark a single moment in time, + while ``timeRegion`` annotations span a window of time and require an ``end_time``. + :type type: AnnotationKind + + :param widget_ids: IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + :type widget_ids: [str], optional + """ + if widget_ids is not unset: + kwargs["widget_ids"] = widget_ids + super().__init__(kwargs) + + self_.author_id = author_id + self_.color = color + self_.created_at = created_at + self_.description = description + self_.end_time = end_time + self_.id = id + self_.modified_at = modified_at + self_.page_id = page_id + self_.start_time = start_time + self_.type = type diff --git a/src/datadog_api_client/v2/model/annotation_kind.py b/src/datadog_api_client/v2/model/annotation_kind.py new file mode 100644 index 0000000000..2b6548b916 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_kind.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AnnotationKind(ModelSimple): + """ + Kind of annotation. `pointInTime` annotations mark a single moment in time, + while `timeRegion` annotations span a window of time and require an `end_time`. + + :param value: Must be one of ["pointInTime", "timeRegion"]. + :type value: str + """ + + allowed_values = { + "pointInTime", + "timeRegion", + } + POINT_IN_TIME: ClassVar["AnnotationKind"] + TIME_REGION: ClassVar["AnnotationKind"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AnnotationKind.POINT_IN_TIME = AnnotationKind("pointInTime") +AnnotationKind.TIME_REGION = AnnotationKind("timeRegion") diff --git a/src/datadog_api_client/v2/model/annotation_request_data.py b/src/datadog_api_client/v2/model/annotation_request_data.py new file mode 100644 index 0000000000..ef1c2d97f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_request_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_create_attributes import AnnotationCreateAttributes + from datadog_api_client.v2.model.annotation_type import AnnotationType + + +class AnnotationRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_create_attributes import AnnotationCreateAttributes + from datadog_api_client.v2.model.annotation_type import AnnotationType + + return { + "attributes": (AnnotationCreateAttributes,), + "type": (AnnotationType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: AnnotationCreateAttributes, type: AnnotationType, **kwargs): + """ + Data for creating an annotation. + + :param attributes: Attributes for creating or updating an annotation. + :type attributes: AnnotationCreateAttributes + + :param type: Annotation resource type. + :type type: AnnotationType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/annotation_response.py b/src/datadog_api_client/v2/model/annotation_response.py new file mode 100644 index 0000000000..90db33bbfc --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_data import AnnotationData + + +class AnnotationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_data import AnnotationData + + return { + "data": (AnnotationData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AnnotationData, **kwargs): + """ + Response containing a single annotation. + + :param data: A single annotation resource. + :type data: AnnotationData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/annotation_type.py b/src/datadog_api_client/v2/model/annotation_type.py new file mode 100644 index 0000000000..96c160c8dd --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AnnotationType(ModelSimple): + """ + Annotation resource type. + + :param value: If omitted defaults to "annotation". Must be one of ["annotation"]. + :type value: str + """ + + allowed_values = { + "annotation", + } + ANNOTATION: ClassVar["AnnotationType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AnnotationType.ANNOTATION = AnnotationType("annotation") diff --git a/src/datadog_api_client/v2/model/annotation_update_request.py b/src/datadog_api_client/v2/model/annotation_update_request.py new file mode 100644 index 0000000000..41d3306c33 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotation_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData + + +class AnnotationUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData + + return { + "data": (AnnotationRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AnnotationRequestData, **kwargs): + """ + Request body for updating an annotation. + + :param data: Data for creating an annotation. + :type data: AnnotationRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/annotations_in_page_map.py b/src/datadog_api_client/v2/model/annotations_in_page_map.py new file mode 100644 index 0000000000..1622ef87eb --- /dev/null +++ b/src/datadog_api_client/v2/model/annotations_in_page_map.py @@ -0,0 +1,29 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + pass + + +class AnnotationsInPageMap(ModelNormal): + @cached_property + def additional_properties_type(_): + from datadog_api_client.v2.model.annotation_in_page import AnnotationInPage + + return (AnnotationInPage,) + + def __init__(self_, **kwargs): + """ + Map of annotation UUID to annotation object, keyed by annotation ID. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/annotations_response.py b/src/datadog_api_client/v2/model/annotations_response.py new file mode 100644 index 0000000000..3e97d6b031 --- /dev/null +++ b/src/datadog_api_client/v2/model/annotations_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotation_data import AnnotationData + + +class AnnotationsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotation_data import AnnotationData + + return { + "data": ([AnnotationData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[AnnotationData], **kwargs): + """ + Response containing a list of annotations. + + :param data: List of annotation resources. + :type data: [AnnotationData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/o_auth_client_registration_error.py b/src/datadog_api_client/v2/model/o_auth_client_registration_error.py new file mode 100644 index 0000000000..541a138237 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_client_registration_error.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class OAuthClientRegistrationError(ModelNormal): + @cached_property + def openapi_types(_): + return { + "error": (str,), + "error_description": (str,), + } + + attribute_map = { + "error": "error", + "error_description": "error_description", + } + + def __init__(self_, error: str, error_description: str, **kwargs): + """ + Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. + + :param error: Single ASCII error code per RFC 7591, such as ``invalid_request`` or ``invalid_client_metadata``. + :type error: str + + :param error_description: Human-readable description of the error. + :type error_description: str + """ + super().__init__(kwargs) + + self_.error = error + self_.error_description = error_description diff --git a/src/datadog_api_client/v2/model/o_auth_client_registration_grant_type.py b/src/datadog_api_client/v2/model/o_auth_client_registration_grant_type.py new file mode 100644 index 0000000000..1a36fa31ef --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_client_registration_grant_type.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OAuthClientRegistrationGrantType(ModelSimple): + """ + OAuth 2.0 grant type that a registered client may use. + + :param value: Must be one of ["authorization_code", "refresh_token"]. + :type value: str + """ + + allowed_values = { + "authorization_code", + "refresh_token", + } + AUTHORIZATION_CODE: ClassVar["OAuthClientRegistrationGrantType"] + REFRESH_TOKEN: ClassVar["OAuthClientRegistrationGrantType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OAuthClientRegistrationGrantType.AUTHORIZATION_CODE = OAuthClientRegistrationGrantType("authorization_code") +OAuthClientRegistrationGrantType.REFRESH_TOKEN = OAuthClientRegistrationGrantType("refresh_token") diff --git a/src/datadog_api_client/v2/model/o_auth_client_registration_request.py b/src/datadog_api_client/v2/model/o_auth_client_registration_request.py new file mode 100644 index 0000000000..545537cd2d --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_client_registration_request.py @@ -0,0 +1,157 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType + from datadog_api_client.v2.model.o_auth_client_registration_response_type import OAuthClientRegistrationResponseType + + +class OAuthClientRegistrationRequest(ModelNormal): + validations = { + "client_name": { + "max_length": 1000, + }, + "client_uri": { + "max_length": 1000, + }, + "jwks_uri": { + "max_length": 1000, + }, + "logo_uri": { + "max_length": 1000, + }, + "policy_uri": { + "max_length": 1000, + }, + "scope": { + "max_length": 1000, + }, + "token_endpoint_auth_method": { + "max_length": 20, + }, + "tos_uri": { + "max_length": 1000, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType + from datadog_api_client.v2.model.o_auth_client_registration_response_type import ( + OAuthClientRegistrationResponseType, + ) + + return { + "client_name": (str,), + "client_uri": (str,), + "grant_types": ([OAuthClientRegistrationGrantType],), + "jwks_uri": (str,), + "logo_uri": (str,), + "policy_uri": (str,), + "redirect_uris": ([str],), + "response_types": ([OAuthClientRegistrationResponseType],), + "scope": (str,), + "token_endpoint_auth_method": (str,), + "tos_uri": (str,), + } + + attribute_map = { + "client_name": "client_name", + "client_uri": "client_uri", + "grant_types": "grant_types", + "jwks_uri": "jwks_uri", + "logo_uri": "logo_uri", + "policy_uri": "policy_uri", + "redirect_uris": "redirect_uris", + "response_types": "response_types", + "scope": "scope", + "token_endpoint_auth_method": "token_endpoint_auth_method", + "tos_uri": "tos_uri", + } + + def __init__( + self_, + client_name: str, + redirect_uris: List[str], + client_uri: Union[str, UnsetType] = unset, + grant_types: Union[List[OAuthClientRegistrationGrantType], UnsetType] = unset, + jwks_uri: Union[str, UnsetType] = unset, + logo_uri: Union[str, UnsetType] = unset, + policy_uri: Union[str, UnsetType] = unset, + response_types: Union[List[OAuthClientRegistrationResponseType], UnsetType] = unset, + scope: Union[str, UnsetType] = unset, + token_endpoint_auth_method: Union[str, UnsetType] = unset, + tos_uri: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Request payload for OAuth2 dynamic client registration as defined by RFC 7591. + + :param client_name: Human-readable name of the client. Control characters are rejected. + :type client_name: str + + :param client_uri: URL of the home page of the client. + :type client_uri: str, optional + + :param grant_types: OAuth 2.0 grant types the client may use. + Defaults to ``authorization_code`` and ``refresh_token`` when omitted. + :type grant_types: [OAuthClientRegistrationGrantType], optional + + :param jwks_uri: URL referencing the client's JSON Web Key Set. + :type jwks_uri: str, optional + + :param logo_uri: URL referencing a logo for the client. + :type logo_uri: str, optional + + :param policy_uri: URL pointing to the client's privacy policy. + :type policy_uri: str, optional + + :param redirect_uris: Array of redirection URI strings used by the client in redirect-based flows. + :type redirect_uris: [str] + + :param response_types: OAuth 2.0 response types the client may use. Only ``code`` is supported. + :type response_types: [OAuthClientRegistrationResponseType], optional + + :param scope: Space-separated list of scope values the client may request. + :type scope: str, optional + + :param token_endpoint_auth_method: Requested authentication method for the token endpoint. Only ``none`` is supported. + :type token_endpoint_auth_method: str, optional + + :param tos_uri: URL pointing to the client's terms of service. + :type tos_uri: str, optional + """ + if client_uri is not unset: + kwargs["client_uri"] = client_uri + if grant_types is not unset: + kwargs["grant_types"] = grant_types + if jwks_uri is not unset: + kwargs["jwks_uri"] = jwks_uri + if logo_uri is not unset: + kwargs["logo_uri"] = logo_uri + if policy_uri is not unset: + kwargs["policy_uri"] = policy_uri + if response_types is not unset: + kwargs["response_types"] = response_types + if scope is not unset: + kwargs["scope"] = scope + if token_endpoint_auth_method is not unset: + kwargs["token_endpoint_auth_method"] = token_endpoint_auth_method + if tos_uri is not unset: + kwargs["tos_uri"] = tos_uri + super().__init__(kwargs) + + self_.client_name = client_name + self_.redirect_uris = redirect_uris diff --git a/src/datadog_api_client/v2/model/o_auth_client_registration_response.py b/src/datadog_api_client/v2/model/o_auth_client_registration_response.py new file mode 100644 index 0000000000..4f8d54ed9c --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_client_registration_response.py @@ -0,0 +1,84 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType + from datadog_api_client.v2.model.o_auth_client_registration_response_type import OAuthClientRegistrationResponseType + + +class OAuthClientRegistrationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType + from datadog_api_client.v2.model.o_auth_client_registration_response_type import ( + OAuthClientRegistrationResponseType, + ) + + return { + "client_id": (UUID,), + "client_name": (str,), + "grant_types": ([OAuthClientRegistrationGrantType],), + "redirect_uris": ([str],), + "response_types": ([OAuthClientRegistrationResponseType],), + "token_endpoint_auth_method": (str,), + } + + attribute_map = { + "client_id": "client_id", + "client_name": "client_name", + "grant_types": "grant_types", + "redirect_uris": "redirect_uris", + "response_types": "response_types", + "token_endpoint_auth_method": "token_endpoint_auth_method", + } + + def __init__( + self_, + client_id: UUID, + client_name: str, + grant_types: List[OAuthClientRegistrationGrantType], + redirect_uris: List[str], + response_types: List[OAuthClientRegistrationResponseType], + token_endpoint_auth_method: str, + **kwargs, + ): + """ + Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. + + :param client_id: Unique identifier assigned to the registered client. + :type client_id: UUID + + :param client_name: Human-readable name of the client. + :type client_name: str + + :param grant_types: OAuth 2.0 grant types registered for the client. + :type grant_types: [OAuthClientRegistrationGrantType] + + :param redirect_uris: Redirection URIs registered for the client. + :type redirect_uris: [str] + + :param response_types: OAuth 2.0 response types registered for the client. + :type response_types: [OAuthClientRegistrationResponseType] + + :param token_endpoint_auth_method: Authentication method registered for the token endpoint. Always ``none``. + :type token_endpoint_auth_method: str + """ + super().__init__(kwargs) + + self_.client_id = client_id + self_.client_name = client_name + self_.grant_types = grant_types + self_.redirect_uris = redirect_uris + self_.response_types = response_types + self_.token_endpoint_auth_method = token_endpoint_auth_method diff --git a/src/datadog_api_client/v2/model/o_auth_client_registration_response_type.py b/src/datadog_api_client/v2/model/o_auth_client_registration_response_type.py new file mode 100644 index 0000000000..32b5f3c5a2 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_client_registration_response_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OAuthClientRegistrationResponseType(ModelSimple): + """ + OAuth 2.0 response type that a registered client may use. + + :param value: If omitted defaults to "code". Must be one of ["code"]. + :type value: str + """ + + allowed_values = { + "code", + } + CODE: ClassVar["OAuthClientRegistrationResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OAuthClientRegistrationResponseType.CODE = OAuthClientRegistrationResponseType("code") diff --git a/src/datadog_api_client/v2/model/o_auth_oidc_scope.py b/src/datadog_api_client/v2/model/o_auth_oidc_scope.py new file mode 100644 index 0000000000..6243ad84c2 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_oidc_scope.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OAuthOidcScope(ModelSimple): + """ + OIDC scope a client may be restricted to. + + :param value: Must be one of ["openid", "profile", "email", "offline_access"]. + :type value: str + """ + + allowed_values = { + "openid", + "profile", + "email", + "offline_access", + } + OPENID: ClassVar["OAuthOidcScope"] + PROFILE: ClassVar["OAuthOidcScope"] + EMAIL: ClassVar["OAuthOidcScope"] + OFFLINE_ACCESS: ClassVar["OAuthOidcScope"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OAuthOidcScope.OPENID = OAuthOidcScope("openid") +OAuthOidcScope.PROFILE = OAuthOidcScope("profile") +OAuthOidcScope.EMAIL = OAuthOidcScope("email") +OAuthOidcScope.OFFLINE_ACCESS = OAuthOidcScope("offline_access") diff --git a/src/datadog_api_client/v2/model/o_auth_scopes_restriction.py b/src/datadog_api_client/v2/model/o_auth_scopes_restriction.py new file mode 100644 index 0000000000..f4774fa527 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_scopes_restriction.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope + + +class OAuthScopesRestriction(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope + + return { + "oidc_scopes": ([OAuthOidcScope],), + "permission_scopes": ([str],), + } + + attribute_map = { + "oidc_scopes": "oidc_scopes", + "permission_scopes": "permission_scopes", + } + + def __init__(self_, oidc_scopes: List[OAuthOidcScope], permission_scopes: List[str], **kwargs): + """ + Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + + :param oidc_scopes: OIDC scopes the client is restricted to. + :type oidc_scopes: [OAuthOidcScope] + + :param permission_scopes: Datadog permission scopes the client is restricted to. + :type permission_scopes: [str] + """ + super().__init__(kwargs) + + self_.oidc_scopes = oidc_scopes + self_.permission_scopes = permission_scopes diff --git a/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response.py b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response.py new file mode 100644 index 0000000000..82c84c3439 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_scopes_restriction_response_data import OAuthScopesRestrictionResponseData + + +class OAuthScopesRestrictionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_scopes_restriction_response_data import ( + OAuthScopesRestrictionResponseData, + ) + + return { + "data": (OAuthScopesRestrictionResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OAuthScopesRestrictionResponseData, **kwargs): + """ + Response payload describing the scopes restriction of an OAuth2 client. + + :param data: Data object of an OAuth2 client scopes restriction response. + :type data: OAuthScopesRestrictionResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_attributes.py b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_attributes.py new file mode 100644 index 0000000000..4cd1104bf3 --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_attributes.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_scopes_restriction import OAuthScopesRestriction + + +class OAuthScopesRestrictionResponseAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_scopes_restriction import OAuthScopesRestriction + + return { + "required_permission_scopes": ([str], none_type), + "scopes_restriction": (OAuthScopesRestriction,), + } + + attribute_map = { + "required_permission_scopes": "required_permission_scopes", + "scopes_restriction": "scopes_restriction", + } + + def __init__( + self_, + required_permission_scopes: Union[List[str], none_type], + scopes_restriction: Union[OAuthScopesRestriction, none_type], + **kwargs, + ): + """ + Attributes of an OAuth2 client scopes restriction. + + :param required_permission_scopes: Permission scopes automatically required for this client (for example, mobile-app permission scopes). + Returns ``null`` when no scopes are required. + :type required_permission_scopes: [str], none_type + + :param scopes_restriction: Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + :type scopes_restriction: OAuthScopesRestriction, none_type + """ + super().__init__(kwargs) + + self_.required_permission_scopes = required_permission_scopes + self_.scopes_restriction = scopes_restriction diff --git a/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_data.py b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_data.py new file mode 100644 index 0000000000..c2987b439c --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_response_data.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_scopes_restriction_response_attributes import ( + OAuthScopesRestrictionResponseAttributes, + ) + from datadog_api_client.v2.model.o_auth_scopes_restriction_type import OAuthScopesRestrictionType + + +class OAuthScopesRestrictionResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_scopes_restriction_response_attributes import ( + OAuthScopesRestrictionResponseAttributes, + ) + from datadog_api_client.v2.model.o_auth_scopes_restriction_type import OAuthScopesRestrictionType + + return { + "attributes": (OAuthScopesRestrictionResponseAttributes,), + "id": (UUID,), + "type": (OAuthScopesRestrictionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: OAuthScopesRestrictionResponseAttributes, + id: UUID, + type: OAuthScopesRestrictionType, + **kwargs, + ): + """ + Data object of an OAuth2 client scopes restriction response. + + :param attributes: Attributes of an OAuth2 client scopes restriction. + :type attributes: OAuthScopesRestrictionResponseAttributes + + :param id: UUID of the OAuth2 client this restriction applies to. + :type id: UUID + + :param type: JSON:API resource type for an OAuth2 client scopes restriction. + :type type: OAuthScopesRestrictionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/o_auth_scopes_restriction_type.py b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_type.py new file mode 100644 index 0000000000..ff83d7845c --- /dev/null +++ b/src/datadog_api_client/v2/model/o_auth_scopes_restriction_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OAuthScopesRestrictionType(ModelSimple): + """ + JSON:API resource type for an OAuth2 client scopes restriction. + + :param value: If omitted defaults to "scopes_restriction". Must be one of ["scopes_restriction"]. + :type value: str + """ + + allowed_values = { + "scopes_restriction", + } + SCOPES_RESTRICTION: ClassVar["OAuthScopesRestrictionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OAuthScopesRestrictionType.SCOPES_RESTRICTION = OAuthScopesRestrictionType("scopes_restriction") diff --git a/src/datadog_api_client/v2/model/page_annotations_attributes.py b/src/datadog_api_client/v2/model/page_annotations_attributes.py new file mode 100644 index 0000000000..61b66b23ee --- /dev/null +++ b/src/datadog_api_client/v2/model/page_annotations_attributes.py @@ -0,0 +1,61 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.annotations_in_page_map import AnnotationsInPageMap + from datadog_api_client.v2.model.widget_annotations_map import WidgetAnnotationsMap + + +class PageAnnotationsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.annotations_in_page_map import AnnotationsInPageMap + from datadog_api_client.v2.model.widget_annotations_map import WidgetAnnotationsMap + + return { + "annotations": (AnnotationsInPageMap,), + "global_annotations": ([UUID],), + "widget_mapping": (WidgetAnnotationsMap,), + } + + attribute_map = { + "annotations": "annotations", + "global_annotations": "global_annotations", + "widget_mapping": "widget_mapping", + } + + def __init__( + self_, + annotations: AnnotationsInPageMap, + global_annotations: List[UUID], + widget_mapping: WidgetAnnotationsMap, + **kwargs, + ): + """ + Attributes of the annotations on a page. + + :param annotations: Map of annotation UUID to annotation object, keyed by annotation ID. + :type annotations: AnnotationsInPageMap + + :param global_annotations: List of annotation IDs that apply to the entire page rather than a specific widget. + :type global_annotations: [UUID] + + :param widget_mapping: Map from widget ID to the list of annotation IDs displayed on that widget. + :type widget_mapping: WidgetAnnotationsMap + """ + super().__init__(kwargs) + + self_.annotations = annotations + self_.global_annotations = global_annotations + self_.widget_mapping = widget_mapping diff --git a/src/datadog_api_client/v2/model/page_annotations_data.py b/src/datadog_api_client/v2/model/page_annotations_data.py new file mode 100644 index 0000000000..189307233f --- /dev/null +++ b/src/datadog_api_client/v2/model/page_annotations_data.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.page_annotations_attributes import PageAnnotationsAttributes + from datadog_api_client.v2.model.page_annotations_type import PageAnnotationsType + + +class PageAnnotationsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.page_annotations_attributes import PageAnnotationsAttributes + from datadog_api_client.v2.model.page_annotations_type import PageAnnotationsType + + return { + "attributes": (PageAnnotationsAttributes,), + "id": (str,), + "type": (PageAnnotationsType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: PageAnnotationsAttributes, id: str, type: PageAnnotationsType, **kwargs): + """ + Annotations grouped by widget for a single page. + + :param attributes: Attributes of the annotations on a page. + :type attributes: PageAnnotationsAttributes + + :param id: ID of the page, prefixed with the page type and joined by a colon + (for example, ``dashboard:abc-def-xyz`` or ``notebook:1234567890`` ). + :type id: str + + :param type: Page annotations resource type. + :type type: PageAnnotationsType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/page_annotations_response.py b/src/datadog_api_client/v2/model/page_annotations_response.py new file mode 100644 index 0000000000..0fad05d262 --- /dev/null +++ b/src/datadog_api_client/v2/model/page_annotations_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.page_annotations_data import PageAnnotationsData + + +class PageAnnotationsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.page_annotations_data import PageAnnotationsData + + return { + "data": (PageAnnotationsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: PageAnnotationsData, **kwargs): + """ + Response containing all annotations on a page, grouped by widget. + + :param data: Annotations grouped by widget for a single page. + :type data: PageAnnotationsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/page_annotations_type.py b/src/datadog_api_client/v2/model/page_annotations_type.py new file mode 100644 index 0000000000..4fe2636e90 --- /dev/null +++ b/src/datadog_api_client/v2/model/page_annotations_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class PageAnnotationsType(ModelSimple): + """ + Page annotations resource type. + + :param value: If omitted defaults to "page_annotations". Must be one of ["page_annotations"]. + :type value: str + """ + + allowed_values = { + "page_annotations", + } + PAGE_ANNOTATIONS: ClassVar["PageAnnotationsType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PageAnnotationsType.PAGE_ANNOTATIONS = PageAnnotationsType("page_annotations") diff --git a/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data.py b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data.py new file mode 100644 index 0000000000..2b85b7c964 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data_attributes import ( + UpsertOAuthScopesRestrictionDataAttributes, + ) + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_type import UpsertOAuthScopesRestrictionType + + +class UpsertOAuthScopesRestrictionData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data_attributes import ( + UpsertOAuthScopesRestrictionDataAttributes, + ) + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_type import UpsertOAuthScopesRestrictionType + + return { + "attributes": (UpsertOAuthScopesRestrictionDataAttributes,), + "type": (UpsertOAuthScopesRestrictionType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: UpsertOAuthScopesRestrictionType, + attributes: Union[UpsertOAuthScopesRestrictionDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Data object of an upsert OAuth2 scopes restriction request. + + :param attributes: Attributes of an upsert OAuth2 scopes restriction request. + :type attributes: UpsertOAuthScopesRestrictionDataAttributes, optional + + :param type: JSON:API resource type for an upsert OAuth2 client scopes restriction request. + :type type: UpsertOAuthScopesRestrictionType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data_attributes.py b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data_attributes.py new file mode 100644 index 0000000000..61c8166bf7 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_data_attributes.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope + + +class UpsertOAuthScopesRestrictionDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope + + return { + "oidc_scopes": ([OAuthOidcScope],), + "permission_scopes": ([str],), + } + + attribute_map = { + "oidc_scopes": "oidc_scopes", + "permission_scopes": "permission_scopes", + } + + def __init__( + self_, + oidc_scopes: Union[List[OAuthOidcScope], UnsetType] = unset, + permission_scopes: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes of an upsert OAuth2 scopes restriction request. + + :param oidc_scopes: OIDC scopes the client is allowed to request. + :type oidc_scopes: [OAuthOidcScope], optional + + :param permission_scopes: Datadog permission scopes the client is allowed to request. + Each value must be a valid permission name. + :type permission_scopes: [str], optional + """ + if oidc_scopes is not unset: + kwargs["oidc_scopes"] = oidc_scopes + if permission_scopes is not unset: + kwargs["permission_scopes"] = permission_scopes + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_request.py b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_request.py new file mode 100644 index 0000000000..6b2c3a492b --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data import UpsertOAuthScopesRestrictionData + + +class UpsertOAuthScopesRestrictionRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data import UpsertOAuthScopesRestrictionData + + return { + "data": (UpsertOAuthScopesRestrictionData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpsertOAuthScopesRestrictionData, **kwargs): + """ + Request payload for creating or updating the scopes restriction of an OAuth2 client. + + :param data: Data object of an upsert OAuth2 scopes restriction request. + :type data: UpsertOAuthScopesRestrictionData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_type.py b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_type.py new file mode 100644 index 0000000000..fe790e56b3 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_o_auth_scopes_restriction_type.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpsertOAuthScopesRestrictionType(ModelSimple): + """ + JSON:API resource type for an upsert OAuth2 client scopes restriction request. + + :param value: If omitted defaults to "upsert_scopes_restriction". Must be one of ["upsert_scopes_restriction"]. + :type value: str + """ + + allowed_values = { + "upsert_scopes_restriction", + } + UPSERT_SCOPES_RESTRICTION: ClassVar["UpsertOAuthScopesRestrictionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpsertOAuthScopesRestrictionType.UPSERT_SCOPES_RESTRICTION = UpsertOAuthScopesRestrictionType( + "upsert_scopes_restriction" +) diff --git a/src/datadog_api_client/v2/model/widget_annotations_map.py b/src/datadog_api_client/v2/model/widget_annotations_map.py new file mode 100644 index 0000000000..275d000c2d --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_annotations_map.py @@ -0,0 +1,28 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + pass + + +class WidgetAnnotationsMap(ModelNormal): + @cached_property + def additional_properties_type(_): + return ([UUID],) + + def __init__(self_, **kwargs): + """ + Map from widget ID to the list of annotation IDs displayed on that widget. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 43f1649b2a..fb04e7aa4c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -241,9 +241,22 @@ from datadog_api_client.v2.model.analysis_rule_response import AnalysisRuleResponse from datadog_api_client.v2.model.analysis_violation import AnalysisViolation from datadog_api_client.v2.model.annotation import Annotation +from datadog_api_client.v2.model.annotation_attributes import AnnotationAttributes +from datadog_api_client.v2.model.annotation_color import AnnotationColor +from datadog_api_client.v2.model.annotation_create_attributes import AnnotationCreateAttributes +from datadog_api_client.v2.model.annotation_create_request import AnnotationCreateRequest +from datadog_api_client.v2.model.annotation_data import AnnotationData from datadog_api_client.v2.model.annotation_display import AnnotationDisplay from datadog_api_client.v2.model.annotation_display_bounds import AnnotationDisplayBounds +from datadog_api_client.v2.model.annotation_in_page import AnnotationInPage +from datadog_api_client.v2.model.annotation_kind import AnnotationKind from datadog_api_client.v2.model.annotation_markdown_text_annotation import AnnotationMarkdownTextAnnotation +from datadog_api_client.v2.model.annotation_request_data import AnnotationRequestData +from datadog_api_client.v2.model.annotation_response import AnnotationResponse +from datadog_api_client.v2.model.annotation_type import AnnotationType +from datadog_api_client.v2.model.annotation_update_request import AnnotationUpdateRequest +from datadog_api_client.v2.model.annotations_in_page_map import AnnotationsInPageMap +from datadog_api_client.v2.model.annotations_response import AnnotationsResponse from datadog_api_client.v2.model.anonymize_user_error import AnonymizeUserError from datadog_api_client.v2.model.anonymize_users_request import AnonymizeUsersRequest from datadog_api_client.v2.model.anonymize_users_request_attributes import AnonymizeUsersRequestAttributes @@ -4399,6 +4412,19 @@ from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData from datadog_api_client.v2.model.nullable_user_relationship import NullableUserRelationship from datadog_api_client.v2.model.nullable_user_relationship_data import NullableUserRelationshipData +from datadog_api_client.v2.model.o_auth_client_registration_error import OAuthClientRegistrationError +from datadog_api_client.v2.model.o_auth_client_registration_grant_type import OAuthClientRegistrationGrantType +from datadog_api_client.v2.model.o_auth_client_registration_request import OAuthClientRegistrationRequest +from datadog_api_client.v2.model.o_auth_client_registration_response import OAuthClientRegistrationResponse +from datadog_api_client.v2.model.o_auth_client_registration_response_type import OAuthClientRegistrationResponseType +from datadog_api_client.v2.model.o_auth_oidc_scope import OAuthOidcScope +from datadog_api_client.v2.model.o_auth_scopes_restriction import OAuthScopesRestriction +from datadog_api_client.v2.model.o_auth_scopes_restriction_response import OAuthScopesRestrictionResponse +from datadog_api_client.v2.model.o_auth_scopes_restriction_response_attributes import ( + OAuthScopesRestrictionResponseAttributes, +) +from datadog_api_client.v2.model.o_auth_scopes_restriction_response_data import OAuthScopesRestrictionResponseData +from datadog_api_client.v2.model.o_auth_scopes_restriction_type import OAuthScopesRestrictionType from datadog_api_client.v2.model.oci_config import OCIConfig from datadog_api_client.v2.model.oci_config_attributes import OCIConfigAttributes from datadog_api_client.v2.model.oci_config_type import OCIConfigType @@ -5475,6 +5501,10 @@ from datadog_api_client.v2.model.output_schema_parameters import OutputSchemaParameters from datadog_api_client.v2.model.output_schema_parameters_type import OutputSchemaParametersType from datadog_api_client.v2.model.overwrite_allocations_request import OverwriteAllocationsRequest +from datadog_api_client.v2.model.page_annotations_attributes import PageAnnotationsAttributes +from datadog_api_client.v2.model.page_annotations_data import PageAnnotationsData +from datadog_api_client.v2.model.page_annotations_response import PageAnnotationsResponse +from datadog_api_client.v2.model.page_annotations_type import PageAnnotationsType from datadog_api_client.v2.model.page_urgency import PageUrgency from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta from datadog_api_client.v2.model.pagination import Pagination @@ -8234,6 +8264,12 @@ from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data import ( UpsertCloudInventorySyncConfigRequestData, ) +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data import UpsertOAuthScopesRestrictionData +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_data_attributes import ( + UpsertOAuthScopesRestrictionDataAttributes, +) +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_request import UpsertOAuthScopesRestrictionRequest +from datadog_api_client.v2.model.upsert_o_auth_scopes_restriction_type import UpsertOAuthScopesRestrictionType from datadog_api_client.v2.model.urgency import Urgency from datadog_api_client.v2.model.url_param import UrlParam from datadog_api_client.v2.model.url_param_update import UrlParamUpdate @@ -8375,6 +8411,7 @@ ) from datadog_api_client.v2.model.web_integration_accounts_response import WebIntegrationAccountsResponse from datadog_api_client.v2.model.weekday import Weekday +from datadog_api_client.v2.model.widget_annotations_map import WidgetAnnotationsMap from datadog_api_client.v2.model.widget_attributes import WidgetAttributes from datadog_api_client.v2.model.widget_data import WidgetData from datadog_api_client.v2.model.widget_definition import WidgetDefinition @@ -8636,9 +8673,22 @@ "AnalysisRuleResponse", "AnalysisViolation", "Annotation", + "AnnotationAttributes", + "AnnotationColor", + "AnnotationCreateAttributes", + "AnnotationCreateRequest", + "AnnotationData", "AnnotationDisplay", "AnnotationDisplayBounds", + "AnnotationInPage", + "AnnotationKind", "AnnotationMarkdownTextAnnotation", + "AnnotationRequestData", + "AnnotationResponse", + "AnnotationType", + "AnnotationUpdateRequest", + "AnnotationsInPageMap", + "AnnotationsResponse", "AnonymizeUserError", "AnonymizeUsersRequest", "AnonymizeUsersRequestAttributes", @@ -11776,6 +11826,17 @@ "NullableRelationshipToUserData", "NullableUserRelationship", "NullableUserRelationshipData", + "OAuthClientRegistrationError", + "OAuthClientRegistrationGrantType", + "OAuthClientRegistrationRequest", + "OAuthClientRegistrationResponse", + "OAuthClientRegistrationResponseType", + "OAuthOidcScope", + "OAuthScopesRestriction", + "OAuthScopesRestrictionResponse", + "OAuthScopesRestrictionResponseAttributes", + "OAuthScopesRestrictionResponseData", + "OAuthScopesRestrictionType", "OCIConfig", "OCIConfigAttributes", "OCIConfigType", @@ -12284,6 +12345,10 @@ "OutputSchemaParameters", "OutputSchemaParametersType", "OverwriteAllocationsRequest", + "PageAnnotationsAttributes", + "PageAnnotationsData", + "PageAnnotationsResponse", + "PageAnnotationsType", "PageUrgency", "PaginatedResponseMeta", "Pagination", @@ -14185,6 +14250,10 @@ "UpsertCloudInventorySyncConfigRequest", "UpsertCloudInventorySyncConfigRequestAttributes", "UpsertCloudInventorySyncConfigRequestData", + "UpsertOAuthScopesRestrictionData", + "UpsertOAuthScopesRestrictionDataAttributes", + "UpsertOAuthScopesRestrictionRequest", + "UpsertOAuthScopesRestrictionType", "Urgency", "UrlParam", "UrlParamUpdate", @@ -14312,6 +14381,7 @@ "WebIntegrationAccountUpdateRequestData", "WebIntegrationAccountsResponse", "Weekday", + "WidgetAnnotationsMap", "WidgetAttributes", "WidgetData", "WidgetDefinition", diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.frozen new file mode 100644 index 0000000000..ad351bfccc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:17.108Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.yaml new file mode 100644 index 0000000000..dfa43fae51 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_an_annotation_returns_ok_response.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"data":{"attributes":{"color":"blue","description":"Deployed v2.3.1 to + production.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime","widget_ids":["1234567890"]},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/annotation + response: + body: + string: '{"data":{"id":"2035c4df-a060-4466-93ec-9304a039bbed","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913697490,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913697490,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime","widget_ids":["1234567890"]}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/2035c4df-a060-4466-93ec-9304a039bbed + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.frozen new file mode 100644 index 0000000000..641e223f57 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:17.632Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.yaml new file mode 100644 index 0000000000..ff0b97e321 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_an_annotation_returns_no_content_response.yaml @@ -0,0 +1,50 @@ +interactions: +- request: + body: '{"data":{"attributes":{"color":"blue","description":"Deployed v2.3.1 to + production.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/annotation + response: + body: + string: '{"data":{"id":"152a2920-7598-4487-b185-b15931f92bc0","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913697691,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913697691,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/152a2920-7598-4487-b185-b15931f92bc0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/152a2920-7598-4487-b185-b15931f92bc0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.frozen new file mode 100644 index 0000000000..e9094546d9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:17.883Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.yaml new file mode 100644 index 0000000000..dced47495a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_annotations_for_a_page_returns_ok_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"color":"blue","description":"Deployed v2.3.1 to + production.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/annotation + response: + body: + string: '{"data":{"id":"31d6c3c7-0519-49e3-bcdf-9b1c00530aea","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913698075,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913698075,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/annotation/page/dashboard%3Aabc-def-xyz?start_time=1704067200000&end_time=1704153600000 + response: + body: + string: '{"data":{"id":"dashboard:abc-def-xyz","type":"page_annotations","attributes":{"annotations":{"31d6c3c7-0519-49e3-bcdf-9b1c00530aea":{"id":"31d6c3c7-0519-49e3-bcdf-9b1c00530aea","page_id":"dashboard:abc-def-xyz","description":"Deployed + v2.3.1 to production.","author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","type":"pointInTime","color":"blue","start_time":1704067200000,"end_time":null,"created_at":1779913698075,"modified_at":1779913698075}},"global_annotations":["31d6c3c7-0519-49e3-bcdf-9b1c00530aea"],"widget_mapping":{}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/31d6c3c7-0519-49e3-bcdf-9b1c00530aea + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.frozen new file mode 100644 index 0000000000..7403849653 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:18.281Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.yaml new file mode 100644 index 0000000000..b88ca5fa6f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_annotations_returns_ok_response.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: '{"data":{"attributes":{"color":"blue","description":"Deployed v2.3.1 to + production.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/annotation + response: + body: + string: '{"data":{"id":"9db3699d-4361-4062-b095-a4da3227afe6","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913698338,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913698338,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/annotation?page_id=dashboard%3Aabc-def-xyz&start_time=1704067200000&end_time=1704153600000 + response: + body: + string: '{"data":[{"id":"9db3699d-4361-4062-b095-a4da3227afe6","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913698338,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913698338,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/9db3699d-4361-4062-b095-a4da3227afe6 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.frozen new file mode 100644 index 0000000000..ae01b00dc1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:18.537Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.yaml new file mode 100644 index 0000000000..8573aa7901 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_an_annotation_returns_ok_response.yaml @@ -0,0 +1,55 @@ +interactions: +- request: + body: '{"data":{"attributes":{"color":"blue","description":"Deployed v2.3.1 to + production.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/annotation + response: + body: + string: '{"data":{"id":"9f257ed0-87fb-42f8-9aaf-89397e766d15","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"blue","created_at":1779913698596,"description":"Deployed + v2.3.1 to production.","end_time":null,"modified_at":1779913698596,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"color":"green","description":"Updated annotation.","page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"},"type":"annotation"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/annotation/9f257ed0-87fb-42f8-9aaf-89397e766d15 + response: + body: + string: '{"data":{"id":"9f257ed0-87fb-42f8-9aaf-89397e766d15","type":"annotation","attributes":{"author_id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","color":"green","created_at":1779913698596,"description":"Updated + annotation.","end_time":null,"modified_at":1779913698699,"page_id":"dashboard:abc-def-xyz","start_time":1704067200000,"type":"pointInTime"}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/9f257ed0-87fb-42f8-9aaf-89397e766d15 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/annotations.feature b/tests/v2/features/annotations.feature new file mode 100644 index 0000000000..0df59be814 --- /dev/null +++ b/tests/v2/features/annotations.feature @@ -0,0 +1,112 @@ +@endpoint(annotations) @endpoint(annotations-v2) +Feature: Annotations + Add annotations to dashboards and notebooks to mark events such as + deployments, incidents, or other notable moments in time. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Annotations" API + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: Create an annotation returns "Bad Request" response + Given operation "CreateAnnotation" enabled + And new "CreateAnnotation" request + And body with value {"data": {"attributes": {"color": "blue", "description": "Deployed v2.3.1 to production.", "end_time": 1704070800000, "page_id": "dashboard:abc-def-xyz", "start_time": 1704067200000, "type": "pointInTime", "widget_ids": ["1234567890"]}, "type": "annotation"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dataviz-advanced-analytics + Scenario: Create an annotation returns "OK" response + Given operation "CreateAnnotation" enabled + And new "CreateAnnotation" request + And body with value {"data": {"attributes": {"color": "blue", "description": "Deployed v2.3.1 to production.", "page_id": "dashboard:abc-def-xyz", "start_time": 1704067200000, "type": "pointInTime", "widget_ids": ["1234567890"]}, "type": "annotation"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: Delete an annotation returns "Bad Request" response + Given operation "DeleteAnnotation" enabled + And new "DeleteAnnotation" request + And request contains "annotation_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dataviz-advanced-analytics + Scenario: Delete an annotation returns "No Content" response + Given operation "DeleteAnnotation" enabled + And there is a valid "annotation" in the system + And new "DeleteAnnotation" request + And request contains "annotation_id" parameter from "annotation.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: Get annotations for a page returns "Bad Request" response + Given operation "GetPageAnnotations" enabled + And new "GetPageAnnotations" request + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "start_time" parameter from "REPLACE.ME" + And request contains "end_time" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dataviz-advanced-analytics + Scenario: Get annotations for a page returns "OK" response + Given there is a valid "annotation" in the system + And operation "GetPageAnnotations" enabled + And new "GetPageAnnotations" request + And request contains "page_id" parameter from "annotation.data.attributes.page_id" + And request contains "start_time" parameter with value 1704067200000 + And request contains "end_time" parameter with value 1704153600000 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: List annotations returns "Bad Request" response + Given operation "ListAnnotations" enabled + And new "ListAnnotations" request + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "start_time" parameter from "REPLACE.ME" + And request contains "end_time" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dataviz-advanced-analytics + Scenario: List annotations returns "OK" response + Given there is a valid "annotation" in the system + And operation "ListAnnotations" enabled + And new "ListAnnotations" request + And request contains "page_id" parameter from "annotation.data.attributes.page_id" + And request contains "start_time" parameter with value 1704067200000 + And request contains "end_time" parameter with value 1704153600000 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: Update an annotation returns "Bad Request" response + Given operation "UpdateAnnotation" enabled + And new "UpdateAnnotation" request + And request contains "annotation_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"color": "blue", "description": "Deployed v2.3.1 to production.", "end_time": 1704070800000, "page_id": "dashboard:abc-def-xyz", "start_time": 1704067200000, "type": "pointInTime", "widget_ids": ["1234567890"]}, "type": "annotation"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dataviz-advanced-analytics + Scenario: Update an annotation returns "Not Found" response + Given operation "UpdateAnnotation" enabled + And new "UpdateAnnotation" request + And request contains "annotation_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"color": "blue", "description": "Deployed v2.3.1 to production.", "end_time": 1704070800000, "page_id": "dashboard:abc-def-xyz", "start_time": 1704067200000, "type": "pointInTime", "widget_ids": ["1234567890"]}, "type": "annotation"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/dataviz-advanced-analytics + Scenario: Update an annotation returns "OK" response + Given there is a valid "annotation" in the system + And operation "UpdateAnnotation" enabled + And new "UpdateAnnotation" request + And request contains "annotation_id" parameter from "annotation.data.id" + And body with value {"data": {"attributes": {"color": "green", "description": "Updated annotation.", "page_id": "dashboard:abc-def-xyz", "start_time": 1704067200000, "type": "pointInTime"}, "type": "annotation"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index c3388d681e..7139a86ede 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -92,6 +92,18 @@ "tag": "Agentless Scanning", "operationId": "ListGcpScanOptions" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"color\": \"blue\",\n \"description\": \"Deployed v2.3.1 to production.\",\n \"page_id\": \"dashboard:abc-def-xyz\",\n \"start_time\": 1704067200000,\n \"type\": \"pointInTime\"\n },\n \"type\": \"annotation\"\n }\n}" + } + ], + "step": "there is a valid \"annotation\" in the system", + "key": "annotation", + "tag": "Annotations", + "operationId": "CreateAnnotation" + }, { "parameters": [ { diff --git a/tests/v2/features/oauth2_client_public.feature b/tests/v2/features/oauth2_client_public.feature new file mode 100644 index 0000000000..a5c7d195ef --- /dev/null +++ b/tests/v2/features/oauth2_client_public.feature @@ -0,0 +1,100 @@ +@endpoint(oauth2-client-public) @endpoint(oauth2-client-public-v2) +Feature: OAuth2 Client Public + Configure OAuth2 clients for Datadog. Supports RFC 7591 Dynamic Client + Registration and management of OAuth2 client scopes restrictions. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OAuth2ClientPublic" API + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "No Content" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Delete an OAuth2 client scopes restriction returns "Not Found" response + Given operation "DeleteScopesRestriction" enabled + And new "DeleteScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "Not Found" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get an OAuth2 client scopes restriction returns "OK" response + Given operation "GetScopesRestriction" enabled + And new "GetScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Register an OAuth2 client returns "Bad Request" response + Given operation "RegisterOAuthClient" enabled + And new "RegisterOAuthClient" request + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Register an OAuth2 client returns "Created" response + Given operation "RegisterOAuthClient" enabled + And new "RegisterOAuthClient" request + And body with value {"client_name": "Example MCP Client", "client_uri": "https://example.com", "grant_types": ["authorization_code", "refresh_token"], "jwks_uri": "https://example.com/.well-known/jwks.json", "logo_uri": "https://example.com/logo.png", "policy_uri": "https://example.com/privacy", "redirect_uris": ["https://example.com/oauth/callback"], "response_types": ["code"], "scope": "openid profile", "token_endpoint_auth_method": "none", "tos_uri": "https://example.com/tos"} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "Bad Request" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "Not Found" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Upsert an OAuth2 client scopes restriction returns "OK" response + Given operation "UpsertScopesRestriction" enabled + And new "UpsertScopesRestriction" request + And request contains "client_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"oidc_scopes": ["openid", "email"], "permission_scopes": ["dashboards_read", "metrics_read"]}, "type": "upsert_scopes_restriction"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 0878797ffd..6bfb4c3c14 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -411,6 +411,43 @@ "type": "safe" } }, + "ListAnnotations": { + "tag": "Annotations", + "undo": { + "type": "safe" + } + }, + "CreateAnnotation": { + "tag": "Annotations", + "undo": { + "operationId": "DeleteAnnotation", + "parameters": [ + { + "name": "annotation_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetPageAnnotations": { + "tag": "Annotations", + "undo": { + "type": "safe" + } + }, + "DeleteAnnotation": { + "tag": "Annotations", + "undo": { + "type": "idempotent" + } + }, + "UpdateAnnotation": { + "tag": "Annotations", + "undo": { + "type": "idempotent" + } + }, "AnonymizeUsers": { "tag": "Users", "undo": { @@ -4678,6 +4715,30 @@ "type": "safe" } }, + "DeleteScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, + "GetScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "safe" + } + }, + "UpsertScopesRestriction": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, + "RegisterOAuthClient": { + "tag": "OAuth2 Client Public", + "undo": { + "type": "idempotent" + } + }, "ListPipelines": { "tag": "Observability Pipelines", "undo": {