diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a86914eb79..590c8e62b6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5385,6 +5385,72 @@ components: example: _latest type: string type: object + AssignSeatsUserRequest: + properties: + data: + $ref: '#/components/schemas/AssignSeatsUserRequestData' + description: The data for the assign seats user request. + type: object + AssignSeatsUserRequestData: + properties: + attributes: + $ref: '#/components/schemas/AssignSeatsUserRequestDataAttributes' + description: The attributes of the assign seats user request. + id: + description: The ID of the assign seats user request. + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + description: The type of the assign seats user request. + required: + - type + - attributes + type: object + AssignSeatsUserRequestDataAttributes: + properties: + product_code: + description: The product code for which to assign seats. + example: '' + type: string + user_uuids: + description: The list of user IDs to assign seats to. + example: + - '' + items: + type: string + type: array + required: + - product_code + - user_uuids + type: object + AssignSeatsUserResponse: + properties: + data: + $ref: '#/components/schemas/AssignSeatsUserResponseData' + description: The data for the assign seats user response. + type: object + AssignSeatsUserResponseData: + properties: + attributes: + $ref: '#/components/schemas/AssignSeatsUserResponseDataAttributes' + description: The attributes of the assign seats user response. + id: + description: The ID of the assign seats user response. + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + type: object + AssignSeatsUserResponseDataAttributes: + properties: + assigned_ids: + description: The list of user IDs to which the seats were assigned. + items: + type: string + type: array + product_code: + description: The product code for which the seats were assigned. + type: string + type: object AttachCaseRequest: description: Request for attaching security findings to a case. properties: @@ -52643,6 +52709,80 @@ components: - ISSUE_ASSIGNEE - ISSUE_CASE - ISSUE_TEAM_OWNERS + SeatAssignmentsDataType: + default: seat-assignments + description: Seat assignments resource type. + enum: + - seat-assignments + example: seat-assignments + type: string + x-enum-varnames: + - SEAT_ASSIGNMENTS + SeatUserData: + properties: + attributes: + $ref: '#/components/schemas/SeatUserDataAttributes' + description: The attributes of the seat user. + id: + description: The ID of the seat user. + example: 00000000-0000-0000-0000-000000000000 + nullable: true + type: string + type: + $ref: '#/components/schemas/SeatUserDataType' + type: object + SeatUserDataArray: + properties: + data: + description: The list of seat users. + items: + $ref: '#/components/schemas/SeatUserData' + type: array + meta: + $ref: '#/components/schemas/SeatUserMeta' + description: The metadata of the seat users. + type: object + SeatUserDataAttributes: + properties: + assigned_at: + description: The date and time the seat was assigned. + example: '2021-01-01T00:00:00Z' + format: date-time + nullable: true + type: string + email: + description: The email of the user. + example: user@example.com + nullable: true + type: string + name: + description: The name of the user. + example: John Doe + nullable: true + type: string + type: object + SeatUserDataType: + default: seat-users + description: Seat users resource type. + enum: + - seat-users + example: seat-users + type: string + x-enum-varnames: + - SEAT_USERS + SeatUserMeta: + properties: + cursor: + description: The cursor for the seat users. + type: string + limit: + description: The limit for the seat users. + format: int64 + type: integer + next_cursor: + description: The next cursor for the seat users. + type: string + type: object SecretRuleArray: properties: data: @@ -64824,6 +64964,44 @@ components: type: string x-enum-varnames: - AZURE_UC_CONFIGS + UnassignSeatsUserRequest: + properties: + data: + $ref: '#/components/schemas/UnassignSeatsUserRequestData' + description: The data for the unassign seats user request. + type: object + UnassignSeatsUserRequestData: + properties: + attributes: + $ref: '#/components/schemas/UnassignSeatsUserRequestDataAttributes' + description: The attributes of the unassign seats user request. + id: + description: The ID of the unassign seats user request. + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + description: The type of the unassign seats user request. + required: + - type + - attributes + type: object + UnassignSeatsUserRequestDataAttributes: + properties: + product_code: + description: The product code for which to unassign seats. + example: '' + type: string + user_uuids: + description: The list of user IDs to unassign seats from. + example: + - '' + items: + type: string + type: array + required: + - product_code + - user_uuids + type: object Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -93305,6 +93483,121 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/seats/users: + delete: + description: Unassign seats from users for a product code. + operationId: UnassignSeatsUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnassignSeatsUserRequest' + required: true + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Unassign seats from users + tags: + - Seats + x-permission: + operator: OR + permissions: + - billing_edit + - incident_write + - on_call_write + get: + description: Get the list of users assigned seats for a product code. + operationId: GetSeatsUsers + parameters: + - description: The product code for which to retrieve seat users. + in: query + name: product_code + required: true + schema: + type: string + - description: Maximum number of results to return. + in: query + name: page[limit] + required: false + schema: + type: integer + - description: Cursor for pagination. + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SeatUserDataArray' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get users with seats + tags: + - Seats + x-permission: + operator: OR + permissions: + - billing_read + - incident_read + - on_call_read + post: + description: Assign seats to users for a product code. + operationId: AssignSeatsUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignSeatsUserRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AssignSeatsUserResponse' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Assign seats to users + tags: + - Seats + x-permission: + operator: OR + permissions: + - billing_edit + - incident_write + - on_call_write /api/v2/security-entities/risk-scores: get: description: Get a list of entity risk scores for your organization. Entity @@ -104454,6 +104747,9 @@ tags: - description: Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters +- description: The seats API allows you to view, assign, and unassign seats for your + organization. + name: Seats - description: Create and manage your security rules, signals, filters, and more. See the [Datadog Security page](https://docs.datadoghq.com/security/) for more information. diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index f1a56e28e8..9381283cc6 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -550,6 +550,13 @@ datadog\_api\_client.v2.api.rum\_retention\_filters\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.seats\_api module +--------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.seats_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.security\_monitoring\_api module ------------------------------------------------------------ diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 252f921cbb..83de6067c9 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1250,6 +1250,48 @@ datadog\_api\_client.v2.model.asset\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.assign\_seats\_user\_request module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.assign\_seats\_user\_request\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.assign\_seats\_user\_request\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.assign\_seats\_user\_response module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.assign\_seats\_user\_response\_data module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.assign\_seats\_user\_response\_data\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.assign_seats_user_response_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.attach\_case\_request module ---------------------------------------------------------- @@ -23258,6 +23300,48 @@ datadog\_api\_client.v2.model.search\_issues\_include\_query\_parameter\_item mo :members: :show-inheritance: +datadog\_api\_client.v2.model.seat\_assignments\_data\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.seat_assignments_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.seat\_user\_data module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.seat_user_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.seat\_user\_data\_array module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.seat_user_data_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.seat\_user\_data\_attributes module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.seat_user_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.seat\_user\_data\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.seat_user_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.seat\_user\_meta module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.seat_user_meta + :members: + :show-inheritance: + datadog\_api\_client.v2.model.secret\_rule\_array module -------------------------------------------------------- @@ -28557,6 +28641,27 @@ datadog\_api\_client.v2.model.uc\_config\_pair\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.unassign\_seats\_user\_request module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.unassign_seats_user_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.unassign\_seats\_user\_request\_data module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.unassign_seats_user_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.unassign\_seats\_user\_request\_data\_attributes module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.unassign_seats_user_request_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.unit module ----------------------------------------- diff --git a/examples/v2/seats/AssignSeatsUser.py b/examples/v2/seats/AssignSeatsUser.py new file mode 100644 index 0000000000..c55e9f6425 --- /dev/null +++ b/examples/v2/seats/AssignSeatsUser.py @@ -0,0 +1,33 @@ +""" +Assign seats to users returns "Created" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.seats_api import SeatsApi +from datadog_api_client.v2.model.assign_seats_user_request import AssignSeatsUserRequest +from datadog_api_client.v2.model.assign_seats_user_request_data import AssignSeatsUserRequestData +from datadog_api_client.v2.model.assign_seats_user_request_data_attributes import AssignSeatsUserRequestDataAttributes +from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +body = AssignSeatsUserRequest( + data=AssignSeatsUserRequestData( + type=SeatAssignmentsDataType.SEAT_ASSIGNMENTS, + attributes=AssignSeatsUserRequestDataAttributes( + product_code="incident_response", + user_uuids=[ + USER_DATA_ID, + ], + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SeatsApi(api_client) + response = api_instance.assign_seats_user(body=body) + + print(response) diff --git a/examples/v2/seats/GetSeatsUsers.py b/examples/v2/seats/GetSeatsUsers.py new file mode 100644 index 0000000000..e8f3dc41e5 --- /dev/null +++ b/examples/v2/seats/GetSeatsUsers.py @@ -0,0 +1,16 @@ +""" +Get users with seats returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.seats_api import SeatsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SeatsApi(api_client) + response = api_instance.get_seats_users( + product_code="incident_response", + page_limit=100, + ) + + print(response) diff --git a/examples/v2/seats/UnassignSeatsUser.py b/examples/v2/seats/UnassignSeatsUser.py new file mode 100644 index 0000000000..b028304ebb --- /dev/null +++ b/examples/v2/seats/UnassignSeatsUser.py @@ -0,0 +1,33 @@ +""" +Unassign seats from users returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.seats_api import SeatsApi +from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType +from datadog_api_client.v2.model.unassign_seats_user_request import UnassignSeatsUserRequest +from datadog_api_client.v2.model.unassign_seats_user_request_data import UnassignSeatsUserRequestData +from datadog_api_client.v2.model.unassign_seats_user_request_data_attributes import ( + UnassignSeatsUserRequestDataAttributes, +) + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +body = UnassignSeatsUserRequest( + data=UnassignSeatsUserRequestData( + type=SeatAssignmentsDataType.SEAT_ASSIGNMENTS, + attributes=UnassignSeatsUserRequestDataAttributes( + product_code="incident_response", + user_uuids=[ + USER_DATA_ID, + ], + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SeatsApi(api_client) + api_instance.unassign_seats_user(body=body) diff --git a/src/datadog_api_client/v2/api/seats_api.py b/src/datadog_api_client/v2/api/seats_api.py new file mode 100644 index 0000000000..7824addd82 --- /dev/null +++ b/src/datadog_api_client/v2/api/seats_api.py @@ -0,0 +1,163 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.unassign_seats_user_request import UnassignSeatsUserRequest +from datadog_api_client.v2.model.seat_user_data_array import SeatUserDataArray +from datadog_api_client.v2.model.assign_seats_user_response import AssignSeatsUserResponse +from datadog_api_client.v2.model.assign_seats_user_request import AssignSeatsUserRequest + + +class SeatsApi: + """ + The seats API allows you to view, assign, and unassign seats for your organization. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._assign_seats_user_endpoint = _Endpoint( + settings={ + "response_type": (AssignSeatsUserResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/seats/users", + "operation_id": "assign_seats_user", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AssignSeatsUserRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._get_seats_users_endpoint = _Endpoint( + settings={ + "response_type": (SeatUserDataArray,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/seats/users", + "operation_id": "get_seats_users", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "product_code": { + "required": True, + "openapi_types": (str,), + "attribute": "product_code", + "location": "query", + }, + "page_limit": { + "openapi_types": (int,), + "attribute": "page[limit]", + "location": "query", + }, + "page_cursor": { + "openapi_types": (str,), + "attribute": "page[cursor]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._unassign_seats_user_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/seats/users", + "operation_id": "unassign_seats_user", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (UnassignSeatsUserRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def assign_seats_user( + self, + body: AssignSeatsUserRequest, + ) -> AssignSeatsUserResponse: + """Assign seats to users. + + Assign seats to users for a product code. + + :type body: AssignSeatsUserRequest + :rtype: AssignSeatsUserResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._assign_seats_user_endpoint.call_with_http_info(**kwargs) + + def get_seats_users( + self, + product_code: str, + *, + page_limit: Union[int, UnsetType] = unset, + page_cursor: Union[str, UnsetType] = unset, + ) -> SeatUserDataArray: + """Get users with seats. + + Get the list of users assigned seats for a product code. + + :param product_code: The product code for which to retrieve seat users. + :type product_code: str + :param page_limit: Maximum number of results to return. + :type page_limit: int, optional + :param page_cursor: Cursor for pagination. + :type page_cursor: str, optional + :rtype: SeatUserDataArray + """ + kwargs: Dict[str, Any] = {} + kwargs["product_code"] = product_code + + if page_limit is not unset: + kwargs["page_limit"] = page_limit + + if page_cursor is not unset: + kwargs["page_cursor"] = page_cursor + + return self._get_seats_users_endpoint.call_with_http_info(**kwargs) + + def unassign_seats_user( + self, + body: UnassignSeatsUserRequest, + ) -> None: + """Unassign seats from users. + + Unassign seats from users for a product code. + + :type body: UnassignSeatsUserRequest + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._unassign_seats_user_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index e2d3e5d6da..7ed8848978 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -76,6 +76,7 @@ from datadog_api_client.v2.api.rum_replay_sessions_api import RumReplaySessionsApi from datadog_api_client.v2.api.rum_replay_viewership_api import RumReplayViewershipApi from datadog_api_client.v2.api.rum_retention_filters_api import RumRetentionFiltersApi +from datadog_api_client.v2.api.seats_api import SeatsApi from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi from datadog_api_client.v2.api.sensitive_data_scanner_api import SensitiveDataScannerApi from datadog_api_client.v2.api.service_accounts_api import ServiceAccountsApi @@ -176,6 +177,7 @@ "RumReplaySessionsApi", "RumReplayViewershipApi", "RumRetentionFiltersApi", + "SeatsApi", "SecurityMonitoringApi", "SensitiveDataScannerApi", "ServiceAccountsApi", diff --git a/src/datadog_api_client/v2/model/assign_seats_user_request.py b/src/datadog_api_client/v2/model/assign_seats_user_request.py new file mode 100644 index 0000000000..8b5761aab8 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.assign_seats_user_request_data import AssignSeatsUserRequestData + + +class AssignSeatsUserRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.assign_seats_user_request_data import AssignSeatsUserRequestData + + return { + "data": (AssignSeatsUserRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AssignSeatsUserRequestData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: AssignSeatsUserRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/assign_seats_user_request_data.py b/src/datadog_api_client/v2/model/assign_seats_user_request_data.py new file mode 100644 index 0000000000..75978dd060 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_request_data.py @@ -0,0 +1,67 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.assign_seats_user_request_data_attributes import ( + AssignSeatsUserRequestDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + +class AssignSeatsUserRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.assign_seats_user_request_data_attributes import ( + AssignSeatsUserRequestDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + return { + "attributes": (AssignSeatsUserRequestDataAttributes,), + "id": (str,), + "type": (SeatAssignmentsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: AssignSeatsUserRequestDataAttributes, + type: SeatAssignmentsDataType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: AssignSeatsUserRequestDataAttributes + + :param id: The ID of the assign seats user request. + :type id: str, optional + + :param type: Seat assignments resource type. + :type type: SeatAssignmentsDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/assign_seats_user_request_data_attributes.py b/src/datadog_api_client/v2/model/assign_seats_user_request_data_attributes.py new file mode 100644 index 0000000000..ed6b913871 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_request_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AssignSeatsUserRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "product_code": (str,), + "user_uuids": ([str],), + } + + attribute_map = { + "product_code": "product_code", + "user_uuids": "user_uuids", + } + + def __init__(self_, product_code: str, user_uuids: List[str], **kwargs): + """ + + + :param product_code: The product code for which to assign seats. + :type product_code: str + + :param user_uuids: The list of user IDs to assign seats to. + :type user_uuids: [str] + """ + super().__init__(kwargs) + + self_.product_code = product_code + self_.user_uuids = user_uuids diff --git a/src/datadog_api_client/v2/model/assign_seats_user_response.py b/src/datadog_api_client/v2/model/assign_seats_user_response.py new file mode 100644 index 0000000000..72a4a8ebe9 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.assign_seats_user_response_data import AssignSeatsUserResponseData + + +class AssignSeatsUserResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.assign_seats_user_response_data import AssignSeatsUserResponseData + + return { + "data": (AssignSeatsUserResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AssignSeatsUserResponseData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: AssignSeatsUserResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/assign_seats_user_response_data.py b/src/datadog_api_client/v2/model/assign_seats_user_response_data.py new file mode 100644 index 0000000000..e6eb83fb73 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_response_data.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.assign_seats_user_response_data_attributes import ( + AssignSeatsUserResponseDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + +class AssignSeatsUserResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.assign_seats_user_response_data_attributes import ( + AssignSeatsUserResponseDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + return { + "attributes": (AssignSeatsUserResponseDataAttributes,), + "id": (str,), + "type": (SeatAssignmentsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[AssignSeatsUserResponseDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[SeatAssignmentsDataType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: AssignSeatsUserResponseDataAttributes, optional + + :param id: The ID of the assign seats user response. + :type id: str, optional + + :param type: Seat assignments resource type. + :type type: SeatAssignmentsDataType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/assign_seats_user_response_data_attributes.py b/src/datadog_api_client/v2/model/assign_seats_user_response_data_attributes.py new file mode 100644 index 0000000000..4e77280a79 --- /dev/null +++ b/src/datadog_api_client/v2/model/assign_seats_user_response_data_attributes.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class AssignSeatsUserResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assigned_ids": ([str],), + "product_code": (str,), + } + + attribute_map = { + "assigned_ids": "assigned_ids", + "product_code": "product_code", + } + + def __init__( + self_, assigned_ids: Union[List[str], UnsetType] = unset, product_code: Union[str, UnsetType] = unset, **kwargs + ): + """ + + + :param assigned_ids: The list of user IDs to which the seats were assigned. + :type assigned_ids: [str], optional + + :param product_code: The product code for which the seats were assigned. + :type product_code: str, optional + """ + if assigned_ids is not unset: + kwargs["assigned_ids"] = assigned_ids + if product_code is not unset: + kwargs["product_code"] = product_code + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/seat_assignments_data_type.py b/src/datadog_api_client/v2/model/seat_assignments_data_type.py new file mode 100644 index 0000000000..520dbb8fa6 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_assignments_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SeatAssignmentsDataType(ModelSimple): + """ + Seat assignments resource type. + + :param value: If omitted defaults to "seat-assignments". Must be one of ["seat-assignments"]. + :type value: str + """ + + allowed_values = { + "seat-assignments", + } + SEAT_ASSIGNMENTS: ClassVar["SeatAssignmentsDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SeatAssignmentsDataType.SEAT_ASSIGNMENTS = SeatAssignmentsDataType("seat-assignments") diff --git a/src/datadog_api_client/v2/model/seat_user_data.py b/src/datadog_api_client/v2/model/seat_user_data.py new file mode 100644 index 0000000000..9f6e212a49 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_user_data.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.seat_user_data_attributes import SeatUserDataAttributes + from datadog_api_client.v2.model.seat_user_data_type import SeatUserDataType + + +class SeatUserData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.seat_user_data_attributes import SeatUserDataAttributes + from datadog_api_client.v2.model.seat_user_data_type import SeatUserDataType + + return { + "attributes": (SeatUserDataAttributes,), + "id": (str, none_type), + "type": (SeatUserDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[SeatUserDataAttributes, UnsetType] = unset, + id: Union[str, none_type, UnsetType] = unset, + type: Union[SeatUserDataType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: SeatUserDataAttributes, optional + + :param id: The ID of the seat user. + :type id: str, none_type, optional + + :param type: Seat users resource type. + :type type: SeatUserDataType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/seat_user_data_array.py b/src/datadog_api_client/v2/model/seat_user_data_array.py new file mode 100644 index 0000000000..df70ada1a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_user_data_array.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.seat_user_data import SeatUserData + from datadog_api_client.v2.model.seat_user_meta import SeatUserMeta + + +class SeatUserDataArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.seat_user_data import SeatUserData + from datadog_api_client.v2.model.seat_user_meta import SeatUserMeta + + return { + "data": ([SeatUserData],), + "meta": (SeatUserMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[SeatUserData], UnsetType] = unset, + meta: Union[SeatUserMeta, UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: The list of seat users. + :type data: [SeatUserData], optional + + :param meta: + :type meta: SeatUserMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/seat_user_data_attributes.py b/src/datadog_api_client/v2/model/seat_user_data_attributes.py new file mode 100644 index 0000000000..9579966092 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_user_data_attributes.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +class SeatUserDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "assigned_at": (datetime, none_type), + "email": (str, none_type), + "name": (str, none_type), + } + + attribute_map = { + "assigned_at": "assigned_at", + "email": "email", + "name": "name", + } + + def __init__( + self_, + assigned_at: Union[datetime, none_type, UnsetType] = unset, + email: Union[str, none_type, UnsetType] = unset, + name: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param assigned_at: The date and time the seat was assigned. + :type assigned_at: datetime, none_type, optional + + :param email: The email of the user. + :type email: str, none_type, optional + + :param name: The name of the user. + :type name: str, none_type, optional + """ + if assigned_at is not unset: + kwargs["assigned_at"] = assigned_at + if email is not unset: + kwargs["email"] = email + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/seat_user_data_type.py b/src/datadog_api_client/v2/model/seat_user_data_type.py new file mode 100644 index 0000000000..cc17686382 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_user_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SeatUserDataType(ModelSimple): + """ + Seat users resource type. + + :param value: If omitted defaults to "seat-users". Must be one of ["seat-users"]. + :type value: str + """ + + allowed_values = { + "seat-users", + } + SEAT_USERS: ClassVar["SeatUserDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SeatUserDataType.SEAT_USERS = SeatUserDataType("seat-users") diff --git a/src/datadog_api_client/v2/model/seat_user_meta.py b/src/datadog_api_client/v2/model/seat_user_meta.py new file mode 100644 index 0000000000..6549784f28 --- /dev/null +++ b/src/datadog_api_client/v2/model/seat_user_meta.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SeatUserMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "cursor": (str,), + "limit": (int,), + "next_cursor": (str,), + } + + attribute_map = { + "cursor": "cursor", + "limit": "limit", + "next_cursor": "next_cursor", + } + + def __init__( + self_, + cursor: Union[str, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + next_cursor: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param cursor: The cursor for the seat users. + :type cursor: str, optional + + :param limit: The limit for the seat users. + :type limit: int, optional + + :param next_cursor: The next cursor for the seat users. + :type next_cursor: str, optional + """ + if cursor is not unset: + kwargs["cursor"] = cursor + if limit is not unset: + kwargs["limit"] = limit + if next_cursor is not unset: + kwargs["next_cursor"] = next_cursor + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/unassign_seats_user_request.py b/src/datadog_api_client/v2/model/unassign_seats_user_request.py new file mode 100644 index 0000000000..3f0f33e0fa --- /dev/null +++ b/src/datadog_api_client/v2/model/unassign_seats_user_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.unassign_seats_user_request_data import UnassignSeatsUserRequestData + + +class UnassignSeatsUserRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.unassign_seats_user_request_data import UnassignSeatsUserRequestData + + return { + "data": (UnassignSeatsUserRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[UnassignSeatsUserRequestData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: UnassignSeatsUserRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/unassign_seats_user_request_data.py b/src/datadog_api_client/v2/model/unassign_seats_user_request_data.py new file mode 100644 index 0000000000..619847e035 --- /dev/null +++ b/src/datadog_api_client/v2/model/unassign_seats_user_request_data.py @@ -0,0 +1,67 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.unassign_seats_user_request_data_attributes import ( + UnassignSeatsUserRequestDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + +class UnassignSeatsUserRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.unassign_seats_user_request_data_attributes import ( + UnassignSeatsUserRequestDataAttributes, + ) + from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType + + return { + "attributes": (UnassignSeatsUserRequestDataAttributes,), + "id": (str,), + "type": (SeatAssignmentsDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: UnassignSeatsUserRequestDataAttributes, + type: SeatAssignmentsDataType, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: UnassignSeatsUserRequestDataAttributes + + :param id: The ID of the unassign seats user request. + :type id: str, optional + + :param type: Seat assignments resource type. + :type type: SeatAssignmentsDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/unassign_seats_user_request_data_attributes.py b/src/datadog_api_client/v2/model/unassign_seats_user_request_data_attributes.py new file mode 100644 index 0000000000..58b8b4130e --- /dev/null +++ b/src/datadog_api_client/v2/model/unassign_seats_user_request_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UnassignSeatsUserRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "product_code": (str,), + "user_uuids": ([str],), + } + + attribute_map = { + "product_code": "product_code", + "user_uuids": "user_uuids", + } + + def __init__(self_, product_code: str, user_uuids: List[str], **kwargs): + """ + + + :param product_code: The product code for which to unassign seats. + :type product_code: str + + :param user_uuids: The list of user IDs to unassign seats from. + :type user_uuids: [str] + """ + super().__init__(kwargs) + + self_.product_code = product_code + self_.user_uuids = user_uuids diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 90de7cd5a5..2f5f812904 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -366,6 +366,12 @@ from datadog_api_client.v2.model.asset_risks import AssetRisks from datadog_api_client.v2.model.asset_type import AssetType from datadog_api_client.v2.model.asset_version import AssetVersion +from datadog_api_client.v2.model.assign_seats_user_request import AssignSeatsUserRequest +from datadog_api_client.v2.model.assign_seats_user_request_data import AssignSeatsUserRequestData +from datadog_api_client.v2.model.assign_seats_user_request_data_attributes import AssignSeatsUserRequestDataAttributes +from datadog_api_client.v2.model.assign_seats_user_response import AssignSeatsUserResponse +from datadog_api_client.v2.model.assign_seats_user_response_data import AssignSeatsUserResponseData +from datadog_api_client.v2.model.assign_seats_user_response_data_attributes import AssignSeatsUserResponseDataAttributes from datadog_api_client.v2.model.attach_case_request import AttachCaseRequest from datadog_api_client.v2.model.attach_case_request_data import AttachCaseRequestData from datadog_api_client.v2.model.attach_case_request_data_relationships import AttachCaseRequestDataRelationships @@ -4673,6 +4679,12 @@ from datadog_api_client.v2.model.schedule_user_type import ScheduleUserType from datadog_api_client.v2.model.scorecard_type import ScorecardType from datadog_api_client.v2.model.search_issues_include_query_parameter_item import SearchIssuesIncludeQueryParameterItem +from datadog_api_client.v2.model.seat_assignments_data_type import SeatAssignmentsDataType +from datadog_api_client.v2.model.seat_user_data import SeatUserData +from datadog_api_client.v2.model.seat_user_data_array import SeatUserDataArray +from datadog_api_client.v2.model.seat_user_data_attributes import SeatUserDataAttributes +from datadog_api_client.v2.model.seat_user_data_type import SeatUserDataType +from datadog_api_client.v2.model.seat_user_meta import SeatUserMeta from datadog_api_client.v2.model.secret_rule_array import SecretRuleArray from datadog_api_client.v2.model.secret_rule_data import SecretRuleData from datadog_api_client.v2.model.secret_rule_data_attributes import SecretRuleDataAttributes @@ -5774,6 +5786,11 @@ UCConfigPairDataAttributesConfigsItems, ) from datadog_api_client.v2.model.uc_config_pair_data_type import UCConfigPairDataType +from datadog_api_client.v2.model.unassign_seats_user_request import UnassignSeatsUserRequest +from datadog_api_client.v2.model.unassign_seats_user_request_data import UnassignSeatsUserRequestData +from datadog_api_client.v2.model.unassign_seats_user_request_data_attributes import ( + UnassignSeatsUserRequestDataAttributes, +) from datadog_api_client.v2.model.unit import Unit from datadog_api_client.v2.model.unpublish_app_response import UnpublishAppResponse from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest @@ -6294,6 +6311,12 @@ "AssetRisks", "AssetType", "AssetVersion", + "AssignSeatsUserRequest", + "AssignSeatsUserRequestData", + "AssignSeatsUserRequestDataAttributes", + "AssignSeatsUserResponse", + "AssignSeatsUserResponseData", + "AssignSeatsUserResponseDataAttributes", "AttachCaseRequest", "AttachCaseRequestData", "AttachCaseRequestDataRelationships", @@ -9377,6 +9400,12 @@ "ScheduleUserType", "ScorecardType", "SearchIssuesIncludeQueryParameterItem", + "SeatAssignmentsDataType", + "SeatUserData", + "SeatUserDataArray", + "SeatUserDataAttributes", + "SeatUserDataType", + "SeatUserMeta", "SecretRuleArray", "SecretRuleData", "SecretRuleDataAttributes", @@ -10132,6 +10161,9 @@ "UCConfigPairDataAttributes", "UCConfigPairDataAttributesConfigsItems", "UCConfigPairDataType", + "UnassignSeatsUserRequest", + "UnassignSeatsUserRequestData", + "UnassignSeatsUserRequestDataAttributes", "Unit", "UnpublishAppResponse", "UpdateActionConnectionRequest", diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.frozen b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.frozen new file mode 100644 index 0000000000..225735d1e0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.frozen @@ -0,0 +1 @@ +2026-02-11T20:26:19.395Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.yaml b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.yaml new file mode 100644 index 0000000000..1896ed1f47 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"product_code":"","user_uuids":[""]},"type":"seat-assignments"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen new file mode 100644 index 0000000000..8008d3b025 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:37.303Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml new file mode 100644 index 0000000000..56e90d7cb6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"email":"Test-Assign_seats_to_users_returns_Unprocessable_Entity_response_when_product_code_is_empty-1770835177@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + string: '{"data":{"type":"users","id":"f9900642-4311-4d6a-836b-2f367a92c511","attributes":{"name":null,"handle":"test-assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty-1770835177@datadoghq.com","created_at":"2026-02-11T18:39:38.645306+00:00","modified_at":"2026-02-11T18:39:38.645306+00:00","email":"test-assign_seats_to_users_returns_unprocessable_entity_response_when_product_code_is_empty-1770835177@datadoghq.com","icon":"https://secure.gravatar.com/avatar/b2c717bae3bae3a185ff567efda79a5a?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"product_code":"","user_uuids":["f9900642-4311-4d6a-836b-2f367a92c511"]},"type":"seat-assignments"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/f9900642-4311-4d6a-836b-2f367a92c511 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen new file mode 100644 index 0000000000..d6ff62948b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:39.382Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml new file mode 100644 index 0000000000..a9089b18dc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_assign_seats_to_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"product_code":"incident_response","user_uuids":[]},"type":"seat-assignments"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"user_uuids is required + and must not be empty"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.frozen b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.frozen new file mode 100644 index 0000000000..ecbb2f83e3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:39.654Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.yaml b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.yaml new file mode 100644 index 0000000000..e9300ac131 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_bad_request_response_when_product_code_is_missing.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"product_code query parameter + is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.frozen new file mode 100644 index 0000000000..b1c5aa5abc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:39.917Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.yaml new file mode 100644 index 0000000000..0812ee7ea1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_users_with_seats_returns_ok_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/seats/users?product_code=incident_response&page%5Blimit%5D=100 + response: + body: + string: '{"data":[]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.frozen new file mode 100644 index 0000000000..f1064fc9ac --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.frozen @@ -0,0 +1 @@ +2026-02-11T20:26:20.422Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.yaml new file mode 100644 index 0000000000..319326cde0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '{"data":{"attributes":{"product_code":"","user_uuids":[""]},"type":"seat-assignments"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen new file mode 100644 index 0000000000..c10616f2c0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:40.198Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml new file mode 100644 index 0000000000..c1bfa4d527 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"email":"Test-Unassign_seats_from_users_returns_Unprocessable_Entity_response_when_product_code_is_empty-1770835180@datadoghq.com","title":"user + title"},"type":"users"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/users + response: + body: + string: '{"data":{"type":"users","id":"626a4e8e-64bd-409d-b80e-428f08ac0b62","attributes":{"name":null,"handle":"test-unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty-1770835180@datadoghq.com","created_at":"2026-02-11T18:39:40.455244+00:00","modified_at":"2026-02-11T18:39:40.455244+00:00","email":"test-unassign_seats_from_users_returns_unprocessable_entity_response_when_product_code_is_empty-1770835180@datadoghq.com","icon":"https://secure.gravatar.com/avatar/17f8bf4cb2d8600dc8ada5cdd71b7d77?s=48&d=retro","title":"user + title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"product_code":"","user_uuids":["626a4e8e-64bd-409d-b80e-428f08ac0b62"]},"type":"seat-assignments"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/626a4e8e-64bd-409d-b80e-428f08ac0b62 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen new file mode 100644 index 0000000000..bdfa747c4e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.frozen @@ -0,0 +1 @@ +2026-02-11T18:39:41.207Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml new file mode 100644 index 0000000000..bb756c74e0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unassign_seats_from_users_returns_unprocessable_entity_response_when_user_uuids_is_empty.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"product_code":"incident_response","user_uuids":[]},"type":"seat-assignments"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + string: '{"errors":[{"title":"Generic Error","detail":"user_uuids is required + and must not be empty"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +version: 1 diff --git a/tests/v2/features/seats.feature b/tests/v2/features/seats.feature new file mode 100644 index 0000000000..4c5767750a --- /dev/null +++ b/tests/v2/features/seats.feature @@ -0,0 +1,108 @@ +@endpoint(seats) @endpoint(seats-v2) +Feature: Seats + The seats API allows you to view, assign, and unassign seats for your + organization. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Seats" API + + @generated @skip @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Bad Request" response + Given new "AssignSeatsUser" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-validation @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Created" response + Given there is a valid "user" in the system + And new "AssignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "incident_response", "user_uuids": ["{{ user.data.id }}"]}}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "seat-assignments" + And the response "data.attributes.product_code" is equal to "incident_response" + And the response "data.attributes.assigned_ids[0]" is equal to "{{ user.data.id }}" + + @skip-validation @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Unprocessable Entity" response + Given new "AssignSeatsUser" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Unprocessable Entity" response when product_code is empty + Given there is a valid "user" in the system + And new "AssignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "", "user_uuids": ["{{ user.data.id }}"]}}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Unprocessable Entity" response when user_uuids is empty + Given new "AssignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "incident_response", "user_uuids": []}}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/billing-experience + Scenario: Get users with seats returns "Bad Request" response + Given new "GetSeatsUsers" request + And request contains "product_code" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/billing-experience + Scenario: Get users with seats returns "OK" response + Given new "GetSeatsUsers" request + And request contains "product_code" parameter with value "incident_response" + And request contains "page[limit]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/billing-experience + Scenario: Get users with seats returns "Unprocessable Entity" response + Given new "GetSeatsUsers" request + And request contains "product_code" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "Bad Request" response + Given new "UnassignSeatsUser" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-validation @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "No Content" response + Given there is a valid "user" in the system + And new "UnassignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "incident_response", "user_uuids": ["{{ user.data.id }}"]}}} + When the request is sent + Then the response status is 204 No Content + + @skip-validation @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "Unprocessable Entity" response + Given new "UnassignSeatsUser" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "Unprocessable Entity" response when product_code is empty + Given there is a valid "user" in the system + And new "UnassignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "", "user_uuids": ["{{ user.data.id }}"]}}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "Unprocessable Entity" response when user_uuids is empty + Given new "UnassignSeatsUser" request + And body with value {"data": {"type": "seat-assignments", "attributes": {"product_code": "incident_response", "user_uuids": []}}} + When the request is sent + Then the response status is 422 Unprocessable Entity diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 5758d28e03..b5703b05a0 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4298,6 +4298,31 @@ "type": "idempotent" } }, + "UnassignSeatsUser": { + "tag": "Seats", + "undo": { + "type": "idempotent" + } + }, + "GetSeatsUsers": { + "tag": "Seats", + "undo": { + "type": "safe" + } + }, + "AssignSeatsUser": { + "tag": "Seats", + "undo": { + "operationId": "UnassignSeatsUser", + "parameters": [ + { + "name": "body", + "template": "{\"data\": {\"type\": \"seat-assignments\", \"attributes\": {\"product_code\": \"{{ data.attributes.product_code }}\", \"user_uuids\": {{ data.attributes.assigned_ids }}}}}" + } + ], + "type": "unsafe" + } + }, "ListEntityRiskScores": { "tag": "Entity Risk Scores", "undo": {