diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 181237b18fc..83cabe9a915 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5362,6 +5362,73 @@ 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 + 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' + required: + - type + 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: @@ -29490,27 +29557,6 @@ components: x-enum-varnames: - USERS - ATTACHMENTS - IncidentRelationshipData: - description: Incident relationship data - properties: - id: - description: Incident identifier - example: 00000000-0000-0000-0000-000000000000 - type: string - type: - $ref: '#/components/schemas/IncidentResourceType' - required: - - type - - id - type: object - IncidentResourceType: - description: Incident resource type - enum: - - incidents - example: incidents - type: string - x-enum-varnames: - - INCIDENTS IncidentRespondersType: description: The incident responders type. enum: @@ -32410,87 +32456,6 @@ components: $ref: '#/components/schemas/Case3rdPartyTicketStatus' readOnly: true type: object - JiraIssueCreateAttributes: - description: Jira issue creation attributes - properties: - fields: - additionalProperties: {} - description: Additional Jira fields - example: {} - type: object - issue_type_id: - description: Jira issue type ID - example: '10001' - type: string - jira_account_id: - description: Jira account ID - example: '1234' - type: string - project_id: - description: Jira project ID - example: '5678' - type: string - required: - - jira_account_id - - project_id - - issue_type_id - type: object - JiraIssueCreateData: - description: Jira issue creation data - properties: - attributes: - $ref: '#/components/schemas/JiraIssueCreateAttributes' - type: - $ref: '#/components/schemas/JiraIssueResourceType' - required: - - type - - attributes - type: object - JiraIssueCreateRequest: - description: Jira issue creation request - properties: - data: - $ref: '#/components/schemas/JiraIssueCreateData' - required: - - data - type: object - JiraIssueLinkAttributes: - description: Jira issue link attributes - properties: - jira_issue_url: - description: URL of the Jira issue - example: https://jira.example.com/browse/PROJ-123 - type: string - required: - - jira_issue_url - type: object - JiraIssueLinkData: - description: Jira issue link data - properties: - attributes: - $ref: '#/components/schemas/JiraIssueLinkAttributes' - type: - $ref: '#/components/schemas/JiraIssueResourceType' - required: - - type - - attributes - type: object - JiraIssueLinkRequest: - description: Jira issue link request - properties: - data: - $ref: '#/components/schemas/JiraIssueLinkData' - required: - - data - type: object - JiraIssueResourceType: - description: Jira issue resource type - enum: - - issues - example: issues - type: string - x-enum-varnames: - - ISSUES JiraIssueResult: description: Jira issue information properties: @@ -37920,30 +37885,6 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object - NotebookCreateData: - description: Notebook creation data - properties: - type: - $ref: '#/components/schemas/NotebookResourceType' - required: - - type - type: object - NotebookCreateRequest: - description: Notebook creation request - properties: - data: - $ref: '#/components/schemas/NotebookCreateData' - required: - - data - type: object - NotebookResourceType: - description: Notebook resource type - enum: - - notebook - example: notebook - type: string - x-enum-varnames: - - NOTEBOOK NotebookTriggerWrapper: description: Schema for a Notebook-based trigger. properties: @@ -48006,14 +47947,6 @@ components: - id - type type: object - RelationshipToIncidentRequest: - description: Relationship to incident request - properties: - data: - $ref: '#/components/schemas/IncidentRelationshipData' - required: - - data - type: object RelationshipToIncidentResponderData: description: Relationship to impact object. properties: @@ -52255,6 +52188,76 @@ 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. + type: string + type: + $ref: '#/components/schemas/SeatUserDataType' + required: + - type + 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. + required: + - data + type: object + SeatUserDataAttributes: + properties: + assigned_at: + description: The date and time the seat was assigned. + format: date-time + type: string + email: + description: The email of the user. + type: string + name: + description: The name of the user. + 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: @@ -58222,47 +58225,6 @@ components: $ref: '#/components/schemas/Case3rdPartyTicketStatus' readOnly: true type: object - ServiceNowTicketCreateAttributes: - description: ServiceNow ticket creation attributes - properties: - assignment_group: - description: ServiceNow assignment group - example: IT Support - type: string - instance_name: - description: ServiceNow instance name - example: my-instance - type: string - required: - - instance_name - type: object - ServiceNowTicketCreateData: - description: ServiceNow ticket creation data - properties: - attributes: - $ref: '#/components/schemas/ServiceNowTicketCreateAttributes' - type: - $ref: '#/components/schemas/ServiceNowTicketResourceType' - required: - - type - - attributes - type: object - ServiceNowTicketCreateRequest: - description: ServiceNow ticket creation request - properties: - data: - $ref: '#/components/schemas/ServiceNowTicketCreateData' - required: - - data - type: object - ServiceNowTicketResourceType: - description: ServiceNow ticket resource type - enum: - - tickets - example: tickets - type: string - x-enum-varnames: - - TICKETS ServiceNowTicketResult: description: ServiceNow ticket information properties: @@ -64399,6 +64361,43 @@ 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 + 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. @@ -72717,382 +72716,6 @@ paths: summary: Update case priority tags: - Case Management - /api/v2/cases/{case_id}/relationships/incidents: - post: - description: Link an incident to a case - operationId: LinkIncident - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RelationshipToIncidentRequest' - description: Incident link request - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CaseResponse' - description: Created - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Link incident to case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/cases/{case_id}/relationships/jira_issues: - delete: - description: Remove the link between a Jira issue and a case - operationId: UnlinkJiraIssue - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Remove Jira issue link from case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - patch: - description: Link an existing Jira issue to a case - operationId: LinkJiraIssueToCase - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JiraIssueLinkRequest' - description: Jira issue link request - required: true - responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '409': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Conflict - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Link existing Jira issue to case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - post: - description: Create a new Jira issue and link it to a case - operationId: CreateCaseJiraIssue - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JiraIssueCreateRequest' - description: Jira issue creation request - required: true - responses: - '202': - description: Accepted - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Create Jira issue for case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/cases/{case_id}/relationships/notebook: - post: - description: Create a new investigation notebook and link it to a case - operationId: CreateCaseNotebook - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NotebookCreateRequest' - description: Notebook creation request - required: true - responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Create investigation notebook for case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/cases/{case_id}/relationships/project: - patch: - description: Update the project associated with a case - operationId: MoveCaseToProject - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectRelationship' - description: Project update request - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CaseResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Update case project - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' - /api/v2/cases/{case_id}/relationships/servicenow_tickets: - post: - description: Create a new ServiceNow incident ticket and link it to a case - operationId: CreateCaseServiceNowTicket - parameters: - - $ref: '#/components/parameters/CaseIDPathParameter' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceNowTicketCreateRequest' - description: ServiceNow ticket creation request - required: true - responses: - '202': - description: Accepted - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad Request - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not Found - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cases_write - summary: Create ServiceNow ticket for case - tags: - - Case Management - x-unstable: '**Note**: This endpoint is in preview and is subject to change. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/cases/{case_id}/status: post: description: Update case status @@ -92716,6 +92339,113 @@ 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 + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + description: Internal Server Error + 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 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 + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + description: Internal Server Error + summary: Get seats users + 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 + '400': + $ref: '#/components/responses/BadRequestResponse' + '422': + description: Unprocessable Entity + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + description: Internal Server Error + 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 @@ -103849,6 +103579,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/case-management/CreateCaseJiraIssue.rb b/examples/v2/case-management/CreateCaseJiraIssue.rb deleted file mode 100644 index 3b4306bd32c..00000000000 --- a/examples/v2/case-management/CreateCaseJiraIssue.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Create Jira issue for case returns "Accepted" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_case_jira_issue".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::JiraIssueCreateRequest.new({ - data: DatadogAPIClient::V2::JiraIssueCreateData.new({ - attributes: DatadogAPIClient::V2::JiraIssueCreateAttributes.new({ - fields: {}, - issue_type_id: "10001", - jira_account_id: "1234", - project_id: "5678", - }), - type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES, - }), -}) -p api_instance.create_case_jira_issue("case_id", body) diff --git a/examples/v2/case-management/CreateCaseNotebook.rb b/examples/v2/case-management/CreateCaseNotebook.rb deleted file mode 100644 index a67377a3cdd..00000000000 --- a/examples/v2/case-management/CreateCaseNotebook.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Create investigation notebook for case returns "No Content" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_case_notebook".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::NotebookCreateRequest.new({ - data: DatadogAPIClient::V2::NotebookCreateData.new({ - type: DatadogAPIClient::V2::NotebookResourceType::NOTEBOOK, - }), -}) -api_instance.create_case_notebook("case_id", body) diff --git a/examples/v2/case-management/CreateCaseServiceNowTicket.rb b/examples/v2/case-management/CreateCaseServiceNowTicket.rb deleted file mode 100644 index fa81c88259e..00000000000 --- a/examples/v2/case-management/CreateCaseServiceNowTicket.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Create ServiceNow ticket for case returns "Accepted" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_case_service_now_ticket".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::ServiceNowTicketCreateRequest.new({ - data: DatadogAPIClient::V2::ServiceNowTicketCreateData.new({ - attributes: DatadogAPIClient::V2::ServiceNowTicketCreateAttributes.new({ - assignment_group: "IT Support", - instance_name: "my-instance", - }), - type: DatadogAPIClient::V2::ServiceNowTicketResourceType::TICKETS, - }), -}) -p api_instance.create_case_service_now_ticket("case_id", body) diff --git a/examples/v2/case-management/LinkIncident.rb b/examples/v2/case-management/LinkIncident.rb deleted file mode 100644 index 2a913c1c4c7..00000000000 --- a/examples/v2/case-management/LinkIncident.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Link incident to case returns "Created" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.link_incident".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::RelationshipToIncidentRequest.new({ - data: DatadogAPIClient::V2::IncidentRelationshipData.new({ - id: "00000000-0000-0000-0000-000000000000", - type: DatadogAPIClient::V2::IncidentResourceType::INCIDENTS, - }), -}) -p api_instance.link_incident("case_id", body) diff --git a/examples/v2/case-management/LinkJiraIssueToCase.rb b/examples/v2/case-management/LinkJiraIssueToCase.rb deleted file mode 100644 index ca4a9bc6681..00000000000 --- a/examples/v2/case-management/LinkJiraIssueToCase.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Link existing Jira issue to case returns "No Content" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.link_jira_issue_to_case".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::JiraIssueLinkRequest.new({ - data: DatadogAPIClient::V2::JiraIssueLinkData.new({ - attributes: DatadogAPIClient::V2::JiraIssueLinkAttributes.new({ - jira_issue_url: "https://jira.example.com/browse/PROJ-123", - }), - type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES, - }), -}) -api_instance.link_jira_issue_to_case("case_id", body) diff --git a/examples/v2/case-management/MoveCaseToProject.rb b/examples/v2/case-management/MoveCaseToProject.rb deleted file mode 100644 index 49aac1beb82..00000000000 --- a/examples/v2/case-management/MoveCaseToProject.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Update case project returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.move_case_to_project".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new - -body = DatadogAPIClient::V2::ProjectRelationship.new({ - data: DatadogAPIClient::V2::ProjectRelationshipData.new({ - id: "e555e290-ed65-49bd-ae18-8acbfcf18db7", - type: DatadogAPIClient::V2::ProjectResourceType::PROJECT, - }), -}) -p api_instance.move_case_to_project("case_id", body) diff --git a/examples/v2/case-management/UnlinkJiraIssue.rb b/examples/v2/case-management/UnlinkJiraIssue.rb deleted file mode 100644 index 61747969372..00000000000 --- a/examples/v2/case-management/UnlinkJiraIssue.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Remove Jira issue link from case returns "No Content" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.unlink_jira_issue".to_sym] = true -end -api_instance = DatadogAPIClient::V2::CaseManagementAPI.new -api_instance.unlink_jira_issue("case_id") diff --git a/examples/v2/seats/AssignSeatsUserV2.rb b/examples/v2/seats/AssignSeatsUserV2.rb new file mode 100644 index 00000000000..f604c5cdb2e --- /dev/null +++ b/examples/v2/seats/AssignSeatsUserV2.rb @@ -0,0 +1,17 @@ +# Assign seats to users 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({ + product_code: "", + 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..a52d1df940e --- /dev/null +++ b/examples/v2/seats/GetSeatsUsersV2.rb @@ -0,0 +1,5 @@ +# Get seats users 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..a1869c70fc2 --- /dev/null +++ b/examples/v2/seats/UnassignSeatsUserV2.rb @@ -0,0 +1,17 @@ +# Unassign seats from users 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({ + product_code: "", + 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 47cf73e3045..3217a280039 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1254,33 +1254,6 @@ "case_id" => "String", "body" => "CaseUpdatePriorityRequest", }, - "v2.LinkIncident" => { - "case_id" => "String", - "body" => "RelationshipToIncidentRequest", - }, - "v2.UnlinkJiraIssue" => { - "case_id" => "String", - }, - "v2.LinkJiraIssueToCase" => { - "case_id" => "String", - "body" => "JiraIssueLinkRequest", - }, - "v2.CreateCaseJiraIssue" => { - "case_id" => "String", - "body" => "JiraIssueCreateRequest", - }, - "v2.CreateCaseNotebook" => { - "case_id" => "String", - "body" => "NotebookCreateRequest", - }, - "v2.MoveCaseToProject" => { - "case_id" => "String", - "body" => "ProjectRelationship", - }, - "v2.CreateCaseServiceNowTicket" => { - "case_id" => "String", - "body" => "ServiceNowTicketCreateRequest", - }, "v2.UpdateStatus" => { "case_id" => "String", "body" => "CaseUpdateStatusRequest", @@ -3375,6 +3348,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/case_management.feature b/features/v2/case_management.feature index 56d8f9ed68e..7e26a5815f2 100644 --- a/features/v2/case_management.feature +++ b/features/v2/case_management.feature @@ -90,60 +90,6 @@ Feature: Case Management When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/case-management - Scenario: Create Jira issue for case returns "Accepted" response - Given operation "CreateCaseJiraIssue" enabled - And new "CreateCaseJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} - When the request is sent - Then the response status is 202 Accepted - - @generated @skip @team:DataDog/case-management - Scenario: Create Jira issue for case returns "Bad Request" response - Given operation "CreateCaseJiraIssue" enabled - And new "CreateCaseJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Create Jira issue for case returns "Not Found" response - Given operation "CreateCaseJiraIssue" enabled - And new "CreateCaseJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/case-management - Scenario: Create ServiceNow ticket for case returns "Accepted" response - Given operation "CreateCaseServiceNowTicket" enabled - And new "CreateCaseServiceNowTicket" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} - When the request is sent - Then the response status is 202 Accepted - - @generated @skip @team:DataDog/case-management - Scenario: Create ServiceNow ticket for case returns "Bad Request" response - Given operation "CreateCaseServiceNowTicket" enabled - And new "CreateCaseServiceNowTicket" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Create ServiceNow ticket for case returns "Not Found" response - Given operation "CreateCaseServiceNowTicket" enabled - And new "CreateCaseServiceNowTicket" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}} - When the request is sent - Then the response status is 404 Not Found - @team:DataDog/case-management Scenario: Create a case returns "Bad Request" response Given new "CreateCase" request @@ -215,33 +161,6 @@ Feature: Case Management When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/case-management - Scenario: Create investigation notebook for case returns "Bad Request" response - Given operation "CreateCaseNotebook" enabled - And new "CreateCaseNotebook" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"type": "notebook"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Create investigation notebook for case returns "No Content" response - Given operation "CreateCaseNotebook" enabled - And new "CreateCaseNotebook" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"type": "notebook"}} - When the request is sent - Then the response status is 204 No Content - - @generated @skip @team:DataDog/case-management - Scenario: Create investigation notebook for case returns "Not Found" response - Given operation "CreateCaseNotebook" enabled - And new "CreateCaseNotebook" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"type": "notebook"}} - When the request is sent - Then the response status is 404 Not Found - @generated @skip @team:DataDog/case-management Scenario: Delete a notification rule returns "API error response" response Given new "DeleteProjectNotificationRule" request @@ -389,93 +308,6 @@ Feature: Case Management When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/case-management - Scenario: Link existing Jira issue to case returns "Bad Request" response - Given operation "LinkJiraIssueToCase" enabled - And new "LinkJiraIssueToCase" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Link existing Jira issue to case returns "Conflict" response - Given operation "LinkJiraIssueToCase" enabled - And new "LinkJiraIssueToCase" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} - When the request is sent - Then the response status is 409 Conflict - - @generated @skip @team:DataDog/case-management - Scenario: Link existing Jira issue to case returns "No Content" response - Given operation "LinkJiraIssueToCase" enabled - And new "LinkJiraIssueToCase" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} - When the request is sent - Then the response status is 204 No Content - - @generated @skip @team:DataDog/case-management - Scenario: Link existing Jira issue to case returns "Not Found" response - Given operation "LinkJiraIssueToCase" enabled - And new "LinkJiraIssueToCase" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/case-management - Scenario: Link incident to case returns "Bad Request" response - Given operation "LinkIncident" enabled - And new "LinkIncident" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Link incident to case returns "Created" response - Given operation "LinkIncident" enabled - And new "LinkIncident" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} - When the request is sent - Then the response status is 201 Created - - @generated @skip @team:DataDog/case-management - Scenario: Link incident to case returns "Not Found" response - Given operation "LinkIncident" enabled - And new "LinkIncident" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/case-management - Scenario: Remove Jira issue link from case returns "Bad Request" response - Given operation "UnlinkJiraIssue" enabled - And new "UnlinkJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Remove Jira issue link from case returns "No Content" response - Given operation "UnlinkJiraIssue" enabled - And new "UnlinkJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 204 No Content - - @generated @skip @team:DataDog/case-management - Scenario: Remove Jira issue link from case returns "Not Found" response - Given operation "UnlinkJiraIssue" enabled - And new "UnlinkJiraIssue" request - And request contains "case_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - @generated @skip @team:DataDog/case-management Scenario: Remove a project returns "API error response" response Given new "DeleteProject" request @@ -732,33 +564,6 @@ Feature: Case Management Then the response status is 200 OK And the response "data.attributes.priority" is equal to "P3" - @generated @skip @team:DataDog/case-management - Scenario: Update case project returns "Bad Request" response - Given operation "MoveCaseToProject" enabled - And new "MoveCaseToProject" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/case-management - Scenario: Update case project returns "Not Found" response - Given operation "MoveCaseToProject" enabled - And new "MoveCaseToProject" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/case-management - Scenario: Update case project returns "OK" response - Given operation "MoveCaseToProject" enabled - And new "MoveCaseToProject" request - And request contains "case_id" parameter from "REPLACE.ME" - And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}} - When the request is sent - Then the response status is 200 OK - @team:DataDog/case-management Scenario: Update case status returns "Bad Request" response Given new "UpdateStatus" request diff --git a/features/v2/seats.feature b/features/v2/seats.feature new file mode 100644 index 00000000000..e3a5205c3cc --- /dev/null +++ b/features/v2/seats.feature @@ -0,0 +1,72 @@ +@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 "AssignSeatsUserV2" 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 + + @generated @skip @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Created" response + Given new "AssignSeatsUserV2" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/billing-experience + Scenario: Assign seats to users returns "Unprocessable Entity" response + Given new "AssignSeatsUserV2" 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 + + @generated @skip @team:DataDog/billing-experience + Scenario: Get seats users returns "Bad Request" response + Given new "GetSeatsUsersV2" request + And request contains "product_code" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/billing-experience + Scenario: Get seats users 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: Get seats users returns "Unprocessable Entity" response + Given new "GetSeatsUsersV2" 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 "UnassignSeatsUserV2" 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 + + @generated @skip @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "No Content" response + Given new "UnassignSeatsUserV2" request + And body with value {"data": {"attributes": {"product_code": "", "user_uuids": [""]}, "type": "seat-assignments"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/billing-experience + Scenario: Unassign seats from users returns "Unprocessable Entity" response + Given new "UnassignSeatsUserV2" 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 diff --git a/features/v2/undo.json b/features/v2/undo.json index 5727d36b956..5f24936509b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -836,56 +836,6 @@ "type": "idempotent" } }, - "LinkIncident": { - "tag": "Case Management", - "undo": { - "operationId": "TODO", - "parameters": [], - "type": "unsafe" - } - }, - "UnlinkJiraIssue": { - "tag": "Case Management", - "undo": { - "type": "idempotent" - } - }, - "LinkJiraIssueToCase": { - "tag": "Case Management", - "undo": { - "type": "idempotent" - } - }, - "CreateCaseJiraIssue": { - "tag": "Case Management", - "undo": { - "operationId": "TODO", - "parameters": [], - "type": "unsafe" - } - }, - "CreateCaseNotebook": { - "tag": "Case Management", - "undo": { - "operationId": "TODO", - "parameters": [], - "type": "unsafe" - } - }, - "MoveCaseToProject": { - "tag": "Case Management", - "undo": { - "type": "idempotent" - } - }, - "CreateCaseServiceNowTicket": { - "tag": "Case Management", - "undo": { - "operationId": "TODO", - "parameters": [], - "type": "unsafe" - } - }, "UpdateStatus": { "tag": "Case Management", "undo": { @@ -4274,6 +4224,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/configuration.rb b/lib/datadog_api_client/configuration.rb index c974274efe3..f51747c826e 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,13 +208,6 @@ def initialize "v2.get_open_api": false, "v2.list_apis": false, "v2.update_open_api": false, - "v2.create_case_jira_issue": false, - "v2.create_case_notebook": false, - "v2.create_case_service_now_ticket": false, - "v2.link_incident": false, - "v2.link_jira_issue_to_case": false, - "v2.move_case_to_project": false, - "v2.unlink_jira_issue": false, "v2.activate_content_pack": false, "v2.cancel_threat_hunting_job": false, "v2.convert_job_result_to_signal": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e1befc56a6f..287d695c792 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", @@ -2751,8 +2757,6 @@ def overrides "v2.incident_notification_template_update_data" => "IncidentNotificationTemplateUpdateData", "v2.incident_postmortem_type" => "IncidentPostmortemType", "v2.incident_related_object" => "IncidentRelatedObject", - "v2.incident_relationship_data" => "IncidentRelationshipData", - "v2.incident_resource_type" => "IncidentResourceType", "v2.incident_responders_type" => "IncidentRespondersType", "v2.incident_response" => "IncidentResponse", "v2.incident_response_attributes" => "IncidentResponseAttributes", @@ -2943,13 +2947,6 @@ def overrides "v2.jira_integration_metadata" => "JiraIntegrationMetadata", "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", - "v2.jira_issue_create_attributes" => "JiraIssueCreateAttributes", - "v2.jira_issue_create_data" => "JiraIssueCreateData", - "v2.jira_issue_create_request" => "JiraIssueCreateRequest", - "v2.jira_issue_link_attributes" => "JiraIssueLinkAttributes", - "v2.jira_issue_link_data" => "JiraIssueLinkData", - "v2.jira_issue_link_request" => "JiraIssueLinkRequest", - "v2.jira_issue_resource_type" => "JiraIssueResourceType", "v2.jira_issue_result" => "JiraIssueResult", "v2.jira_issues_data_type" => "JiraIssuesDataType", "v2.jira_issue_template_create_request" => "JiraIssueTemplateCreateRequest", @@ -3323,9 +3320,6 @@ def overrides "v2.monthly_cost_attribution_response" => "MonthlyCostAttributionResponse", "v2.ms_teams_integration_metadata" => "MSTeamsIntegrationMetadata", "v2.ms_teams_integration_metadata_teams_item" => "MSTeamsIntegrationMetadataTeamsItem", - "v2.notebook_create_data" => "NotebookCreateData", - "v2.notebook_create_request" => "NotebookCreateRequest", - "v2.notebook_resource_type" => "NotebookResourceType", "v2.notebook_trigger_wrapper" => "NotebookTriggerWrapper", "v2.notification_channel" => "NotificationChannel", "v2.notification_channel_attributes" => "NotificationChannelAttributes", @@ -3911,7 +3905,6 @@ def overrides "v2.relationship_to_incident_notification_template_data" => "RelationshipToIncidentNotificationTemplateData", "v2.relationship_to_incident_postmortem" => "RelationshipToIncidentPostmortem", "v2.relationship_to_incident_postmortem_data" => "RelationshipToIncidentPostmortemData", - "v2.relationship_to_incident_request" => "RelationshipToIncidentRequest", "v2.relationship_to_incident_responder_data" => "RelationshipToIncidentResponderData", "v2.relationship_to_incident_responders" => "RelationshipToIncidentResponders", "v2.relationship_to_incident_type" => "RelationshipToIncidentType", @@ -4261,6 +4254,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", @@ -4598,10 +4597,6 @@ def overrides "v2.service_now_template_update_request_attributes" => "ServiceNowTemplateUpdateRequestAttributes", "v2.service_now_template_update_request_data" => "ServiceNowTemplateUpdateRequestData", "v2.service_now_ticket" => "ServiceNowTicket", - "v2.service_now_ticket_create_attributes" => "ServiceNowTicketCreateAttributes", - "v2.service_now_ticket_create_data" => "ServiceNowTicketCreateData", - "v2.service_now_ticket_create_request" => "ServiceNowTicketCreateRequest", - "v2.service_now_ticket_resource_type" => "ServiceNowTicketResourceType", "v2.service_now_ticket_result" => "ServiceNowTicketResult", "v2.service_now_user_attributes" => "ServiceNowUserAttributes", "v2.service_now_user_data" => "ServiceNowUserData", @@ -5012,6 +5007,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", @@ -5336,6 +5334,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/case_management_api.rb b/lib/datadog_api_client/v2/api/case_management_api.rb index 75e50c631fc..b361840d177 100644 --- a/lib/datadog_api_client/v2/api/case_management_api.rb +++ b/lib/datadog_api_client/v2/api/case_management_api.rb @@ -306,240 +306,6 @@ def create_case_with_http_info(body, opts = {}) return data, status_code, headers end - # Create Jira issue for case. - # - # @see #create_case_jira_issue_with_http_info - def create_case_jira_issue(case_id, body, opts = {}) - create_case_jira_issue_with_http_info(case_id, body, opts) - nil - end - - # Create Jira issue for case. - # - # Create a new Jira issue and link it to a case - # - # @param case_id [String] Case's UUID or key - # @param body [JiraIssueCreateRequest] Jira issue creation request - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_case_jira_issue_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_case_jira_issue".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_jira_issue") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_jira_issue")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_jira_issue ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_jira_issue" - 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 CaseManagementAPI.create_case_jira_issue" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # 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, :AuthZ] - - new_options = opts.merge( - :operation => :create_case_jira_issue, - :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: CaseManagementAPI#create_case_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create investigation notebook for case. - # - # @see #create_case_notebook_with_http_info - def create_case_notebook(case_id, body, opts = {}) - create_case_notebook_with_http_info(case_id, body, opts) - nil - end - - # Create investigation notebook for case. - # - # Create a new investigation notebook and link it to a case - # - # @param case_id [String] Case's UUID or key - # @param body [NotebookCreateRequest] Notebook creation request - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_case_notebook_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_case_notebook".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_notebook") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_notebook")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_notebook ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_notebook" - 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 CaseManagementAPI.create_case_notebook" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/notebook'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # 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, :AuthZ] - - new_options = opts.merge( - :operation => :create_case_notebook, - :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: CaseManagementAPI#create_case_notebook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create ServiceNow ticket for case. - # - # @see #create_case_service_now_ticket_with_http_info - def create_case_service_now_ticket(case_id, body, opts = {}) - create_case_service_now_ticket_with_http_info(case_id, body, opts) - nil - end - - # Create ServiceNow ticket for case. - # - # Create a new ServiceNow incident ticket and link it to a case - # - # @param case_id [String] Case's UUID or key - # @param body [ServiceNowTicketCreateRequest] ServiceNow ticket creation request - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_case_service_now_ticket_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_case_service_now_ticket".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_case_service_now_ticket") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_case_service_now_ticket")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.create_case_service_now_ticket ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.create_case_service_now_ticket" - 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 CaseManagementAPI.create_case_service_now_ticket" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/servicenow_tickets'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # 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, :AuthZ] - - new_options = opts.merge( - :operation => :create_case_service_now_ticket, - :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: CaseManagementAPI#create_case_service_now_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Create a project. # # @see #create_project_with_http_info @@ -1209,240 +975,6 @@ def get_projects_with_http_info(opts = {}) return data, status_code, headers end - # Link incident to case. - # - # @see #link_incident_with_http_info - def link_incident(case_id, body, opts = {}) - data, _status_code, _headers = link_incident_with_http_info(case_id, body, opts) - data - end - - # Link incident to case. - # - # Link an incident to a case - # - # @param case_id [String] Case's UUID or key - # @param body [RelationshipToIncidentRequest] Incident link request - # @param opts [Hash] the optional parameters - # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers - def link_incident_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.link_incident".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.link_incident") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.link_incident")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.link_incident ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.link_incident" - 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 CaseManagementAPI.link_incident" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/incidents'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'CaseResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :link_incident, - :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: CaseManagementAPI#link_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Link existing Jira issue to case. - # - # @see #link_jira_issue_to_case_with_http_info - def link_jira_issue_to_case(case_id, body, opts = {}) - link_jira_issue_to_case_with_http_info(case_id, body, opts) - nil - end - - # Link existing Jira issue to case. - # - # Link an existing Jira issue to a case - # - # @param case_id [String] Case's UUID or key - # @param body [JiraIssueLinkRequest] Jira issue link request - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def link_jira_issue_to_case_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.link_jira_issue_to_case".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.link_jira_issue_to_case") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.link_jira_issue_to_case")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.link_jira_issue_to_case ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.link_jira_issue_to_case" - 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 CaseManagementAPI.link_jira_issue_to_case" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - # 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, :AuthZ] - - new_options = opts.merge( - :operation => :link_jira_issue_to_case, - :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::Patch, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CaseManagementAPI#link_jira_issue_to_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update case project. - # - # @see #move_case_to_project_with_http_info - def move_case_to_project(case_id, body, opts = {}) - data, _status_code, _headers = move_case_to_project_with_http_info(case_id, body, opts) - data - end - - # Update case project. - # - # Update the project associated with a case - # - # @param case_id [String] Case's UUID or key - # @param body [ProjectRelationship] Project update request - # @param opts [Hash] the optional parameters - # @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers - def move_case_to_project_with_http_info(case_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.move_case_to_project".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.move_case_to_project") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.move_case_to_project")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.move_case_to_project ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.move_case_to_project" - 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 CaseManagementAPI.move_case_to_project" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/project'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'CaseResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :move_case_to_project, - :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::Patch, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: CaseManagementAPI#move_case_to_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Search cases. # # @see #search_cases_with_http_info @@ -1683,77 +1215,6 @@ def unassign_case_with_http_info(case_id, body, opts = {}) return data, status_code, headers end - # Remove Jira issue link from case. - # - # @see #unlink_jira_issue_with_http_info - def unlink_jira_issue(case_id, opts = {}) - unlink_jira_issue_with_http_info(case_id, opts) - nil - end - - # Remove Jira issue link from case. - # - # Remove the link between a Jira issue and a case - # - # @param case_id [String] Case's UUID or key - # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def unlink_jira_issue_with_http_info(case_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.unlink_jira_issue".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unlink_jira_issue") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unlink_jira_issue")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: CaseManagementAPI.unlink_jira_issue ...' - end - # verify the required parameter 'case_id' is set - if @api_client.config.client_side_validation && case_id.nil? - fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.unlink_jira_issue" - end - # resource path - local_var_path = '/api/v2/cases/{case_id}/relationships/jira_issues'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] - - new_options = opts.merge( - :operation => :unlink_jira_issue, - :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: CaseManagementAPI#unlink_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - # Update case attributes. # # @see #update_attributes_with_http_info 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..f5faea3bfeb --- /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_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. + # + # 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(['*/*']) + # 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. + # + # @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. + # + # 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(['*/*']) + + # 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. + # + # @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. + # + # 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/jira_issue_create_request.rb b/lib/datadog_api_client/v2/models/assign_seats_user_request.rb similarity index 79% rename from lib/datadog_api_client/v2/models/jira_issue_create_request.rb rename to lib/datadog_api_client/v2/models/assign_seats_user_request.rb index 16b8c6b5138..f0d2e837ba5 100644 --- a/lib/datadog_api_client/v2/models/jira_issue_create_request.rb +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # Jira issue creation request - class JiraIssueCreateRequest + # + class AssignSeatsUserRequest include BaseGenericModel - # Jira issue creation data - attr_reader :data + # + attr_accessor :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'JiraIssueCreateData' + :'data' => :'AssignSeatsUserRequestData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueCreateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AssignSeatsUserRequest` initialize method" end self.additional_properties = {} @@ -65,24 +65,6 @@ def initialize(attributes = {}) 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 diff --git a/lib/datadog_api_client/v2/models/jira_issue_link_data.rb b/lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb similarity index 82% rename from lib/datadog_api_client/v2/models/jira_issue_link_data.rb rename to lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb index b3f42a4f790..c5dbcd29424 100644 --- a/lib/datadog_api_client/v2/models/jira_issue_link_data.rb +++ b/lib/datadog_api_client/v2/models/assign_seats_user_request_data.rb @@ -17,14 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Jira issue link data - class JiraIssueLinkData + # + class AssignSeatsUserRequestData include BaseGenericModel - # Jira issue link attributes - attr_reader :attributes + # + attr_accessor :attributes - # Jira issue resource type + # The ID of the assign seats user request. + attr_accessor :id + + # Seat assignments resource type. attr_reader :type attr_accessor :additional_properties @@ -34,6 +37,7 @@ class JiraIssueLinkData def self.attribute_map { :'attributes' => :'attributes', + :'id' => :'id', :'type' => :'type' } end @@ -42,8 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'JiraIssueLinkAttributes', - :'type' => :'JiraIssueResourceType' + :'attributes' => :'AssignSeatsUserRequestDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' } end @@ -52,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueLinkData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AssignSeatsUserRequestData` initialize method" end self.additional_properties = {} @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.attributes = attributes[:'attributes'] end + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -78,21 +87,10 @@ def initialize(attributes = {}) # @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 @@ -130,6 +128,7 @@ 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 @@ -138,7 +137,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, type, additional_properties].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/jira_issue_link_request.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response.rb similarity index 79% rename from lib/datadog_api_client/v2/models/jira_issue_link_request.rb rename to lib/datadog_api_client/v2/models/assign_seats_user_response.rb index 7c811d30d5d..48b25e0bfa7 100644 --- a/lib/datadog_api_client/v2/models/jira_issue_link_request.rb +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # Jira issue link request - class JiraIssueLinkRequest + # + class AssignSeatsUserResponse include BaseGenericModel - # Jira issue link data - attr_reader :data + # + attr_accessor :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'JiraIssueLinkData' + :'data' => :'AssignSeatsUserResponseData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueLinkRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AssignSeatsUserResponse` initialize method" end self.additional_properties = {} @@ -65,24 +65,6 @@ def initialize(attributes = {}) 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 diff --git a/lib/datadog_api_client/v2/models/jira_issue_create_data.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb similarity index 82% rename from lib/datadog_api_client/v2/models/jira_issue_create_data.rb rename to lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb index a73f0f50a06..5a7ba370cc5 100644 --- a/lib/datadog_api_client/v2/models/jira_issue_create_data.rb +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response_data.rb @@ -17,14 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Jira issue creation data - class JiraIssueCreateData + # + class AssignSeatsUserResponseData include BaseGenericModel - # Jira issue creation attributes - attr_reader :attributes + # + attr_accessor :attributes - # Jira issue resource type + # The ID of the assign seats user response. + attr_accessor :id + + # Seat assignments resource type. attr_reader :type attr_accessor :additional_properties @@ -34,6 +37,7 @@ class JiraIssueCreateData def self.attribute_map { :'attributes' => :'attributes', + :'id' => :'id', :'type' => :'type' } end @@ -42,8 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'JiraIssueCreateAttributes', - :'type' => :'JiraIssueResourceType' + :'attributes' => :'AssignSeatsUserResponseDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' } end @@ -52,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIssueCreateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AssignSeatsUserResponseData` initialize method" end self.additional_properties = {} @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.attributes = attributes[:'attributes'] end + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -78,21 +87,10 @@ def initialize(attributes = {}) # @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 @@ -130,6 +128,7 @@ 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 @@ -138,7 +137,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, type, additional_properties].hash + [attributes, id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/notebook_create_data.rb b/lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb similarity index 74% rename from lib/datadog_api_client/v2/models/notebook_create_data.rb rename to lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb index 649b274d915..8149edb0673 100644 --- a/lib/datadog_api_client/v2/models/notebook_create_data.rb +++ b/lib/datadog_api_client/v2/models/assign_seats_user_response_data_attributes.rb @@ -17,12 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # Notebook creation data - class NotebookCreateData + # + class AssignSeatsUserResponseDataAttributes include BaseGenericModel - # Notebook resource type - attr_reader :type + # 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 @@ -30,7 +33,8 @@ class NotebookCreateData # @!visibility private def self.attribute_map { - :'type' => :'type' + :'assigned_ids' => :'assigned_ids', + :'product_code' => :'product_code' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'type' => :'NotebookResourceType' + :'assigned_ids' => :'Array', + :'product_code' => :'String' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotebookCreateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AssignSeatsUserResponseDataAttributes` initialize method" end self.additional_properties = {} @@ -60,27 +65,15 @@ def initialize(attributes = {}) end } - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'assigned_ids') + if (value = attributes[:'assigned_ids']).is_a?(Array) + self.assigned_ids = value + end end - end - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @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.' + if attributes.key?(:'product_code') + self.product_code = attributes[:'product_code'] end - @type = type end # Returns the object in the form of hash, with additionalProperties support. @@ -109,7 +102,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - type == o.type && + assigned_ids == o.assigned_ids && + product_code == o.product_code && additional_properties == o.additional_properties end @@ -117,7 +111,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [type, additional_properties].hash + [assigned_ids, product_code, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/jira_issue_create_attributes.rb b/lib/datadog_api_client/v2/models/jira_issue_create_attributes.rb deleted file mode 100644 index b06aed5caf2..00000000000 --- a/lib/datadog_api_client/v2/models/jira_issue_create_attributes.rb +++ /dev/null @@ -1,175 +0,0 @@ -=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 - # Jira issue creation attributes - class JiraIssueCreateAttributes - include BaseGenericModel - - # Additional Jira fields - attr_accessor :fields - - # Jira issue type ID - attr_reader :issue_type_id - - # Jira account ID - attr_reader :jira_account_id - - # Jira project ID - attr_reader :project_id - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'fields' => :'fields', - :'issue_type_id' => :'issue_type_id', - :'jira_account_id' => :'jira_account_id', - :'project_id' => :'project_id' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'fields' => :'Hash', - :'issue_type_id' => :'String', - :'jira_account_id' => :'String', - :'project_id' => :'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::JiraIssueCreateAttributes` 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?(:'fields') - self.fields = attributes[:'fields'] - end - - if attributes.key?(:'issue_type_id') - self.issue_type_id = attributes[:'issue_type_id'] - end - - if attributes.key?(:'jira_account_id') - self.jira_account_id = attributes[:'jira_account_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - 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 @issue_type_id.nil? - return false if @jira_account_id.nil? - return false if @project_id.nil? - true - end - - # Custom attribute writer method with validation - # @param issue_type_id [Object] Object to be assigned - # @!visibility private - def issue_type_id=(issue_type_id) - if issue_type_id.nil? - fail ArgumentError, 'invalid value for "issue_type_id", issue_type_id cannot be nil.' - end - @issue_type_id = issue_type_id - end - - # Custom attribute writer method with validation - # @param jira_account_id [Object] Object to be assigned - # @!visibility private - def jira_account_id=(jira_account_id) - if jira_account_id.nil? - fail ArgumentError, 'invalid value for "jira_account_id", jira_account_id cannot be nil.' - end - @jira_account_id = jira_account_id - end - - # Custom attribute writer method with validation - # @param project_id [Object] Object to be assigned - # @!visibility private - def project_id=(project_id) - if project_id.nil? - fail ArgumentError, 'invalid value for "project_id", project_id cannot be nil.' - end - @project_id = project_id - 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 && - fields == o.fields && - issue_type_id == o.issue_type_id && - jira_account_id == o.jira_account_id && - project_id == o.project_id && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [fields, issue_type_id, jira_account_id, project_id, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/jira_issue_link_attributes.rb b/lib/datadog_api_client/v2/models/jira_issue_link_attributes.rb deleted file mode 100644 index 0582927dec5..00000000000 --- a/lib/datadog_api_client/v2/models/jira_issue_link_attributes.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 - # Jira issue link attributes - class JiraIssueLinkAttributes - include BaseGenericModel - - # URL of the Jira issue - attr_reader :jira_issue_url - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'jira_issue_url' => :'jira_issue_url' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'jira_issue_url' => :'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::JiraIssueLinkAttributes` 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?(:'jira_issue_url') - self.jira_issue_url = attributes[:'jira_issue_url'] - 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 @jira_issue_url.nil? - true - end - - # Custom attribute writer method with validation - # @param jira_issue_url [Object] Object to be assigned - # @!visibility private - def jira_issue_url=(jira_issue_url) - if jira_issue_url.nil? - fail ArgumentError, 'invalid value for "jira_issue_url", jira_issue_url cannot be nil.' - end - @jira_issue_url = jira_issue_url - 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 && - jira_issue_url == o.jira_issue_url && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [jira_issue_url, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/jira_issue_resource_type.rb b/lib/datadog_api_client/v2/models/jira_issue_resource_type.rb deleted file mode 100644 index 394148d4d4b..00000000000 --- a/lib/datadog_api_client/v2/models/jira_issue_resource_type.rb +++ /dev/null @@ -1,26 +0,0 @@ -=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 - # Jira issue resource type - class JiraIssueResourceType - include BaseEnumModel - - ISSUES = "issues".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/incident_resource_type.rb b/lib/datadog_api_client/v2/models/seat_assignments_data_type.rb similarity index 83% rename from lib/datadog_api_client/v2/models/incident_resource_type.rb rename to lib/datadog_api_client/v2/models/seat_assignments_data_type.rb index 9c85cbbc5bf..0a760ca7eef 100644 --- a/lib/datadog_api_client/v2/models/incident_resource_type.rb +++ b/lib/datadog_api_client/v2/models/seat_assignments_data_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # Incident resource type - class IncidentResourceType + # Seat assignments resource type. + class SeatAssignmentsDataType include BaseEnumModel - INCIDENTS = "incidents".freeze + SEAT_ASSIGNMENTS = "seat-assignments".freeze end end diff --git a/lib/datadog_api_client/v2/models/incident_relationship_data.rb b/lib/datadog_api_client/v2/models/seat_user_data.rb similarity index 85% rename from lib/datadog_api_client/v2/models/incident_relationship_data.rb rename to lib/datadog_api_client/v2/models/seat_user_data.rb index ece343189ef..14695968f55 100644 --- a/lib/datadog_api_client/v2/models/incident_relationship_data.rb +++ b/lib/datadog_api_client/v2/models/seat_user_data.rb @@ -17,14 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Incident relationship data - class IncidentRelationshipData + # + class SeatUserData include BaseGenericModel - # Incident identifier - attr_reader :id + # + attr_accessor :attributes - # Incident resource type + # The ID of the seat user. + attr_accessor :id + + # Seat users resource type. attr_reader :type attr_accessor :additional_properties @@ -33,6 +36,7 @@ class IncidentRelationshipData # @!visibility private def self.attribute_map { + :'attributes' => :'attributes', :'id' => :'id', :'type' => :'type' } @@ -42,8 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'attributes' => :'SeatUserDataAttributes', :'id' => :'String', - :'type' => :'IncidentResourceType' + :'type' => :'SeatUserDataType' } end @@ -52,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRelationshipData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SeatUserData` initialize method" end self.additional_properties = {} @@ -65,6 +70,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -78,21 +87,10 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @id.nil? return false if @type.nil? true end - # Custom attribute writer method with validation - # @param id [Object] Object to be assigned - # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' - end - @id = id - end - # Custom attribute writer method with validation # @param type [Object] Object to be assigned # @!visibility private @@ -129,6 +127,7 @@ def to_hash 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 @@ -138,7 +137,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [id, type, additional_properties].hash + [attributes, id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/relationship_to_incident_request.rb b/lib/datadog_api_client/v2/models/seat_user_data_array.rb similarity index 85% rename from lib/datadog_api_client/v2/models/relationship_to_incident_request.rb rename to lib/datadog_api_client/v2/models/seat_user_data_array.rb index 158bbc80af4..e3912a021cc 100644 --- a/lib/datadog_api_client/v2/models/relationship_to_incident_request.rb +++ b/lib/datadog_api_client/v2/models/seat_user_data_array.rb @@ -17,20 +17,24 @@ require 'time' module DatadogAPIClient::V2 - # Relationship to incident request - class RelationshipToIncidentRequest + # + class SeatUserDataArray include BaseGenericModel - # Incident relationship data + # The list of seat users. 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' + :'data' => :'data', + :'meta' => :'meta' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'IncidentRelationshipData' + :'data' => :'Array', + :'meta' => :'SeatUserMeta' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToIncidentRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SeatUserDataArray` initialize method" end self.additional_properties = {} @@ -61,7 +66,13 @@ def initialize(attributes = {}) } if attributes.key?(:'data') - self.data = attributes[:'data'] + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] end end @@ -110,6 +121,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && + meta == o.meta && additional_properties == o.additional_properties end @@ -117,7 +129,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, additional_properties].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..6d9e65cf477 --- /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 + + # 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 + + # 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/notebook_resource_type.rb b/lib/datadog_api_client/v2/models/seat_user_data_type.rb similarity index 86% rename from lib/datadog_api_client/v2/models/notebook_resource_type.rb rename to lib/datadog_api_client/v2/models/seat_user_data_type.rb index ead6aa74645..e6c068985e2 100644 --- a/lib/datadog_api_client/v2/models/notebook_resource_type.rb +++ b/lib/datadog_api_client/v2/models/seat_user_data_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # Notebook resource type - class NotebookResourceType + # Seat users resource type. + class SeatUserDataType include BaseEnumModel - NOTEBOOK = "notebook".freeze + 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/service_now_ticket_create_attributes.rb b/lib/datadog_api_client/v2/models/service_now_ticket_create_attributes.rb deleted file mode 100644 index 190f0ffc43e..00000000000 --- a/lib/datadog_api_client/v2/models/service_now_ticket_create_attributes.rb +++ /dev/null @@ -1,133 +0,0 @@ -=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 - # ServiceNow ticket creation attributes - class ServiceNowTicketCreateAttributes - include BaseGenericModel - - # ServiceNow assignment group - attr_accessor :assignment_group - - # ServiceNow instance name - attr_reader :instance_name - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'assignment_group' => :'assignment_group', - :'instance_name' => :'instance_name' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'assignment_group' => :'String', - :'instance_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::ServiceNowTicketCreateAttributes` 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?(:'assignment_group') - self.assignment_group = attributes[:'assignment_group'] - end - - if attributes.key?(:'instance_name') - self.instance_name = attributes[:'instance_name'] - 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 @instance_name.nil? - true - end - - # Custom attribute writer method with validation - # @param instance_name [Object] Object to be assigned - # @!visibility private - def instance_name=(instance_name) - if instance_name.nil? - fail ArgumentError, 'invalid value for "instance_name", instance_name cannot be nil.' - end - @instance_name = instance_name - 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 && - assignment_group == o.assignment_group && - instance_name == o.instance_name && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [assignment_group, instance_name, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/service_now_ticket_create_request.rb b/lib/datadog_api_client/v2/models/service_now_ticket_create_request.rb deleted file mode 100644 index 6e6aef52bd0..00000000000 --- a/lib/datadog_api_client/v2/models/service_now_ticket_create_request.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 - # ServiceNow ticket creation request - class ServiceNowTicketCreateRequest - include BaseGenericModel - - # ServiceNow ticket creation data - attr_reader :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'ServiceNowTicketCreateData' - } - 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::ServiceNowTicketCreateRequest` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @data.nil? - true - end - - # Custom attribute writer method with validation - # @param data [Object] Object to be assigned - # @!visibility private - def data=(data) - if data.nil? - fail ArgumentError, 'invalid value for "data", data cannot be nil.' - end - @data = data - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/service_now_ticket_resource_type.rb b/lib/datadog_api_client/v2/models/service_now_ticket_resource_type.rb deleted file mode 100644 index d06cbd640c4..00000000000 --- a/lib/datadog_api_client/v2/models/service_now_ticket_resource_type.rb +++ /dev/null @@ -1,26 +0,0 @@ -=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 - # ServiceNow ticket resource type - class ServiceNowTicketResourceType - include BaseEnumModel - - TICKETS = "tickets".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/notebook_create_request.rb b/lib/datadog_api_client/v2/models/unassign_seats_user_request.rb similarity index 79% rename from lib/datadog_api_client/v2/models/notebook_create_request.rb rename to lib/datadog_api_client/v2/models/unassign_seats_user_request.rb index 67e11242304..bc76e45dff9 100644 --- a/lib/datadog_api_client/v2/models/notebook_create_request.rb +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # Notebook creation request - class NotebookCreateRequest + # + class UnassignSeatsUserRequest include BaseGenericModel - # Notebook creation data - attr_reader :data + # + attr_accessor :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'NotebookCreateData' + :'data' => :'UnassignSeatsUserRequestData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotebookCreateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UnassignSeatsUserRequest` initialize method" end self.additional_properties = {} @@ -65,24 +65,6 @@ def initialize(attributes = {}) 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 diff --git a/lib/datadog_api_client/v2/models/service_now_ticket_create_data.rb b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb similarity index 81% rename from lib/datadog_api_client/v2/models/service_now_ticket_create_data.rb rename to lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb index ab3eeabcdaa..4a36ae76c87 100644 --- a/lib/datadog_api_client/v2/models/service_now_ticket_create_data.rb +++ b/lib/datadog_api_client/v2/models/unassign_seats_user_request_data.rb @@ -17,14 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # ServiceNow ticket creation data - class ServiceNowTicketCreateData + # + class UnassignSeatsUserRequestData include BaseGenericModel - # ServiceNow ticket creation attributes - attr_reader :attributes + # + attr_accessor :attributes - # ServiceNow ticket resource type + # The ID of the unassign seats user request. + attr_accessor :id + + # Seat assignments resource type. attr_reader :type attr_accessor :additional_properties @@ -34,6 +37,7 @@ class ServiceNowTicketCreateData def self.attribute_map { :'attributes' => :'attributes', + :'id' => :'id', :'type' => :'type' } end @@ -42,8 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'ServiceNowTicketCreateAttributes', - :'type' => :'ServiceNowTicketResourceType' + :'attributes' => :'UnassignSeatsUserRequestDataAttributes', + :'id' => :'String', + :'type' => :'SeatAssignmentsDataType' } end @@ -52,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceNowTicketCreateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UnassignSeatsUserRequestData` initialize method" end self.additional_properties = {} @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.attributes = attributes[:'attributes'] end + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -78,21 +87,10 @@ def initialize(attributes = {}) # @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 @@ -130,6 +128,7 @@ 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 @@ -138,7 +137,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, type, additional_properties].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