From 8bb7b8a7a67b1a6105ba2cd18fa9e14ace15012e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 5 Feb 2026 16:37:59 +0000 Subject: [PATCH] Regenerate client from commit c0afef2 of spec repo --- .generator/schemas/v2/openapi.yaml | 226 +++++++++++++++++ examples/v2/seats/AssignSeatsUserV2.rb | 14 ++ examples/v2/seats/GetSeatsUsersV2.rb | 5 + examples/v2/seats/UnassignSeatsUserV2.rb | 14 ++ features/scenarios_model_mapping.rb | 11 + features/v2/seats.feature | 30 +++ 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 | 143 +++++++++++ ...sign_seats_user_request_data_attributes.rb | 117 +++++++++ .../v2/models/assign_seats_user_response.rb | 105 ++++++++ .../models/assign_seats_user_response_data.rb | 143 +++++++++++ ...ign_seats_user_response_data_attributes.rb | 117 +++++++++ .../v2/models/seat_assignments_data_type.rb | 26 ++ .../v2/models/seat_user_data.rb | 143 +++++++++++ .../v2/models/seat_user_data_array.rb | 135 ++++++++++ .../v2/models/seat_user_data_attributes.rb | 125 ++++++++++ .../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 | 143 +++++++++++ ...sign_seats_user_request_data_attributes.rb | 117 +++++++++ 24 files changed, 2246 insertions(+) create mode 100644 examples/v2/seats/AssignSeatsUserV2.rb create mode 100644 examples/v2/seats/GetSeatsUsersV2.rb create mode 100644 examples/v2/seats/UnassignSeatsUserV2.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 95f5775c6b9..6ad49e7f0f3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5362,6 +5362,56 @@ components: example: _latest type: string type: object + AssignSeatsUserRequest: + properties: + data: + $ref: '#/components/schemas/AssignSeatsUserRequestData' + type: object + AssignSeatsUserRequestData: + properties: + attributes: + $ref: '#/components/schemas/AssignSeatsUserRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + required: + - type + type: object + AssignSeatsUserRequestDataAttributes: + properties: + product_code: + type: string + user_uuids: + items: + type: string + type: array + type: object + AssignSeatsUserResponse: + properties: + data: + $ref: '#/components/schemas/AssignSeatsUserResponseData' + type: object + AssignSeatsUserResponseData: + properties: + attributes: + $ref: '#/components/schemas/AssignSeatsUserResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + required: + - type + type: object + AssignSeatsUserResponseDataAttributes: + properties: + assigned_ids: + items: + type: string + type: array + product_code: + type: string + type: object AttachCaseRequest: description: Request for attaching security findings to a case. properties: @@ -51879,6 +51929,65 @@ 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' + id: + type: string + type: + $ref: '#/components/schemas/SeatUserDataType' + required: + - type + type: object + SeatUserDataArray: + properties: + data: + items: + $ref: '#/components/schemas/SeatUserData' + type: array + meta: + $ref: '#/components/schemas/SeatUserMeta' + required: + - data + type: object + SeatUserDataAttributes: + properties: + assigned_at: + type: string + email: + type: string + name: + 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: + type: string + limit: + format: int64 + type: integer + next_cursor: + type: string + type: object SecretRuleArray: properties: data: @@ -63944,6 +64053,31 @@ components: type: string x-enum-varnames: - AZURE_UC_CONFIGS + UnassignSeatsUserRequest: + properties: + data: + $ref: '#/components/schemas/UnassignSeatsUserRequestData' + type: object + UnassignSeatsUserRequestData: + properties: + attributes: + $ref: '#/components/schemas/UnassignSeatsUserRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SeatAssignmentsDataType' + required: + - type + type: object + UnassignSeatsUserRequestDataAttributes: + properties: + product_code: + type: string + user_uuids: + items: + type: string + type: array + type: object Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -91707,6 +91841,95 @@ 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: UnassignSeatsUserV2 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnassignSeatsUserRequest' + required: true + responses: + '204': + description: No Content + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Unassign seats from users for a product code + tags: + - Seats + x-permission: + operator: OR + permissions: + - billing_edit + - incident_write + - on_call_write + get: + description: Get the list of seats users assigned to a product code. + operationId: GetSeatsUsersV2 + 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] + schema: + type: integer + - description: Cursor for pagination. + in: query + name: page[cursor] + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SeatUserDataArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get seats users for a product code + 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: AssignSeatsUserV2 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignSeatsUserRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AssignSeatsUserResponse' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Assign seats to users for a product code + 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 @@ -102815,6 +103038,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/examples/v2/seats/AssignSeatsUserV2.rb b/examples/v2/seats/AssignSeatsUserV2.rb new file mode 100644 index 00000000000..692c36fe56e --- /dev/null +++ b/examples/v2/seats/AssignSeatsUserV2.rb @@ -0,0 +1,14 @@ +# Assign seats to users for a product code returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new + +body = DatadogAPIClient::V2::AssignSeatsUserRequest.new({ + data: DatadogAPIClient::V2::AssignSeatsUserRequestData.new({ + attributes: DatadogAPIClient::V2::AssignSeatsUserRequestDataAttributes.new({ + user_uuids: [], + }), + type: DatadogAPIClient::V2::SeatAssignmentsDataType::SEAT_ASSIGNMENTS, + }), +}) +p api_instance.assign_seats_user_v2(body) diff --git a/examples/v2/seats/GetSeatsUsersV2.rb b/examples/v2/seats/GetSeatsUsersV2.rb new file mode 100644 index 00000000000..2488434b9a7 --- /dev/null +++ b/examples/v2/seats/GetSeatsUsersV2.rb @@ -0,0 +1,5 @@ +# Get seats users for a product code returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new +p api_instance.get_seats_users_v2("product_code") diff --git a/examples/v2/seats/UnassignSeatsUserV2.rb b/examples/v2/seats/UnassignSeatsUserV2.rb new file mode 100644 index 00000000000..3af294162b9 --- /dev/null +++ b/examples/v2/seats/UnassignSeatsUserV2.rb @@ -0,0 +1,14 @@ +# Unassign seats from users for a product code returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SeatsAPI.new + +body = DatadogAPIClient::V2::UnassignSeatsUserRequest.new({ + data: DatadogAPIClient::V2::UnassignSeatsUserRequestData.new({ + attributes: DatadogAPIClient::V2::UnassignSeatsUserRequestDataAttributes.new({ + user_uuids: [], + }), + type: DatadogAPIClient::V2::SeatAssignmentsDataType::SEAT_ASSIGNMENTS, + }), +}) +api_instance.unassign_seats_user_v2(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f9f955f3192..1067d0c42ec 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3335,6 +3335,17 @@ "rule_id" => "String", "body" => "UpdateRuleRequest", }, + "v2.UnassignSeatsUserV2" => { + "body" => "UnassignSeatsUserRequest", + }, + "v2.GetSeatsUsersV2" => { + "product_code" => "String", + "page_limit" => "Integer", + "page_cursor" => "String", + }, + "v2.AssignSeatsUserV2" => { + "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..4f45a170444 --- /dev/null +++ b/features/v2/seats.feature @@ -0,0 +1,30 @@ +@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 for a product code returns "Created" response + Given new "AssignSeatsUserV2" request + And body with value {"data": {"attributes": {"user_uuids": []}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/billing-experience + Scenario: Get seats users for a product code returns "OK" response + Given new "GetSeatsUsersV2" request + And request contains "product_code" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/billing-experience + Scenario: Unassign seats from users for a product code returns "No Content" response + Given new "UnassignSeatsUserV2" request + And body with value {"data": {"attributes": {"user_uuids": []}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 204 No Content diff --git a/features/v2/undo.json b/features/v2/undo.json index 7e549784ee6..821ea95bcf7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4187,6 +4187,31 @@ "type": "idempotent" } }, + "UnassignSeatsUserV2": { + "tag": "Seats", + "undo": { + "type": "idempotent" + } + }, + "GetSeatsUsersV2": { + "tag": "Seats", + "undo": { + "type": "safe" + } + }, + "AssignSeatsUserV2": { + "tag": "Seats", + "undo": { + "operationId": "UnassignSeatsUserV2", + "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 8bcf2052b62..fff805d1b70 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1156,6 +1156,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", @@ -4232,6 +4238,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", @@ -4978,6 +4990,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", @@ -5302,6 +5317,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..ba0687357ab --- /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 for a product code. + # + # @see #assign_seats_user_v2_with_http_info + def assign_seats_user_v2(body, opts = {}) + data, _status_code, _headers = assign_seats_user_v2_with_http_info(body, opts) + data + end + + # Assign seats to users for a product code. + # + # 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_v2_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.assign_seats_user_v2 ...' + 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_v2" + 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_v2, + :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_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get seats users for a product code. + # + # @see #get_seats_users_v2_with_http_info + def get_seats_users_v2(product_code, opts = {}) + data, _status_code, _headers = get_seats_users_v2_with_http_info(product_code, opts) + data + end + + # Get seats users for a product code. + # + # Get the list of seats users assigned to 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_v2_with_http_info(product_code, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.get_seats_users_v2 ...' + 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_v2" + 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_v2, + :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_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Unassign seats from users for a product code. + # + # @see #unassign_seats_user_v2_with_http_info + def unassign_seats_user_v2(body, opts = {}) + unassign_seats_user_v2_with_http_info(body, opts) + nil + end + + # Unassign seats from users for a product code. + # + # 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_v2_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SeatsAPI.unassign_seats_user_v2 ...' + 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_v2" + 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_v2, + :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_v2\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..0368a7fdcd7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb @@ -0,0 +1,143 @@ +=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_accessor :attributes + + # + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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..8ddf1b29e3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request_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 AssignSeatsUserRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :product_code + + # + attr_accessor :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 + + # 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..4d6135d38c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb @@ -0,0 +1,143 @@ +=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 + + # + 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' => :'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 + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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..3a768e0044c --- /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 + + # + attr_accessor :assigned_ids + + # + 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..51750f5fbef --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data.rb @@ -0,0 +1,143 @@ +=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 + + # + attr_accessor :id + + # Seat users 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' => :'SeatUserDataAttributes', + :'id' => :'String', + :'type' => :'SeatUserDataType' + } + 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 + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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..d65806485eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data_array.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 SeatUserDataArray + include BaseGenericModel + + # + attr_reader :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 + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + 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..c45f64bedf1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/seat_user_data_attributes.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 SeatUserDataAttributes + include BaseGenericModel + + # + attr_accessor :assigned_at + + # + attr_accessor :email + + # + 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' => :'String', + :'email' => :'String', + :'name' => :'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::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..3f192719c6b --- /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 + + # + attr_accessor :cursor + + # + attr_accessor :limit + + # + 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..a77bcce115e --- /dev/null +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb @@ -0,0 +1,143 @@ +=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_accessor :attributes + + # + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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..4117a338df4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request_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 UnassignSeatsUserRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :product_code + + # + attr_accessor :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 + + # 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