From 5ceecac74c9d7e19c0e07e2f76f5bcca3c135547 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 18 Feb 2026 20:13:51 +0000 Subject: [PATCH] Regenerate client from commit 352c516 of spec repo --- .generator/schemas/v2/openapi.yaml | 296 ++++++++++++++++++ ...response-when-product-code-is-empty.frozen | 1 + ...ty-response-when-product-code-is-empty.yml | 66 ++++ ...y-response-when-user-uuids-is-empty.frozen | 1 + ...tity-response-when-user-uuids-is-empty.yml | 25 ++ ...turns-Unprocessable-Entity-response.frozen | 1 + ...-returns-Unprocessable-Entity-response.yml | 24 ++ ...sponse-when-product-code-is-missing.frozen | 1 + ...-response-when-product-code-is-missing.yml | 21 ++ ...sers-with-seats-returns-OK-response.frozen | 1 + ...t-users-with-seats-returns-OK-response.yml | 20 ++ ...response-when-product-code-is-empty.frozen | 1 + ...ty-response-when-product-code-is-empty.yml | 66 ++++ ...y-response-when-user-uuids-is-empty.frozen | 1 + ...tity-response-when-user-uuids-is-empty.yml | 25 ++ ...turns-Unprocessable-Entity-response.frozen | 1 + ...-returns-Unprocessable-Entity-response.yml | 24 ++ examples/v2/seats/AssignSeatsUser.rb | 20 ++ examples/v2/seats/GetSeatsUsers.rb | 8 + examples/v2/seats/UnassignSeatsUser.rb | 20 ++ features/scenarios_model_mapping.rb | 11 + features/v2/seats.feature | 108 +++++++ features/v2/undo.json | 25 ++ lib/datadog_api_client/inflector.rb | 16 + lib/datadog_api_client/v2/api/seats_api.rb | 230 ++++++++++++++ .../v2/models/assign_seats_user_request.rb | 105 +++++++ .../models/assign_seats_user_request_data.rb | 154 +++++++++ ...sign_seats_user_request_data_attributes.rb | 146 +++++++++ .../v2/models/assign_seats_user_response.rb | 105 +++++++ .../models/assign_seats_user_response_data.rb | 125 ++++++++ ...ign_seats_user_response_data_attributes.rb | 117 +++++++ .../v2/models/seat_assignments_data_type.rb | 26 ++ .../v2/models/seat_user_data.rb | 133 ++++++++ .../v2/models/seat_user_data_array.rb | 117 +++++++ .../v2/models/seat_user_data_attributes.rb | 135 ++++++++ .../v2/models/seat_user_data_type.rb | 26 ++ .../v2/models/seat_user_meta.rb | 125 ++++++++ .../v2/models/unassign_seats_user_request.rb | 105 +++++++ .../unassign_seats_user_request_data.rb | 154 +++++++++ ...sign_seats_user_request_data_attributes.rb | 146 +++++++++ 40 files changed, 2732 insertions(+) create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.frozen create mode 100644 cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.yml create mode 100644 cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.frozen create mode 100644 cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.yml create mode 100644 cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.frozen create mode 100644 cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.yml create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.frozen create mode 100644 cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.yml create mode 100644 examples/v2/seats/AssignSeatsUser.rb create mode 100644 examples/v2/seats/GetSeatsUsers.rb create mode 100644 examples/v2/seats/UnassignSeatsUser.rb create mode 100644 features/v2/seats.feature create mode 100644 lib/datadog_api_client/v2/api/seats_api.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_request.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_response.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/seat_assignments_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/seat_user_data.rb create mode 100644 lib/datadog_api_client/v2/models/seat_user_data_array.rb create mode 100644 lib/datadog_api_client/v2/models/seat_user_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/seat_user_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/seat_user_meta.rb create mode 100644 lib/datadog_api_client/v2/models/unassign_seats_user_request.rb create mode 100644 lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/unassign_seats_user_request_data_attributes.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a86914eb798..590c8e62b61 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/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen new file mode 100644 index 00000000000..8008d3b0250 --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml new file mode 100644 index 00000000000..02649568d9d --- /dev/null +++ b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 11 Feb 2026 18:39:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Wed, 11 Feb 2026 18:39:37 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/f9900642-4311-4d6a-836b-2f367a92c511 + 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/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen new file mode 100644 index 00000000000..d6ff62948bb --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml new file mode 100644 index 00000000000..5e1e0d10859 --- /dev/null +++ b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:39 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.frozen b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.frozen new file mode 100644 index 00000000000..225735d1e07 --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.yml b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.yml new file mode 100644 index 00000000000..fa3e0e95670 --- /dev/null +++ b/cassettes/features/v2/seats/Assign-seats-to-users-returns-Unprocessable-Entity-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 20:26:19 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.frozen b/cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.frozen new file mode 100644 index 00000000000..ecbb2f83e3e --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.yml b/cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.yml new file mode 100644 index 00000000000..0dca51b2955 --- /dev/null +++ b/cassettes/features/v2/seats/Get-users-with-seats-returns-Bad-Request-response-when-product-code-is-missing.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:39 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/seats/users + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.frozen b/cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.frozen new file mode 100644 index 00000000000..b1c5aa5abcd --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.yml b/cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.yml new file mode 100644 index 00000000000..4f38dcdf2df --- /dev/null +++ b/cassettes/features/v2/seats/Get-users-with-seats-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:39 GMT + 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: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.frozen new file mode 100644 index 00000000000..c10616f2c0d --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml new file mode 100644 index 00000000000..24d5872ecd8 --- /dev/null +++ b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-product-code-is-empty.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:40 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Wed, 11 Feb 2026 18:39:40 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Wed, 11 Feb 2026 18:39:40 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/626a4e8e-64bd-409d-b80e-428f08ac0b62 + 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/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.frozen new file mode 100644 index 00000000000..bdfa747c4eb --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml new file mode 100644 index 00000000000..cbcd89433da --- /dev/null +++ b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response-when-user-uuids-is-empty.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 18:39:41 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.frozen b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.frozen new file mode 100644 index 00000000000..f1064fc9ac1 --- /dev/null +++ b/cassettes/features/v2/seats/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/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.yml b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.yml new file mode 100644 index 00000000000..cda7b5db982 --- /dev/null +++ b/cassettes/features/v2/seats/Unassign-seats-from-users-returns-Unprocessable-Entity-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Wed, 11 Feb 2026 20:26:20 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"product_code is required"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +recorded_with: VCR 6.0.0 diff --git a/examples/v2/seats/AssignSeatsUser.rb b/examples/v2/seats/AssignSeatsUser.rb new file mode 100644 index 00000000000..b819d5b99d4 --- /dev/null +++ b/examples/v2/seats/AssignSeatsUser.rb @@ -0,0 +1,20 @@ +# Assign seats to users returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] + +body = DatadogAPIClient::V2::AssignSeatsUserRequest.new({ + data: DatadogAPIClient::V2::AssignSeatsUserRequestData.new({ + type: DatadogAPIClient::V2::SeatAssignmentsDataType::SEAT_ASSIGNMENTS, + attributes: DatadogAPIClient::V2::AssignSeatsUserRequestDataAttributes.new({ + product_code: "incident_response", + user_uuids: [ + USER_DATA_ID, + ], + }), + }), +}) +p api_instance.assign_seats_user(body) diff --git a/examples/v2/seats/GetSeatsUsers.rb b/examples/v2/seats/GetSeatsUsers.rb new file mode 100644 index 00000000000..0db05d5a239 --- /dev/null +++ b/examples/v2/seats/GetSeatsUsers.rb @@ -0,0 +1,8 @@ +# Get users with seats returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new +opts = { + page_limit: 100, +} +p api_instance.get_seats_users("incident_response", opts) diff --git a/examples/v2/seats/UnassignSeatsUser.rb b/examples/v2/seats/UnassignSeatsUser.rb new file mode 100644 index 00000000000..615cc5c2c41 --- /dev/null +++ b/examples/v2/seats/UnassignSeatsUser.rb @@ -0,0 +1,20 @@ +# Unassign seats from users returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] + +body = DatadogAPIClient::V2::UnassignSeatsUserRequest.new({ + data: DatadogAPIClient::V2::UnassignSeatsUserRequestData.new({ + type: DatadogAPIClient::V2::SeatAssignmentsDataType::SEAT_ASSIGNMENTS, + attributes: DatadogAPIClient::V2::UnassignSeatsUserRequestDataAttributes.new({ + product_code: "incident_response", + user_uuids: [ + USER_DATA_ID, + ], + }), + }), +}) +api_instance.unassign_seats_user(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c6c7a88faf3..385deed861e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3392,6 +3392,17 @@ "rule_id" => "String", "body" => "UpdateRuleRequest", }, + "v2.UnassignSeatsUser" => { + "body" => "UnassignSeatsUserRequest", + }, + "v2.GetSeatsUsers" => { + "product_code" => "String", + "page_limit" => "Integer", + "page_cursor" => "String", + }, + "v2.AssignSeatsUser" => { + "body" => "AssignSeatsUserRequest", + }, "v2.ListEntityRiskScores" => { "from" => "Integer", "to" => "Integer", diff --git a/features/v2/seats.feature b/features/v2/seats.feature new file mode 100644 index 00000000000..4c5767750ab --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 5758d28e036..b5703b05a0d 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b580619b151..95ae4792d0f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1158,6 +1158,12 @@ def overrides "v2.asset_risks" => "AssetRisks", "v2.asset_type" => "AssetType", "v2.asset_version" => "AssetVersion", + "v2.assign_seats_user_request" => "AssignSeatsUserRequest", + "v2.assign_seats_user_request_data" => "AssignSeatsUserRequestData", + "v2.assign_seats_user_request_data_attributes" => "AssignSeatsUserRequestDataAttributes", + "v2.assign_seats_user_response" => "AssignSeatsUserResponse", + "v2.assign_seats_user_response_data" => "AssignSeatsUserResponseData", + "v2.assign_seats_user_response_data_attributes" => "AssignSeatsUserResponseDataAttributes", "v2.attach_case_request" => "AttachCaseRequest", "v2.attach_case_request_data" => "AttachCaseRequestData", "v2.attach_case_request_data_relationships" => "AttachCaseRequestDataRelationships", @@ -4285,6 +4291,12 @@ def overrides "v2.schedule_user_type" => "ScheduleUserType", "v2.scorecard_type" => "ScorecardType", "v2.search_issues_include_query_parameter_item" => "SearchIssuesIncludeQueryParameterItem", + "v2.seat_assignments_data_type" => "SeatAssignmentsDataType", + "v2.seat_user_data" => "SeatUserData", + "v2.seat_user_data_array" => "SeatUserDataArray", + "v2.seat_user_data_attributes" => "SeatUserDataAttributes", + "v2.seat_user_data_type" => "SeatUserDataType", + "v2.seat_user_meta" => "SeatUserMeta", "v2.secret_rule_array" => "SecretRuleArray", "v2.secret_rule_data" => "SecretRuleData", "v2.secret_rule_data_attributes" => "SecretRuleDataAttributes", @@ -5037,6 +5049,9 @@ def overrides "v2.uc_config_pair_data_attributes" => "UCConfigPairDataAttributes", "v2.uc_config_pair_data_attributes_configs_items" => "UCConfigPairDataAttributesConfigsItems", "v2.uc_config_pair_data_type" => "UCConfigPairDataType", + "v2.unassign_seats_user_request" => "UnassignSeatsUserRequest", + "v2.unassign_seats_user_request_data" => "UnassignSeatsUserRequestData", + "v2.unassign_seats_user_request_data_attributes" => "UnassignSeatsUserRequestDataAttributes", "v2.unit" => "Unit", "v2.unpublish_app_response" => "UnpublishAppResponse", "v2.update_action_connection_request" => "UpdateActionConnectionRequest", @@ -5361,6 +5376,7 @@ def overrides "v2.rum_replay_sessions_api" => "RumReplaySessionsAPI", "v2.rum_replay_viewership_api" => "RumReplayViewershipAPI", "v2.rum_retention_filters_api" => "RumRetentionFiltersAPI", + "v2.seats_api" => "SeatsAPI", "v2.security_monitoring_api" => "SecurityMonitoringAPI", "v2.sensitive_data_scanner_api" => "SensitiveDataScannerAPI", "v2.service_accounts_api" => "ServiceAccountsAPI", diff --git a/lib/datadog_api_client/v2/api/seats_api.rb b/lib/datadog_api_client/v2/api/seats_api.rb new file mode 100644 index 00000000000..313325075b3 --- /dev/null +++ b/lib/datadog_api_client/v2/api/seats_api.rb @@ -0,0 +1,230 @@ +=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 SeatsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Assign seats to users. + # + # @see #assign_seats_user_with_http_info + def assign_seats_user(body, opts = {}) + data, _status_code, _headers = assign_seats_user_with_http_info(body, opts) + data + end + + # Assign seats to users. + # + # Assign seats to users for a product code. + # + # @param body [AssignSeatsUserRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AssignSeatsUserResponse, Integer, Hash)>] AssignSeatsUserResponse data, response status code and response headers + def assign_seats_user_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.assign_seats_user ...' + 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 SeatsAPI.assign_seats_user" + end + # resource path + local_var_path = '/api/v2/seats/users' + + # 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] || 'AssignSeatsUserResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :assign_seats_user, + :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: SeatsAPI#assign_seats_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get users with seats. + # + # @see #get_seats_users_with_http_info + def get_seats_users(product_code, opts = {}) + data, _status_code, _headers = get_seats_users_with_http_info(product_code, opts) + data + end + + # Get users with seats. + # + # Get the list of users assigned seats for a product code. + # + # @param product_code [String] The product code for which to retrieve seat users. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_limit Maximum number of results to return. + # @option opts [String] :page_cursor Cursor for pagination. + # @return [Array<(SeatUserDataArray, Integer, Hash)>] SeatUserDataArray data, response status code and response headers + def get_seats_users_with_http_info(product_code, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.get_seats_users ...' + end + # verify the required parameter 'product_code' is set + if @api_client.config.client_side_validation && product_code.nil? + fail ArgumentError, "Missing the required parameter 'product_code' when calling SeatsAPI.get_seats_users" + end + # resource path + local_var_path = '/api/v2/seats/users' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'product_code'] = product_code + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].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] || 'SeatUserDataArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_seats_users, + :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: SeatsAPI#get_seats_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Unassign seats from users. + # + # @see #unassign_seats_user_with_http_info + def unassign_seats_user(body, opts = {}) + unassign_seats_user_with_http_info(body, opts) + nil + end + + # Unassign seats from users. + # + # Unassign seats from users for a product code. + # + # @param body [UnassignSeatsUserRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def unassign_seats_user_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.unassign_seats_user ...' + 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 SeatsAPI.unassign_seats_user" + end + # resource path + local_var_path = '/api/v2/seats/users' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :unassign_seats_user, + :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: SeatsAPI#unassign_seats_user\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/assign_seats_user_request.rb b/lib/datadog_api_client/v2/models/assign_seats_user_request.rb new file mode 100644 index 00000000000..f0d2e837ba5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class AssignSeatsUserRequest + include BaseGenericModel + + # + attr_accessor :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' => :'AssignSeatsUserRequestData' + } + 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::AssignSeatsUserRequest` 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 + + # 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/assign_seats_user_request_data.rb b/lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb new file mode 100644 index 00000000000..adfe64f0ed8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class AssignSeatsUserRequestData + include BaseGenericModel + + # + attr_reader :attributes + + # The ID of the assign seats user request. + attr_accessor :id + + # Seat assignments 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' => :'AssignSeatsUserRequestDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' + } + 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::AssignSeatsUserRequestData` 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 @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 && + 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/assign_seats_user_request_data_attributes.rb b/lib/datadog_api_client/v2/models/assign_seats_user_request_data_attributes.rb new file mode 100644 index 00000000000..c47d1520908 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request_data_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class AssignSeatsUserRequestDataAttributes + include BaseGenericModel + + # The product code for which to assign seats. + attr_reader :product_code + + # The list of user IDs to assign seats to. + attr_reader :user_uuids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'product_code' => :'product_code', + :'user_uuids' => :'user_uuids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'product_code' => :'String', + :'user_uuids' => :'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::AssignSeatsUserRequestDataAttributes` 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?(:'product_code') + self.product_code = attributes[:'product_code'] + end + + if attributes.key?(:'user_uuids') + if (value = attributes[:'user_uuids']).is_a?(Array) + self.user_uuids = 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 @product_code.nil? + return false if @user_uuids.nil? + true + end + + # Custom attribute writer method with validation + # @param product_code [Object] Object to be assigned + # @!visibility private + def product_code=(product_code) + if product_code.nil? + fail ArgumentError, 'invalid value for "product_code", product_code cannot be nil.' + end + @product_code = product_code + end + + # Custom attribute writer method with validation + # @param user_uuids [Object] Object to be assigned + # @!visibility private + def user_uuids=(user_uuids) + if user_uuids.nil? + fail ArgumentError, 'invalid value for "user_uuids", user_uuids cannot be nil.' + end + @user_uuids = user_uuids + 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 && + product_code == o.product_code && + user_uuids == o.user_uuids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [product_code, user_uuids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/assign_seats_user_response.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response.rb new file mode 100644 index 00000000000..48b25e0bfa7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class AssignSeatsUserResponse + include BaseGenericModel + + # + attr_accessor :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' => :'AssignSeatsUserResponseData' + } + 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::AssignSeatsUserResponse` 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 + + # 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/assign_seats_user_response_data.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb new file mode 100644 index 00000000000..1ef1a390e6b --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response_data.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 + # + class AssignSeatsUserResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # The ID of the assign seats user response. + attr_accessor :id + + # Seat assignments resource type. + attr_accessor :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' => :'AssignSeatsUserResponseDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' + } + 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::AssignSeatsUserResponseData` 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 + + # 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/assign_seats_user_response_data_attributes.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb new file mode 100644 index 00000000000..8149edb0673 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class AssignSeatsUserResponseDataAttributes + include BaseGenericModel + + # The list of user IDs to which the seats were assigned. + attr_accessor :assigned_ids + + # The product code for which the seats were assigned. + attr_accessor :product_code + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assigned_ids' => :'assigned_ids', + :'product_code' => :'product_code' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assigned_ids' => :'Array', + :'product_code' => :'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::AssignSeatsUserResponseDataAttributes` 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?(:'assigned_ids') + if (value = attributes[:'assigned_ids']).is_a?(Array) + self.assigned_ids = value + end + end + + if attributes.key?(:'product_code') + self.product_code = attributes[:'product_code'] + 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 && + assigned_ids == o.assigned_ids && + product_code == o.product_code && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assigned_ids, product_code, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/seat_assignments_data_type.rb b/lib/datadog_api_client/v2/models/seat_assignments_data_type.rb new file mode 100644 index 00000000000..0a760ca7eef --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_assignments_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Seat assignments resource type. + class SeatAssignmentsDataType + include BaseEnumModel + + SEAT_ASSIGNMENTS = "seat-assignments".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/seat_user_data.rb b/lib/datadog_api_client/v2/models/seat_user_data.rb new file mode 100644 index 00000000000..1921801562e --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_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 + # + class SeatUserData + include BaseGenericModel + + # + attr_accessor :attributes + + # The ID of the seat user. + attr_accessor :id + + # Seat users resource type. + attr_accessor :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' => :'SeatUserDataAttributes', + :'id' => :'String', + :'type' => :'SeatUserDataType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'id', + ]) + 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::SeatUserData` 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 + + # 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/seat_user_data_array.rb b/lib/datadog_api_client/v2/models/seat_user_data_array.rb new file mode 100644 index 00000000000..a3f8f09b37d --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data_array.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SeatUserDataArray + include BaseGenericModel + + # The list of seat users. + attr_accessor :data + + # + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SeatUserMeta' + } + 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::SeatUserDataArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/seat_user_data_attributes.rb b/lib/datadog_api_client/v2/models/seat_user_data_attributes.rb new file mode 100644 index 00000000000..46119d67eb7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SeatUserDataAttributes + include BaseGenericModel + + # The date and time the seat was assigned. + attr_accessor :assigned_at + + # The email of the user. + attr_accessor :email + + # The name of the user. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assigned_at' => :'assigned_at', + :'email' => :'email', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assigned_at' => :'Time', + :'email' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'assigned_at', + :'email', + :'name', + ]) + 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::SeatUserDataAttributes` 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?(:'assigned_at') + self.assigned_at = attributes[:'assigned_at'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assigned_at == o.assigned_at && + email == o.email && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assigned_at, email, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/seat_user_data_type.rb b/lib/datadog_api_client/v2/models/seat_user_data_type.rb new file mode 100644 index 00000000000..e6c068985e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Seat users resource type. + class SeatUserDataType + include BaseEnumModel + + SEAT_USERS = "seat-users".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/seat_user_meta.rb b/lib/datadog_api_client/v2/models/seat_user_meta.rb new file mode 100644 index 00000000000..9eeec9107b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_meta.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 + # + class SeatUserMeta + include BaseGenericModel + + # The cursor for the seat users. + attr_accessor :cursor + + # The limit for the seat users. + attr_accessor :limit + + # The next cursor for the seat users. + attr_accessor :next_cursor + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cursor' => :'cursor', + :'limit' => :'limit', + :'next_cursor' => :'next_cursor' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cursor' => :'String', + :'limit' => :'Integer', + :'next_cursor' => :'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::SeatUserMeta` 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?(:'cursor') + self.cursor = attributes[:'cursor'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'next_cursor') + self.next_cursor = attributes[:'next_cursor'] + 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 && + cursor == o.cursor && + limit == o.limit && + next_cursor == o.next_cursor && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cursor, limit, next_cursor, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/unassign_seats_user_request.rb b/lib/datadog_api_client/v2/models/unassign_seats_user_request.rb new file mode 100644 index 00000000000..bc76e45dff9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class UnassignSeatsUserRequest + include BaseGenericModel + + # + attr_accessor :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' => :'UnassignSeatsUserRequestData' + } + 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::UnassignSeatsUserRequest` 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 + + # 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/unassign_seats_user_request_data.rb b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb new file mode 100644 index 00000000000..9b294900d50 --- /dev/null +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class UnassignSeatsUserRequestData + include BaseGenericModel + + # + attr_reader :attributes + + # The ID of the unassign seats user request. + attr_accessor :id + + # Seat assignments 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' => :'UnassignSeatsUserRequestDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' + } + 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::UnassignSeatsUserRequestData` 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 @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 && + 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/unassign_seats_user_request_data_attributes.rb b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data_attributes.rb new file mode 100644 index 00000000000..989bfe9e8a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class UnassignSeatsUserRequestDataAttributes + include BaseGenericModel + + # The product code for which to unassign seats. + attr_reader :product_code + + # The list of user IDs to unassign seats from. + attr_reader :user_uuids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'product_code' => :'product_code', + :'user_uuids' => :'user_uuids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'product_code' => :'String', + :'user_uuids' => :'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::UnassignSeatsUserRequestDataAttributes` 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?(:'product_code') + self.product_code = attributes[:'product_code'] + end + + if attributes.key?(:'user_uuids') + if (value = attributes[:'user_uuids']).is_a?(Array) + self.user_uuids = 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 @product_code.nil? + return false if @user_uuids.nil? + true + end + + # Custom attribute writer method with validation + # @param product_code [Object] Object to be assigned + # @!visibility private + def product_code=(product_code) + if product_code.nil? + fail ArgumentError, 'invalid value for "product_code", product_code cannot be nil.' + end + @product_code = product_code + end + + # Custom attribute writer method with validation + # @param user_uuids [Object] Object to be assigned + # @!visibility private + def user_uuids=(user_uuids) + if user_uuids.nil? + fail ArgumentError, 'invalid value for "user_uuids", user_uuids cannot be nil.' + end + @user_uuids = user_uuids + 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 && + product_code == o.product_code && + user_uuids == o.user_uuids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [product_code, user_uuids, additional_properties].hash + end + end +end