diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dede702aea71..c5a2287b3aee 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/cassettes/features/v2/annotations/Create-an-annotation-returns-OK-response.frozen b/cassettes/features/v2/annotations/Create-an-annotation-returns-OK-response.frozen new file mode 100644 index 000000000000..ad351bfccc2f --- /dev/null +++ b/cassettes/features/v2/annotations/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/cassettes/features/v2/annotations/Create-an-annotation-returns-OK-response.yml b/cassettes/features/v2/annotations/Create-an-annotation-returns-OK-response.yml new file mode 100644 index 000000000000..f5ea088c3f8b --- /dev/null +++ b/cassettes/features/v2/annotations/Create-an-annotation-returns-OK-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/2035c4df-a060-4466-93ec-9304a039bbed + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/annotations/Delete-an-annotation-returns-No-Content-response.frozen b/cassettes/features/v2/annotations/Delete-an-annotation-returns-No-Content-response.frozen new file mode 100644 index 000000000000..641e223f57e2 --- /dev/null +++ b/cassettes/features/v2/annotations/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/cassettes/features/v2/annotations/Delete-an-annotation-returns-No-Content-response.yml b/cassettes/features/v2/annotations/Delete-an-annotation-returns-No-Content-response.yml new file mode 100644 index 000000000000..07d1c02c8573 --- /dev/null +++ b/cassettes/features/v2/annotations/Delete-an-annotation-returns-No-Content-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/152a2920-7598-4487-b185-b15931f92bc0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/152a2920-7598-4487-b185-b15931f92bc0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/annotations/Get-annotations-for-a-page-returns-OK-response.frozen b/cassettes/features/v2/annotations/Get-annotations-for-a-page-returns-OK-response.frozen new file mode 100644 index 000000000000..e9094546d998 --- /dev/null +++ b/cassettes/features/v2/annotations/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/cassettes/features/v2/annotations/Get-annotations-for-a-page-returns-OK-response.yml b/cassettes/features/v2/annotations/Get-annotations-for-a-page-returns-OK-response.yml new file mode 100644 index 000000000000..3bd8cbcacea9 --- /dev/null +++ b/cassettes/features/v2/annotations/Get-annotations-for-a-page-returns-OK-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + 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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/31d6c3c7-0519-49e3-bcdf-9b1c00530aea + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/annotations/List-annotations-returns-OK-response.frozen b/cassettes/features/v2/annotations/List-annotations-returns-OK-response.frozen new file mode 100644 index 000000000000..7403849653f6 --- /dev/null +++ b/cassettes/features/v2/annotations/List-annotations-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-05-27T20:28:18.281Z \ No newline at end of file diff --git a/cassettes/features/v2/annotations/List-annotations-returns-OK-response.yml b/cassettes/features/v2/annotations/List-annotations-returns-OK-response.yml new file mode 100644 index 000000000000..d7d2f172ed69 --- /dev/null +++ b/cassettes/features/v2/annotations/List-annotations-returns-OK-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + 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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/9db3699d-4361-4062-b095-a4da3227afe6 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/annotations/Update-an-annotation-returns-OK-response.frozen b/cassettes/features/v2/annotations/Update-an-annotation-returns-OK-response.frozen new file mode 100644 index 000000000000..ae01b00dc1c0 --- /dev/null +++ b/cassettes/features/v2/annotations/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/cassettes/features/v2/annotations/Update-an-annotation-returns-OK-response.yml b/cassettes/features/v2/annotations/Update-an-annotation-returns-OK-response.yml new file mode 100644 index 000000000000..aecbda3654c2 --- /dev/null +++ b/cassettes/features/v2/annotations/Update-an-annotation-returns-OK-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 27 May 2026 20:28:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/annotation/9f257ed0-87fb-42f8-9aaf-89397e766d15 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/annotations/CreateAnnotation.rb b/examples/v2/annotations/CreateAnnotation.rb new file mode 100644 index 000000000000..2de569dd0688 --- /dev/null +++ b/examples/v2/annotations/CreateAnnotation.rb @@ -0,0 +1,24 @@ +# Create an annotation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_annotation".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AnnotationsAPI.new + +body = DatadogAPIClient::V2::AnnotationCreateRequest.new({ + data: DatadogAPIClient::V2::AnnotationRequestData.new({ + attributes: DatadogAPIClient::V2::AnnotationCreateAttributes.new({ + color: DatadogAPIClient::V2::AnnotationColor::BLUE, + description: "Deployed v2.3.1 to production.", + page_id: "dashboard:abc-def-xyz", + start_time: 1704067200000, + type: DatadogAPIClient::V2::AnnotationKind::POINT_IN_TIME, + widget_ids: [ + "1234567890", + ], + }), + type: DatadogAPIClient::V2::AnnotationType::ANNOTATION, + }), +}) +p api_instance.create_annotation(body) diff --git a/examples/v2/annotations/DeleteAnnotation.rb b/examples/v2/annotations/DeleteAnnotation.rb new file mode 100644 index 000000000000..89f8c4ca2efc --- /dev/null +++ b/examples/v2/annotations/DeleteAnnotation.rb @@ -0,0 +1,11 @@ +# Delete an annotation returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_annotation".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AnnotationsAPI.new + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ID = ENV["ANNOTATION_DATA_ID"] +api_instance.delete_annotation(ANNOTATION_DATA_ID) diff --git a/examples/v2/annotations/GetPageAnnotations.rb b/examples/v2/annotations/GetPageAnnotations.rb new file mode 100644 index 000000000000..217452fdafb9 --- /dev/null +++ b/examples/v2/annotations/GetPageAnnotations.rb @@ -0,0 +1,11 @@ +# Get annotations for a page returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_page_annotations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AnnotationsAPI.new + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = ENV["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"] +p api_instance.get_page_annotations(ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, 1704067200000, 1704153600000) diff --git a/examples/v2/annotations/ListAnnotations.rb b/examples/v2/annotations/ListAnnotations.rb new file mode 100644 index 000000000000..200afe5acc31 --- /dev/null +++ b/examples/v2/annotations/ListAnnotations.rb @@ -0,0 +1,11 @@ +# List annotations returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_annotations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AnnotationsAPI.new + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = ENV["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"] +p api_instance.list_annotations(ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, 1704067200000, 1704153600000) diff --git a/examples/v2/annotations/UpdateAnnotation.rb b/examples/v2/annotations/UpdateAnnotation.rb new file mode 100644 index 000000000000..ad1a6cdad079 --- /dev/null +++ b/examples/v2/annotations/UpdateAnnotation.rb @@ -0,0 +1,24 @@ +# Update an annotation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_annotation".to_sym] = true +end +api_instance = DatadogAPIClient::V2::AnnotationsAPI.new + +# there is a valid "annotation" in the system +ANNOTATION_DATA_ID = ENV["ANNOTATION_DATA_ID"] + +body = DatadogAPIClient::V2::AnnotationUpdateRequest.new({ + data: DatadogAPIClient::V2::AnnotationRequestData.new({ + attributes: DatadogAPIClient::V2::AnnotationCreateAttributes.new({ + color: DatadogAPIClient::V2::AnnotationColor::GREEN, + description: "Updated annotation.", + page_id: "dashboard:abc-def-xyz", + start_time: 1704067200000, + type: DatadogAPIClient::V2::AnnotationKind::POINT_IN_TIME, + }), + type: DatadogAPIClient::V2::AnnotationType::ANNOTATION, + }), +}) +p api_instance.update_annotation(ANNOTATION_DATA_ID, body) diff --git a/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb b/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb new file mode 100644 index 000000000000..19ef9539a0ad --- /dev/null +++ b/examples/v2/oauth2-client-public/DeleteScopesRestriction.rb @@ -0,0 +1,8 @@ +# Delete an OAuth2 client scopes restriction returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new +api_instance.delete_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001") diff --git a/examples/v2/oauth2-client-public/GetScopesRestriction.rb b/examples/v2/oauth2-client-public/GetScopesRestriction.rb new file mode 100644 index 000000000000..f959d785e912 --- /dev/null +++ b/examples/v2/oauth2-client-public/GetScopesRestriction.rb @@ -0,0 +1,8 @@ +# Get an OAuth2 client scopes restriction returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new +p api_instance.get_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001") diff --git a/examples/v2/oauth2-client-public/RegisterOAuthClient.rb b/examples/v2/oauth2-client-public/RegisterOAuthClient.rb new file mode 100644 index 000000000000..d438389b1248 --- /dev/null +++ b/examples/v2/oauth2-client-public/RegisterOAuthClient.rb @@ -0,0 +1,29 @@ +# Register an OAuth2 client returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.register_o_auth_client".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new + +body = DatadogAPIClient::V2::OAuthClientRegistrationRequest.new({ + client_name: "Example MCP Client", + client_uri: "https://example.com", + grant_types: [ + DatadogAPIClient::V2::OAuthClientRegistrationGrantType::AUTHORIZATION_CODE, + DatadogAPIClient::V2::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: [ + DatadogAPIClient::V2::OAuthClientRegistrationResponseType::CODE, + ], + scope: "openid profile", + token_endpoint_auth_method: "none", + tos_uri: "https://example.com/tos", +}) +p api_instance.register_o_auth_client(body) diff --git a/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb b/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb new file mode 100644 index 000000000000..157b32764346 --- /dev/null +++ b/examples/v2/oauth2-client-public/UpsertScopesRestriction.rb @@ -0,0 +1,24 @@ +# Upsert an OAuth2 client scopes restriction returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_scopes_restriction".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OAuth2ClientPublicAPI.new + +body = DatadogAPIClient::V2::UpsertOAuthScopesRestrictionRequest.new({ + data: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionData.new({ + attributes: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionDataAttributes.new({ + oidc_scopes: [ + DatadogAPIClient::V2::OAuthOidcScope::OPENID, + DatadogAPIClient::V2::OAuthOidcScope::EMAIL, + ], + permission_scopes: [ + "dashboards_read", + "metrics_read", + ], + }), + type: DatadogAPIClient::V2::UpsertOAuthScopesRestrictionType::UPSERT_SCOPES_RESTRICTION, + }), +}) +p api_instance.upsert_scopes_restriction("fafa8e1c-36a5-11f0-a83d-da7ad0900001", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 95054c25f8dd..09f895f4d7a3 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1205,6 +1205,27 @@ "v2.GetAwsOnDemandTask" => { "task_id" => "String", }, + "v2.ListAnnotations" => { + "page_id" => "String", + "start_time" => "Integer", + "end_time" => "Integer", + "widget_id" => "String", + }, + "v2.CreateAnnotation" => { + "body" => "AnnotationCreateRequest", + }, + "v2.GetPageAnnotations" => { + "page_id" => "String", + "start_time" => "Integer", + "end_time" => "Integer", + }, + "v2.DeleteAnnotation" => { + "annotation_id" => "UUID", + }, + "v2.UpdateAnnotation" => { + "annotation_id" => "UUID", + "body" => "AnnotationUpdateRequest", + }, "v2.AnonymizeUsers" => { "body" => "AnonymizeUsersRequest", }, @@ -3881,6 +3902,19 @@ "tags" => "String", "limit" => "Integer", }, + "v2.DeleteScopesRestriction" => { + "client_uuid" => "UUID", + }, + "v2.GetScopesRestriction" => { + "client_uuid" => "UUID", + }, + "v2.UpsertScopesRestriction" => { + "client_uuid" => "UUID", + "body" => "UpsertOAuthScopesRestrictionRequest", + }, + "v2.RegisterOAuthClient" => { + "body" => "OAuthClientRegistrationRequest", + }, "v2.ListPipelines" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/annotations.feature b/features/v2/annotations.feature new file mode 100644 index 000000000000..0df59be81439 --- /dev/null +++ b/features/v2/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/features/v2/given.json b/features/v2/given.json index c3388d681ec8..7139a86ede5c 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/oauth2_client_public.feature b/features/v2/oauth2_client_public.feature new file mode 100644 index 000000000000..a5c7d195efa7 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 0878797ffd8c..6bfb4c3c14b7 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index bf08354c8d54..ab3dadfaebfd 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -251,6 +251,11 @@ def initialize "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, @@ -520,6 +525,10 @@ def initialize "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index abbf1654651c..a46a81844606 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1229,9 +1229,21 @@ def overrides "v2.analysis_rule_response" => "AnalysisRuleResponse", "v2.analysis_violation" => "AnalysisViolation", "v2.annotation" => "Annotation", + "v2.annotation_attributes" => "AnnotationAttributes", + "v2.annotation_color" => "AnnotationColor", + "v2.annotation_create_attributes" => "AnnotationCreateAttributes", + "v2.annotation_create_request" => "AnnotationCreateRequest", + "v2.annotation_data" => "AnnotationData", "v2.annotation_display" => "AnnotationDisplay", "v2.annotation_display_bounds" => "AnnotationDisplayBounds", + "v2.annotation_in_page" => "AnnotationInPage", + "v2.annotation_kind" => "AnnotationKind", "v2.annotation_markdown_text_annotation" => "AnnotationMarkdownTextAnnotation", + "v2.annotation_request_data" => "AnnotationRequestData", + "v2.annotation_response" => "AnnotationResponse", + "v2.annotations_response" => "AnnotationsResponse", + "v2.annotation_type" => "AnnotationType", + "v2.annotation_update_request" => "AnnotationUpdateRequest", "v2.anonymize_user_error" => "AnonymizeUserError", "v2.anonymize_users_request" => "AnonymizeUsersRequest", "v2.anonymize_users_request_attributes" => "AnonymizeUsersRequestAttributes", @@ -4442,6 +4454,17 @@ def overrides "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData", "v2.nullable_user_relationship" => "NullableUserRelationship", "v2.nullable_user_relationship_data" => "NullableUserRelationshipData", + "v2.o_auth_client_registration_error" => "OAuthClientRegistrationError", + "v2.o_auth_client_registration_grant_type" => "OAuthClientRegistrationGrantType", + "v2.o_auth_client_registration_request" => "OAuthClientRegistrationRequest", + "v2.o_auth_client_registration_response" => "OAuthClientRegistrationResponse", + "v2.o_auth_client_registration_response_type" => "OAuthClientRegistrationResponseType", + "v2.o_auth_oidc_scope" => "OAuthOidcScope", + "v2.o_auth_scopes_restriction" => "OAuthScopesRestriction", + "v2.o_auth_scopes_restriction_response" => "OAuthScopesRestrictionResponse", + "v2.o_auth_scopes_restriction_response_attributes" => "OAuthScopesRestrictionResponseAttributes", + "v2.o_auth_scopes_restriction_response_data" => "OAuthScopesRestrictionResponseData", + "v2.o_auth_scopes_restriction_type" => "OAuthScopesRestrictionType", "v2.observability_pipeline" => "ObservabilityPipeline", "v2.observability_pipeline_add_env_vars_processor" => "ObservabilityPipelineAddEnvVarsProcessor", "v2.observability_pipeline_add_env_vars_processor_type" => "ObservabilityPipelineAddEnvVarsProcessorType", @@ -4950,6 +4973,10 @@ def overrides "v2.output_schema_parameters" => "OutputSchemaParameters", "v2.output_schema_parameters_type" => "OutputSchemaParametersType", "v2.overwrite_allocations_request" => "OverwriteAllocationsRequest", + "v2.page_annotations_attributes" => "PageAnnotationsAttributes", + "v2.page_annotations_data" => "PageAnnotationsData", + "v2.page_annotations_response" => "PageAnnotationsResponse", + "v2.page_annotations_type" => "PageAnnotationsType", "v2.page_urgency" => "PageUrgency", "v2.paginated_response_meta" => "PaginatedResponseMeta", "v2.pagination" => "Pagination", @@ -6832,6 +6859,10 @@ def overrides "v2.upsert_cloud_inventory_sync_config_request" => "UpsertCloudInventorySyncConfigRequest", "v2.upsert_cloud_inventory_sync_config_request_attributes" => "UpsertCloudInventorySyncConfigRequestAttributes", "v2.upsert_cloud_inventory_sync_config_request_data" => "UpsertCloudInventorySyncConfigRequestData", + "v2.upsert_o_auth_scopes_restriction_data" => "UpsertOAuthScopesRestrictionData", + "v2.upsert_o_auth_scopes_restriction_data_attributes" => "UpsertOAuthScopesRestrictionDataAttributes", + "v2.upsert_o_auth_scopes_restriction_request" => "UpsertOAuthScopesRestrictionRequest", + "v2.upsert_o_auth_scopes_restriction_type" => "UpsertOAuthScopesRestrictionType", "v2.urgency" => "Urgency", "v2.url_param" => "UrlParam", "v2.url_param_update" => "UrlParamUpdate", @@ -7034,6 +7065,7 @@ def overrides "v2.action_connection_api" => "ActionConnectionAPI", "v2.actions_datastores_api" => "ActionsDatastoresAPI", "v2.agentless_scanning_api" => "AgentlessScanningAPI", + "v2.annotations_api" => "AnnotationsAPI", "v2.api_management_api" => "APIManagementAPI", "v2.apm_api" => "APMAPI", "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", @@ -7098,6 +7130,7 @@ def overrides "v2.model_lab_api_api" => "ModelLabAPIAPI", "v2.monitors_api" => "MonitorsAPI", "v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI", + "v2.o_auth2_client_public_api" => "OAuth2ClientPublicAPI", "v2.observability_pipelines_api" => "ObservabilityPipelinesAPI", "v2.oci_integration_api" => "OCIIntegrationAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/annotations_api.rb b/lib/datadog_api_client/v2/api/annotations_api.rb new file mode 100644 index 000000000000..8a27084bb11d --- /dev/null +++ b/lib/datadog_api_client/v2/api/annotations_api.rb @@ -0,0 +1,424 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class AnnotationsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create an annotation. + # + # @see #create_annotation_with_http_info + def create_annotation(body, opts = {}) + data, _status_code, _headers = create_annotation_with_http_info(body, opts) + data + end + + # 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 [AnnotationCreateRequest] Annotation to create. + # @param opts [Hash] the optional parameters + # @return [Array<(AnnotationResponse, Integer, Hash)>] AnnotationResponse data, response status code and response headers + def create_annotation_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_annotation".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_annotation") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_annotation")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnnotationsAPI.create_annotation ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AnnotationsAPI.create_annotation" + end + # resource path + local_var_path = '/api/v2/annotation' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AnnotationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_annotation, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnnotationsAPI#create_annotation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an annotation. + # + # @see #delete_annotation_with_http_info + def delete_annotation(annotation_id, opts = {}) + delete_annotation_with_http_info(annotation_id, opts) + nil + end + + # Delete an annotation. + # + # Deletes an existing annotation by ID. + # Returns `204 No Content` if the annotation does not exist (idempotent). + # + # @param annotation_id [UUID] The ID of the annotation. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_annotation_with_http_info(annotation_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_annotation".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_annotation") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_annotation")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnnotationsAPI.delete_annotation ...' + end + # verify the required parameter 'annotation_id' is set + if @api_client.config.client_side_validation && annotation_id.nil? + fail ArgumentError, "Missing the required parameter 'annotation_id' when calling AnnotationsAPI.delete_annotation" + end + # resource path + local_var_path = '/api/v2/annotation/{annotation_id}'.sub('{annotation_id}', CGI.escape(annotation_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_annotation, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnnotationsAPI#delete_annotation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get annotations for a page. + # + # @see #get_page_annotations_with_http_info + def get_page_annotations(page_id, start_time, end_time, opts = {}) + data, _status_code, _headers = get_page_annotations_with_http_info(page_id, start_time, end_time, opts) + data + end + + # 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 [String] The ID of the page, prefixed with the page type and joined by a colon (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + # @param start_time [Integer] Start of the time window in milliseconds since the Unix epoch. + # @param end_time [Integer] End of the time window in milliseconds since the Unix epoch. + # @param opts [Hash] the optional parameters + # @return [Array<(PageAnnotationsResponse, Integer, Hash)>] PageAnnotationsResponse data, response status code and response headers + def get_page_annotations_with_http_info(page_id, start_time, end_time, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_page_annotations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_page_annotations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_page_annotations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnnotationsAPI.get_page_annotations ...' + end + # verify the required parameter 'page_id' is set + if @api_client.config.client_side_validation && page_id.nil? + fail ArgumentError, "Missing the required parameter 'page_id' when calling AnnotationsAPI.get_page_annotations" + end + # verify the required parameter 'start_time' is set + if @api_client.config.client_side_validation && start_time.nil? + fail ArgumentError, "Missing the required parameter 'start_time' when calling AnnotationsAPI.get_page_annotations" + end + # verify the required parameter 'end_time' is set + if @api_client.config.client_side_validation && end_time.nil? + fail ArgumentError, "Missing the required parameter 'end_time' when calling AnnotationsAPI.get_page_annotations" + end + # resource path + local_var_path = '/api/v2/annotation/page/{page_id}'.sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'start_time'] = start_time + query_params[:'end_time'] = end_time + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'PageAnnotationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_page_annotations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnnotationsAPI#get_page_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List annotations. + # + # @see #list_annotations_with_http_info + def list_annotations(page_id, start_time, end_time, opts = {}) + data, _status_code, _headers = list_annotations_with_http_info(page_id, start_time, end_time, opts) + data + end + + # List annotations. + # + # Returns a flat list of annotations matching the given page, time window, and optional widget filter. + # + # @param page_id [String] 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`). + # @param start_time [Integer] Start of the time window in milliseconds since the Unix epoch. + # @param end_time [Integer] End of the time window in milliseconds since the Unix epoch. + # @param opts [Hash] the optional parameters + # @option opts [String] :widget_id Optional widget ID to restrict results to annotations on a specific widget. + # @return [Array<(AnnotationsResponse, Integer, Hash)>] AnnotationsResponse data, response status code and response headers + def list_annotations_with_http_info(page_id, start_time, end_time, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_annotations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_annotations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_annotations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnnotationsAPI.list_annotations ...' + end + # verify the required parameter 'page_id' is set + if @api_client.config.client_side_validation && page_id.nil? + fail ArgumentError, "Missing the required parameter 'page_id' when calling AnnotationsAPI.list_annotations" + end + # verify the required parameter 'start_time' is set + if @api_client.config.client_side_validation && start_time.nil? + fail ArgumentError, "Missing the required parameter 'start_time' when calling AnnotationsAPI.list_annotations" + end + # verify the required parameter 'end_time' is set + if @api_client.config.client_side_validation && end_time.nil? + fail ArgumentError, "Missing the required parameter 'end_time' when calling AnnotationsAPI.list_annotations" + end + # resource path + local_var_path = '/api/v2/annotation' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page_id'] = page_id + query_params[:'start_time'] = start_time + query_params[:'end_time'] = end_time + query_params[:'widget_id'] = opts[:'widget_id'] if !opts[:'widget_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AnnotationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_annotations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnnotationsAPI#list_annotations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an annotation. + # + # @see #update_annotation_with_http_info + def update_annotation(annotation_id, body, opts = {}) + data, _status_code, _headers = update_annotation_with_http_info(annotation_id, body, opts) + data + end + + # 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 [UUID] The ID of the annotation. + # @param body [AnnotationUpdateRequest] Updated annotation payload. + # @param opts [Hash] the optional parameters + # @return [Array<(AnnotationResponse, Integer, Hash)>] AnnotationResponse data, response status code and response headers + def update_annotation_with_http_info(annotation_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_annotation".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_annotation") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_annotation")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnnotationsAPI.update_annotation ...' + end + # verify the required parameter 'annotation_id' is set + if @api_client.config.client_side_validation && annotation_id.nil? + fail ArgumentError, "Missing the required parameter 'annotation_id' when calling AnnotationsAPI.update_annotation" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AnnotationsAPI.update_annotation" + end + # resource path + local_var_path = '/api/v2/annotation/{annotation_id}'.sub('{annotation_id}', CGI.escape(annotation_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AnnotationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_annotation, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnnotationsAPI#update_annotation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb b/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb new file mode 100644 index 000000000000..1264fef6c088 --- /dev/null +++ b/lib/datadog_api_client/v2/api/o_auth2_client_public_api.rb @@ -0,0 +1,319 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class OAuth2ClientPublicAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete an OAuth2 client scopes restriction. + # + # @see #delete_scopes_restriction_with_http_info + def delete_scopes_restriction(client_uuid, opts = {}) + delete_scopes_restriction_with_http_info(client_uuid, opts) + nil + end + + # Delete an OAuth2 client scopes restriction. + # + # Delete the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_scopes_restriction_with_http_info(client_uuid, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.delete_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.delete_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#delete_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an OAuth2 client scopes restriction. + # + # @see #get_scopes_restriction_with_http_info + def get_scopes_restriction(client_uuid, opts = {}) + data, _status_code, _headers = get_scopes_restriction_with_http_info(client_uuid, opts) + data + end + + # Get an OAuth2 client scopes restriction. + # + # Get the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthScopesRestrictionResponse, Integer, Hash)>] OAuthScopesRestrictionResponse data, response status code and response headers + def get_scopes_restriction_with_http_info(client_uuid, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.get_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.get_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OAuthScopesRestrictionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#get_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Register an OAuth2 client. + # + # @see #register_o_auth_client_with_http_info + def register_o_auth_client(body, opts = {}) + data, _status_code, _headers = register_o_auth_client_with_http_info(body, opts) + data + end + + # Register an OAuth2 client. + # + # Register an OAuth2 client using the Dynamic Client Registration protocol defined in RFC 7591. + # + # @param body [OAuthClientRegistrationRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthClientRegistrationResponse, Integer, Hash)>] OAuthClientRegistrationResponse data, response status code and response headers + def register_o_auth_client_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.register_o_auth_client".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.register_o_auth_client") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.register_o_auth_client")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.register_o_auth_client ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OAuth2ClientPublicAPI.register_o_auth_client" + end + # resource path + local_var_path = '/api/v2/oauth2/register' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OAuthClientRegistrationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :register_o_auth_client, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#register_o_auth_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Upsert an OAuth2 client scopes restriction. + # + # @see #upsert_scopes_restriction_with_http_info + def upsert_scopes_restriction(client_uuid, body, opts = {}) + data, _status_code, _headers = upsert_scopes_restriction_with_http_info(client_uuid, body, opts) + data + end + + # Upsert an OAuth2 client scopes restriction. + # + # Create or update the scopes restriction configured for the OAuth2 client. + # + # @param client_uuid [UUID] UUID of the OAuth2 client. + # @param body [UpsertOAuthScopesRestrictionRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OAuthScopesRestrictionResponse, Integer, Hash)>] OAuthScopesRestrictionResponse data, response status code and response headers + def upsert_scopes_restriction_with_http_info(client_uuid, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_scopes_restriction".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_scopes_restriction") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_scopes_restriction")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OAuth2ClientPublicAPI.upsert_scopes_restriction ...' + end + # verify the required parameter 'client_uuid' is set + if @api_client.config.client_side_validation && client_uuid.nil? + fail ArgumentError, "Missing the required parameter 'client_uuid' when calling OAuth2ClientPublicAPI.upsert_scopes_restriction" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OAuth2ClientPublicAPI.upsert_scopes_restriction" + end + # resource path + local_var_path = '/api/v2/oauth2/clients/{client_uuid}/scopes_restriction'.sub('{client_uuid}', CGI.escape(client_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OAuthScopesRestrictionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_scopes_restriction, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OAuth2ClientPublicAPI#upsert_scopes_restriction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_attributes.rb b/lib/datadog_api_client/v2/models/annotation_attributes.rb new file mode 100644 index 000000000000..97a521a3b3a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_attributes.rb @@ -0,0 +1,302 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an annotation returned in a response. + class AnnotationAttributes + include BaseGenericModel + + # Identifier of the user who created the annotation. + attr_reader :author_id + + # Color used to render the annotation in the UI. + attr_reader :color + + # Creation time of the annotation in milliseconds since the Unix epoch. + attr_reader :created_at + + # User-defined text attached to the annotation. + attr_reader :description + + # End time of the annotation in milliseconds since the Unix epoch. Null for `pointInTime` annotations. + attr_accessor :end_time + + # Last modification time of the annotation in milliseconds since the Unix epoch. + attr_reader :modified_at + + # 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`). + attr_reader :page_id + + # Start time of the annotation in milliseconds since the Unix epoch. + attr_reader :start_time + + # Kind of annotation. `pointInTime` annotations mark a single moment in time, + # while `timeRegion` annotations span a window of time and require an `end_time`. + attr_reader :type + + # IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + attr_accessor :widget_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author_id' => :'String', + :'color' => :'AnnotationColor', + :'created_at' => :'Integer', + :'description' => :'String', + :'end_time' => :'Integer', + :'modified_at' => :'Integer', + :'page_id' => :'String', + :'start_time' => :'Integer', + :'type' => :'AnnotationKind', + :'widget_ids' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'end_time', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author_id') + self.author_id = attributes[:'author_id'] + end + + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'page_id') + self.page_id = attributes[:'page_id'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'widget_ids') + if (value = attributes[:'widget_ids']).is_a?(Array) + self.widget_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @author_id.nil? + return false if @color.nil? + return false if @created_at.nil? + return false if @description.nil? + return false if @modified_at.nil? + return false if @page_id.nil? + return false if @start_time.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param author_id [Object] Object to be assigned + # @!visibility private + def author_id=(author_id) + if author_id.nil? + fail ArgumentError, 'invalid value for "author_id", author_id cannot be nil.' + end + @author_id = author_id + end + + # Custom attribute writer method with validation + # @param color [Object] Object to be assigned + # @!visibility private + def color=(color) + if color.nil? + fail ArgumentError, 'invalid value for "color", color cannot be nil.' + end + @color = color + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param page_id [Object] Object to be assigned + # @!visibility private + def page_id=(page_id) + if page_id.nil? + fail ArgumentError, 'invalid value for "page_id", page_id cannot be nil.' + end + @page_id = page_id + end + + # Custom attribute writer method with validation + # @param start_time [Object] Object to be assigned + # @!visibility private + def start_time=(start_time) + if start_time.nil? + fail ArgumentError, 'invalid value for "start_time", start_time cannot be nil.' + end + @start_time = start_time + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author_id == o.author_id && + color == o.color && + created_at == o.created_at && + description == o.description && + end_time == o.end_time && + modified_at == o.modified_at && + page_id == o.page_id && + start_time == o.start_time && + type == o.type && + widget_ids == o.widget_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author_id, color, created_at, description, end_time, modified_at, page_id, start_time, type, widget_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_color.rb b/lib/datadog_api_client/v2/models/annotation_color.rb new file mode 100644 index 000000000000..1a0c7c4a7308 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_color.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Color used to render the annotation in the UI. + class AnnotationColor + include BaseEnumModel + + GRAY = "gray".freeze + BLUE = "blue".freeze + PURPLE = "purple".freeze + GREEN = "green".freeze + YELLOW = "yellow".freeze + RED = "red".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_create_attributes.rb b/lib/datadog_api_client/v2/models/annotation_create_attributes.rb new file mode 100644 index 000000000000..5c45802819b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_create_attributes.rb @@ -0,0 +1,239 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating or updating an annotation. + class AnnotationCreateAttributes + include BaseGenericModel + + # Color used to render the annotation in the UI. + attr_reader :color + + # User-defined text attached to the annotation. + attr_reader :description + + # End time of the annotation in milliseconds since the Unix epoch. Required for `timeRegion` annotations; omit or set to null for `pointInTime` annotations. + attr_accessor :end_time + + # 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`). + attr_reader :page_id + + # Start time of the annotation in milliseconds since the Unix epoch. + attr_reader :start_time + + # Kind of annotation. `pointInTime` annotations mark a single moment in time, + # while `timeRegion` annotations span a window of time and require an `end_time`. + attr_reader :type + + # IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + attr_accessor :widget_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'color' => :'color', + :'description' => :'description', + :'end_time' => :'end_time', + :'page_id' => :'page_id', + :'start_time' => :'start_time', + :'type' => :'type', + :'widget_ids' => :'widget_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'color' => :'AnnotationColor', + :'description' => :'String', + :'end_time' => :'Integer', + :'page_id' => :'String', + :'start_time' => :'Integer', + :'type' => :'AnnotationKind', + :'widget_ids' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'end_time', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'page_id') + self.page_id = attributes[:'page_id'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'widget_ids') + if (value = attributes[:'widget_ids']).is_a?(Array) + self.widget_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @color.nil? + return false if @description.nil? + return false if @page_id.nil? + return false if @start_time.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param color [Object] Object to be assigned + # @!visibility private + def color=(color) + if color.nil? + fail ArgumentError, 'invalid value for "color", color cannot be nil.' + end + @color = color + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param page_id [Object] Object to be assigned + # @!visibility private + def page_id=(page_id) + if page_id.nil? + fail ArgumentError, 'invalid value for "page_id", page_id cannot be nil.' + end + @page_id = page_id + end + + # Custom attribute writer method with validation + # @param start_time [Object] Object to be assigned + # @!visibility private + def start_time=(start_time) + if start_time.nil? + fail ArgumentError, 'invalid value for "start_time", start_time cannot be nil.' + end + @start_time = start_time + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + color == o.color && + description == o.description && + end_time == o.end_time && + page_id == o.page_id && + start_time == o.start_time && + type == o.type && + widget_ids == o.widget_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [color, description, end_time, page_id, start_time, type, widget_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_create_request.rb b/lib/datadog_api_client/v2/models/annotation_create_request.rb new file mode 100644 index 000000000000..46ad66747fae --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating an annotation. + class AnnotationCreateRequest + include BaseGenericModel + + # Data for creating an annotation. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnnotationRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_data.rb b/lib/datadog_api_client/v2/models/annotation_data.rb new file mode 100644 index 000000000000..e6521ca2bc0f --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single annotation resource. + class AnnotationData + include BaseGenericModel + + # Attributes of an annotation returned in a response. + attr_reader :attributes + + # Unique identifier of the annotation. + attr_reader :id + + # Annotation resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnnotationAttributes', + :'id' => :'UUID', + :'type' => :'AnnotationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_in_page.rb b/lib/datadog_api_client/v2/models/annotation_in_page.rb new file mode 100644 index 000000000000..458e719dbb43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_in_page.rb @@ -0,0 +1,323 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A flat annotation object as it appears within a page annotations response. + class AnnotationInPage + include BaseGenericModel + + # Identifier of the user who created the annotation. + attr_reader :author_id + + # Color used to render the annotation in the UI. + attr_reader :color + + # Creation time of the annotation in milliseconds since the Unix epoch. + attr_reader :created_at + + # User-defined text attached to the annotation. + attr_reader :description + + # End time of the annotation in milliseconds since the Unix epoch. Null for `pointInTime` annotations. + attr_accessor :end_time + + # Unique identifier of the annotation. + attr_reader :id + + # Last modification time of the annotation in milliseconds since the Unix epoch. + attr_reader :modified_at + + # 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`). + attr_reader :page_id + + # Start time of the annotation in milliseconds since the Unix epoch. + attr_reader :start_time + + # Kind of annotation. `pointInTime` annotations mark a single moment in time, + # while `timeRegion` annotations span a window of time and require an `end_time`. + attr_reader :type + + # IDs of widgets the annotation is associated with. When empty or omitted, the annotation applies to the whole page. + attr_accessor :widget_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author_id' => :'String', + :'color' => :'AnnotationColor', + :'created_at' => :'Integer', + :'description' => :'String', + :'end_time' => :'Integer', + :'id' => :'UUID', + :'modified_at' => :'Integer', + :'page_id' => :'String', + :'start_time' => :'Integer', + :'type' => :'AnnotationKind', + :'widget_ids' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'end_time', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationInPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author_id') + self.author_id = attributes[:'author_id'] + end + + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'end_time') + self.end_time = attributes[:'end_time'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'page_id') + self.page_id = attributes[:'page_id'] + end + + if attributes.key?(:'start_time') + self.start_time = attributes[:'start_time'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'widget_ids') + if (value = attributes[:'widget_ids']).is_a?(Array) + self.widget_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @author_id.nil? + return false if @color.nil? + return false if @created_at.nil? + return false if @description.nil? + return false if @id.nil? + return false if @modified_at.nil? + return false if @page_id.nil? + return false if @start_time.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param author_id [Object] Object to be assigned + # @!visibility private + def author_id=(author_id) + if author_id.nil? + fail ArgumentError, 'invalid value for "author_id", author_id cannot be nil.' + end + @author_id = author_id + end + + # Custom attribute writer method with validation + # @param color [Object] Object to be assigned + # @!visibility private + def color=(color) + if color.nil? + fail ArgumentError, 'invalid value for "color", color cannot be nil.' + end + @color = color + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param page_id [Object] Object to be assigned + # @!visibility private + def page_id=(page_id) + if page_id.nil? + fail ArgumentError, 'invalid value for "page_id", page_id cannot be nil.' + end + @page_id = page_id + end + + # Custom attribute writer method with validation + # @param start_time [Object] Object to be assigned + # @!visibility private + def start_time=(start_time) + if start_time.nil? + fail ArgumentError, 'invalid value for "start_time", start_time cannot be nil.' + end + @start_time = start_time + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author_id == o.author_id && + color == o.color && + created_at == o.created_at && + description == o.description && + end_time == o.end_time && + id == o.id && + modified_at == o.modified_at && + page_id == o.page_id && + start_time == o.start_time && + type == o.type && + widget_ids == o.widget_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author_id, color, created_at, description, end_time, id, modified_at, page_id, start_time, type, widget_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_kind.rb b/lib/datadog_api_client/v2/models/annotation_kind.rb new file mode 100644 index 000000000000..3c42fbd8a1dc --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_kind.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Kind of annotation. `pointInTime` annotations mark a single moment in time, + # while `timeRegion` annotations span a window of time and require an `end_time`. + class AnnotationKind + include BaseEnumModel + + POINT_IN_TIME = "pointInTime".freeze + TIME_REGION = "timeRegion".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_request_data.rb b/lib/datadog_api_client/v2/models/annotation_request_data.rb new file mode 100644 index 000000000000..fdd201efd1df --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating an annotation. + class AnnotationRequestData + include BaseGenericModel + + # Attributes for creating or updating an annotation. + attr_reader :attributes + + # Annotation resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnnotationCreateAttributes', + :'type' => :'AnnotationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_response.rb b/lib/datadog_api_client/v2/models/annotation_response.rb new file mode 100644 index 000000000000..d7720471d1a0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single annotation. + class AnnotationResponse + include BaseGenericModel + + # A single annotation resource. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnnotationData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_type.rb b/lib/datadog_api_client/v2/models/annotation_type.rb new file mode 100644 index 000000000000..a648e261a876 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Annotation resource type. + class AnnotationType + include BaseEnumModel + + ANNOTATION = "annotation".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/annotation_update_request.rb b/lib/datadog_api_client/v2/models/annotation_update_request.rb new file mode 100644 index 000000000000..e0b64a60bb43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotation_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating an annotation. + class AnnotationUpdateRequest + include BaseGenericModel + + # Data for creating an annotation. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnnotationRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/annotations_response.rb b/lib/datadog_api_client/v2/models/annotations_response.rb new file mode 100644 index 000000000000..1626535f371e --- /dev/null +++ b/lib/datadog_api_client/v2/models/annotations_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of annotations. + class AnnotationsResponse + include BaseGenericModel + + # List of annotation resources. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnnotationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb new file mode 100644 index 000000000000..a6dd8badabd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_error.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Error payload returned by OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationError + include BaseGenericModel + + # Single ASCII error code per RFC 7591, such as `invalid_request` or `invalid_client_metadata`. + attr_reader :error + + # Human-readable description of the error. + attr_reader :error_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'error_description' => :'error_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'error_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationError` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'error_description') + self.error_description = attributes[:'error_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @error.nil? + return false if @error_description.nil? + true + end + + # Custom attribute writer method with validation + # @param error [Object] Object to be assigned + # @!visibility private + def error=(error) + if error.nil? + fail ArgumentError, 'invalid value for "error", error cannot be nil.' + end + @error = error + end + + # Custom attribute writer method with validation + # @param error_description [Object] Object to be assigned + # @!visibility private + def error_description=(error_description) + if error_description.nil? + fail ArgumentError, 'invalid value for "error_description", error_description cannot be nil.' + end + @error_description = error_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + error_description == o.error_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, error_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb new file mode 100644 index 000000000000..a8c9a5d5121d --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_grant_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth 2.0 grant type that a registered client may use. + class OAuthClientRegistrationGrantType + include BaseEnumModel + + AUTHORIZATION_CODE = "authorization_code".freeze + REFRESH_TOKEN = "refresh_token".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb new file mode 100644 index 000000000000..f6db36a48b4b --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_request.rb @@ -0,0 +1,322 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationRequest + include BaseGenericModel + + # Human-readable name of the client. Control characters are rejected. + attr_reader :client_name + + # URL of the home page of the client. + attr_reader :client_uri + + # OAuth 2.0 grant types the client may use. + # Defaults to `authorization_code` and `refresh_token` when omitted. + attr_accessor :grant_types + + # URL referencing the client's JSON Web Key Set. + attr_reader :jwks_uri + + # URL referencing a logo for the client. + attr_reader :logo_uri + + # URL pointing to the client's privacy policy. + attr_reader :policy_uri + + # Array of redirection URI strings used by the client in redirect-based flows. + attr_reader :redirect_uris + + # OAuth 2.0 response types the client may use. Only `code` is supported. + attr_accessor :response_types + + # Space-separated list of scope values the client may request. + attr_reader :scope + + # Requested authentication method for the token endpoint. Only `none` is supported. + attr_reader :token_endpoint_auth_method + + # URL pointing to the client's terms of service. + attr_reader :tos_uri + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'client_name' => :'String', + :'client_uri' => :'String', + :'grant_types' => :'Array', + :'jwks_uri' => :'String', + :'logo_uri' => :'String', + :'policy_uri' => :'String', + :'redirect_uris' => :'Array', + :'response_types' => :'Array', + :'scope' => :'String', + :'token_endpoint_auth_method' => :'String', + :'tos_uri' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'client_name') + self.client_name = attributes[:'client_name'] + end + + if attributes.key?(:'client_uri') + self.client_uri = attributes[:'client_uri'] + end + + if attributes.key?(:'grant_types') + if (value = attributes[:'grant_types']).is_a?(Array) + self.grant_types = value + end + end + + if attributes.key?(:'jwks_uri') + self.jwks_uri = attributes[:'jwks_uri'] + end + + if attributes.key?(:'logo_uri') + self.logo_uri = attributes[:'logo_uri'] + end + + if attributes.key?(:'policy_uri') + self.policy_uri = attributes[:'policy_uri'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'response_types') + if (value = attributes[:'response_types']).is_a?(Array) + self.response_types = value + end + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + end + + if attributes.key?(:'token_endpoint_auth_method') + self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method'] + end + + if attributes.key?(:'tos_uri') + self.tos_uri = attributes[:'tos_uri'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @client_name.nil? + return false if @client_name.to_s.length > 1000 + return false if !@client_uri.nil? && @client_uri.to_s.length > 1000 + return false if !@jwks_uri.nil? && @jwks_uri.to_s.length > 1000 + return false if !@logo_uri.nil? && @logo_uri.to_s.length > 1000 + return false if !@policy_uri.nil? && @policy_uri.to_s.length > 1000 + return false if @redirect_uris.nil? + return false if !@scope.nil? && @scope.to_s.length > 1000 + return false if !@token_endpoint_auth_method.nil? && @token_endpoint_auth_method.to_s.length > 20 + return false if !@tos_uri.nil? && @tos_uri.to_s.length > 1000 + true + end + + # Custom attribute writer method with validation + # @param client_name [Object] Object to be assigned + # @!visibility private + def client_name=(client_name) + if client_name.nil? + fail ArgumentError, 'invalid value for "client_name", client_name cannot be nil.' + end + if client_name.to_s.length > 1000 + fail ArgumentError, 'invalid value for "client_name", the character length must be smaller than or equal to 1000.' + end + @client_name = client_name + end + + # Custom attribute writer method with validation + # @param client_uri [Object] Object to be assigned + # @!visibility private + def client_uri=(client_uri) + if !client_uri.nil? && client_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "client_uri", the character length must be smaller than or equal to 1000.' + end + @client_uri = client_uri + end + + # Custom attribute writer method with validation + # @param jwks_uri [Object] Object to be assigned + # @!visibility private + def jwks_uri=(jwks_uri) + if !jwks_uri.nil? && jwks_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "jwks_uri", the character length must be smaller than or equal to 1000.' + end + @jwks_uri = jwks_uri + end + + # Custom attribute writer method with validation + # @param logo_uri [Object] Object to be assigned + # @!visibility private + def logo_uri=(logo_uri) + if !logo_uri.nil? && logo_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "logo_uri", the character length must be smaller than or equal to 1000.' + end + @logo_uri = logo_uri + end + + # Custom attribute writer method with validation + # @param policy_uri [Object] Object to be assigned + # @!visibility private + def policy_uri=(policy_uri) + if !policy_uri.nil? && policy_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "policy_uri", the character length must be smaller than or equal to 1000.' + end + @policy_uri = policy_uri + end + + # Custom attribute writer method with validation + # @param redirect_uris [Object] Object to be assigned + # @!visibility private + def redirect_uris=(redirect_uris) + if redirect_uris.nil? + fail ArgumentError, 'invalid value for "redirect_uris", redirect_uris cannot be nil.' + end + @redirect_uris = redirect_uris + end + + # Custom attribute writer method with validation + # @param scope [Object] Object to be assigned + # @!visibility private + def scope=(scope) + if !scope.nil? && scope.to_s.length > 1000 + fail ArgumentError, 'invalid value for "scope", the character length must be smaller than or equal to 1000.' + end + @scope = scope + end + + # Custom attribute writer method with validation + # @param token_endpoint_auth_method [Object] Object to be assigned + # @!visibility private + def token_endpoint_auth_method=(token_endpoint_auth_method) + if !token_endpoint_auth_method.nil? && token_endpoint_auth_method.to_s.length > 20 + fail ArgumentError, 'invalid value for "token_endpoint_auth_method", the character length must be smaller than or equal to 20.' + end + @token_endpoint_auth_method = token_endpoint_auth_method + end + + # Custom attribute writer method with validation + # @param tos_uri [Object] Object to be assigned + # @!visibility private + def tos_uri=(tos_uri) + if !tos_uri.nil? && tos_uri.to_s.length > 1000 + fail ArgumentError, 'invalid value for "tos_uri", the character length must be smaller than or equal to 1000.' + end + @tos_uri = tos_uri + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client_name == o.client_name && + client_uri == o.client_uri && + grant_types == o.grant_types && + jwks_uri == o.jwks_uri && + logo_uri == o.logo_uri && + policy_uri == o.policy_uri && + redirect_uris == o.redirect_uris && + response_types == o.response_types && + scope == o.scope && + token_endpoint_auth_method == o.token_endpoint_auth_method && + tos_uri == o.tos_uri && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [client_name, client_uri, grant_types, jwks_uri, logo_uri, policy_uri, redirect_uris, response_types, scope, token_endpoint_auth_method, tos_uri, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb new file mode 100644 index 000000000000..4b9ef409a5ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_response.rb @@ -0,0 +1,234 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response payload for a successful OAuth2 dynamic client registration as defined by RFC 7591. + class OAuthClientRegistrationResponse + include BaseGenericModel + + # Unique identifier assigned to the registered client. + attr_reader :client_id + + # Human-readable name of the client. + attr_reader :client_name + + # OAuth 2.0 grant types registered for the client. + attr_reader :grant_types + + # Redirection URIs registered for the client. + attr_reader :redirect_uris + + # OAuth 2.0 response types registered for the client. + attr_reader :response_types + + # Authentication method registered for the token endpoint. Always `none`. + attr_reader :token_endpoint_auth_method + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'client_id' => :'UUID', + :'client_name' => :'String', + :'grant_types' => :'Array', + :'redirect_uris' => :'Array', + :'response_types' => :'Array', + :'token_endpoint_auth_method' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthClientRegistrationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'client_name') + self.client_name = attributes[:'client_name'] + end + + if attributes.key?(:'grant_types') + if (value = attributes[:'grant_types']).is_a?(Array) + self.grant_types = value + end + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'response_types') + if (value = attributes[:'response_types']).is_a?(Array) + self.response_types = value + end + end + + if attributes.key?(:'token_endpoint_auth_method') + self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @client_id.nil? + return false if @client_name.nil? + return false if @grant_types.nil? + return false if @redirect_uris.nil? + return false if @response_types.nil? + return false if @token_endpoint_auth_method.nil? + true + end + + # Custom attribute writer method with validation + # @param client_id [Object] Object to be assigned + # @!visibility private + def client_id=(client_id) + if client_id.nil? + fail ArgumentError, 'invalid value for "client_id", client_id cannot be nil.' + end + @client_id = client_id + end + + # Custom attribute writer method with validation + # @param client_name [Object] Object to be assigned + # @!visibility private + def client_name=(client_name) + if client_name.nil? + fail ArgumentError, 'invalid value for "client_name", client_name cannot be nil.' + end + @client_name = client_name + end + + # Custom attribute writer method with validation + # @param grant_types [Object] Object to be assigned + # @!visibility private + def grant_types=(grant_types) + if grant_types.nil? + fail ArgumentError, 'invalid value for "grant_types", grant_types cannot be nil.' + end + @grant_types = grant_types + end + + # Custom attribute writer method with validation + # @param redirect_uris [Object] Object to be assigned + # @!visibility private + def redirect_uris=(redirect_uris) + if redirect_uris.nil? + fail ArgumentError, 'invalid value for "redirect_uris", redirect_uris cannot be nil.' + end + @redirect_uris = redirect_uris + end + + # Custom attribute writer method with validation + # @param response_types [Object] Object to be assigned + # @!visibility private + def response_types=(response_types) + if response_types.nil? + fail ArgumentError, 'invalid value for "response_types", response_types cannot be nil.' + end + @response_types = response_types + end + + # Custom attribute writer method with validation + # @param token_endpoint_auth_method [Object] Object to be assigned + # @!visibility private + def token_endpoint_auth_method=(token_endpoint_auth_method) + if token_endpoint_auth_method.nil? + fail ArgumentError, 'invalid value for "token_endpoint_auth_method", token_endpoint_auth_method cannot be nil.' + end + @token_endpoint_auth_method = token_endpoint_auth_method + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client_id == o.client_id && + client_name == o.client_name && + grant_types == o.grant_types && + redirect_uris == o.redirect_uris && + response_types == o.response_types && + token_endpoint_auth_method == o.token_endpoint_auth_method && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [client_id, client_name, grant_types, redirect_uris, response_types, token_endpoint_auth_method, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb b/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb new file mode 100644 index 000000000000..6c2847371ff5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_client_registration_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OAuth 2.0 response type that a registered client may use. + class OAuthClientRegistrationResponseType + include BaseEnumModel + + CODE = "code".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb b/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb new file mode 100644 index 000000000000..4ae4befd6609 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_oidc_scope.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # OIDC scope a client may be restricted to. + class OAuthOidcScope + include BaseEnumModel + + OPENID = "openid".freeze + PROFILE = "profile".freeze + EMAIL = "email".freeze + OFFLINE_ACCESS = "offline_access".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb new file mode 100644 index 000000000000..5aaf1633b8ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + class OAuthScopesRestriction + include BaseGenericModel + + # OIDC scopes the client is restricted to. + attr_reader :oidc_scopes + + # Datadog permission scopes the client is restricted to. + attr_reader :permission_scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oidc_scopes' => :'oidc_scopes', + :'permission_scopes' => :'permission_scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oidc_scopes' => :'Array', + :'permission_scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestriction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oidc_scopes') + if (value = attributes[:'oidc_scopes']).is_a?(Array) + self.oidc_scopes = value + end + end + + if attributes.key?(:'permission_scopes') + if (value = attributes[:'permission_scopes']).is_a?(Array) + self.permission_scopes = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @oidc_scopes.nil? + return false if @permission_scopes.nil? + true + end + + # Custom attribute writer method with validation + # @param oidc_scopes [Object] Object to be assigned + # @!visibility private + def oidc_scopes=(oidc_scopes) + if oidc_scopes.nil? + fail ArgumentError, 'invalid value for "oidc_scopes", oidc_scopes cannot be nil.' + end + @oidc_scopes = oidc_scopes + end + + # Custom attribute writer method with validation + # @param permission_scopes [Object] Object to be assigned + # @!visibility private + def permission_scopes=(permission_scopes) + if permission_scopes.nil? + fail ArgumentError, 'invalid value for "permission_scopes", permission_scopes cannot be nil.' + end + @permission_scopes = permission_scopes + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc_scopes == o.oidc_scopes && + permission_scopes == o.permission_scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oidc_scopes, permission_scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb new file mode 100644 index 000000000000..8808631362e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response payload describing the scopes restriction of an OAuth2 client. + class OAuthScopesRestrictionResponse + include BaseGenericModel + + # Data object of an OAuth2 client scopes restriction response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OAuthScopesRestrictionResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb new file mode 100644 index 000000000000..18c8bdbb4aef --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_attributes.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an OAuth2 client scopes restriction. + class OAuthScopesRestrictionResponseAttributes + include BaseGenericModel + + # Permission scopes automatically required for this client (for example, mobile-app permission scopes). + # Returns `null` when no scopes are required. + attr_accessor :required_permission_scopes + + # Allowlist of OIDC and permission scopes enforced for the OAuth2 client. + attr_accessor :scopes_restriction + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'required_permission_scopes' => :'required_permission_scopes', + :'scopes_restriction' => :'scopes_restriction' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'required_permission_scopes' => :'Array', + :'scopes_restriction' => :'OAuthScopesRestriction' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'required_permission_scopes', + :'scopes_restriction', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'required_permission_scopes') + if (value = attributes[:'required_permission_scopes']).is_a?(Array) + self.required_permission_scopes = value + end + end + + if attributes.key?(:'scopes_restriction') + self.scopes_restriction = attributes[:'scopes_restriction'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + required_permission_scopes == o.required_permission_scopes && + scopes_restriction == o.scopes_restriction && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [required_permission_scopes, scopes_restriction, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb new file mode 100644 index 000000000000..70c8124753c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object of an OAuth2 client scopes restriction response. + class OAuthScopesRestrictionResponseData + include BaseGenericModel + + # Attributes of an OAuth2 client scopes restriction. + attr_reader :attributes + + # UUID of the OAuth2 client this restriction applies to. + attr_reader :id + + # JSON:API resource type for an OAuth2 client scopes restriction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OAuthScopesRestrictionResponseAttributes', + :'id' => :'UUID', + :'type' => :'OAuthScopesRestrictionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OAuthScopesRestrictionResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb new file mode 100644 index 000000000000..0d0808aee801 --- /dev/null +++ b/lib/datadog_api_client/v2/models/o_auth_scopes_restriction_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for an OAuth2 client scopes restriction. + class OAuthScopesRestrictionType + include BaseEnumModel + + SCOPES_RESTRICTION = "scopes_restriction".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/page_annotations_attributes.rb b/lib/datadog_api_client/v2/models/page_annotations_attributes.rb new file mode 100644 index 000000000000..061c61170bd6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/page_annotations_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the annotations on a page. + class PageAnnotationsAttributes + include BaseGenericModel + + # Map of annotation UUID to annotation object, keyed by annotation ID. + attr_reader :annotations + + # List of annotation IDs that apply to the entire page rather than a specific widget. + attr_reader :global_annotations + + # Map from widget ID to the list of annotation IDs displayed on that widget. + attr_reader :widget_mapping + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotations' => :'annotations', + :'global_annotations' => :'global_annotations', + :'widget_mapping' => :'widget_mapping' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotations' => :'Hash', + :'global_annotations' => :'Array', + :'widget_mapping' => :'Hash>' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PageAnnotationsAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotations') + self.annotations = attributes[:'annotations'] + end + + if attributes.key?(:'global_annotations') + if (value = attributes[:'global_annotations']).is_a?(Array) + self.global_annotations = value + end + end + + if attributes.key?(:'widget_mapping') + self.widget_mapping = attributes[:'widget_mapping'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @annotations.nil? + return false if @global_annotations.nil? + return false if @widget_mapping.nil? + true + end + + # Custom attribute writer method with validation + # @param annotations [Object] Object to be assigned + # @!visibility private + def annotations=(annotations) + if annotations.nil? + fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' + end + @annotations = annotations + end + + # Custom attribute writer method with validation + # @param global_annotations [Object] Object to be assigned + # @!visibility private + def global_annotations=(global_annotations) + if global_annotations.nil? + fail ArgumentError, 'invalid value for "global_annotations", global_annotations cannot be nil.' + end + @global_annotations = global_annotations + end + + # Custom attribute writer method with validation + # @param widget_mapping [Object] Object to be assigned + # @!visibility private + def widget_mapping=(widget_mapping) + if widget_mapping.nil? + fail ArgumentError, 'invalid value for "widget_mapping", widget_mapping cannot be nil.' + end + @widget_mapping = widget_mapping + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotations == o.annotations && + global_annotations == o.global_annotations && + widget_mapping == o.widget_mapping && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotations, global_annotations, widget_mapping, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/page_annotations_data.rb b/lib/datadog_api_client/v2/models/page_annotations_data.rb new file mode 100644 index 000000000000..31fbc07fd2b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/page_annotations_data.rb @@ -0,0 +1,166 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Annotations grouped by widget for a single page. + class PageAnnotationsData + include BaseGenericModel + + # Attributes of the annotations on a page. + attr_reader :attributes + + # ID of the page, prefixed with the page type and joined by a colon + # (for example, `dashboard:abc-def-xyz` or `notebook:1234567890`). + attr_reader :id + + # Page annotations resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PageAnnotationsAttributes', + :'id' => :'String', + :'type' => :'PageAnnotationsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PageAnnotationsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/page_annotations_response.rb b/lib/datadog_api_client/v2/models/page_annotations_response.rb new file mode 100644 index 000000000000..e86dd6d57556 --- /dev/null +++ b/lib/datadog_api_client/v2/models/page_annotations_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing all annotations on a page, grouped by widget. + class PageAnnotationsResponse + include BaseGenericModel + + # Annotations grouped by widget for a single page. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PageAnnotationsData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PageAnnotationsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/page_annotations_type.rb b/lib/datadog_api_client/v2/models/page_annotations_type.rb new file mode 100644 index 000000000000..1f35b0a7767f --- /dev/null +++ b/lib/datadog_api_client/v2/models/page_annotations_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Page annotations resource type. + class PageAnnotationsType + include BaseEnumModel + + PAGE_ANNOTATIONS = "page_annotations".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb new file mode 100644 index 000000000000..6cae03a85eec --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object of an upsert OAuth2 scopes restriction request. + class UpsertOAuthScopesRestrictionData + include BaseGenericModel + + # Attributes of an upsert OAuth2 scopes restriction request. + attr_accessor :attributes + + # JSON:API resource type for an upsert OAuth2 client scopes restriction request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpsertOAuthScopesRestrictionDataAttributes', + :'type' => :'UpsertOAuthScopesRestrictionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb new file mode 100644 index 000000000000..992dddb15dd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_data_attributes.rb @@ -0,0 +1,120 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an upsert OAuth2 scopes restriction request. + class UpsertOAuthScopesRestrictionDataAttributes + include BaseGenericModel + + # OIDC scopes the client is allowed to request. + attr_accessor :oidc_scopes + + # Datadog permission scopes the client is allowed to request. + # Each value must be a valid permission name. + attr_accessor :permission_scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'oidc_scopes' => :'oidc_scopes', + :'permission_scopes' => :'permission_scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'oidc_scopes' => :'Array', + :'permission_scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'oidc_scopes') + if (value = attributes[:'oidc_scopes']).is_a?(Array) + self.oidc_scopes = value + end + end + + if attributes.key?(:'permission_scopes') + if (value = attributes[:'permission_scopes']).is_a?(Array) + self.permission_scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + oidc_scopes == o.oidc_scopes && + permission_scopes == o.permission_scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [oidc_scopes, permission_scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb new file mode 100644 index 000000000000..03ba65e4f357 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating or updating the scopes restriction of an OAuth2 client. + class UpsertOAuthScopesRestrictionRequest + include BaseGenericModel + + # Data object of an upsert OAuth2 scopes restriction request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpsertOAuthScopesRestrictionData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpsertOAuthScopesRestrictionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb new file mode 100644 index 000000000000..ca38a2df07d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/upsert_o_auth_scopes_restriction_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for an upsert OAuth2 client scopes restriction request. + class UpsertOAuthScopesRestrictionType + include BaseEnumModel + + UPSERT_SCOPES_RESTRICTION = "upsert_scopes_restriction".freeze + end +end