diff --git a/.apigentools-info b/.apigentools-info index 259ddfe7b36..8ebc70a3d48 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.2.0", - "regenerated": "2020-09-18 09:55:25.452527", - "spec_repo_commit": "49af2c4" + "regenerated": "2020-09-21 10:58:10.123196", + "spec_repo_commit": "f05e569" }, "v2": { "apigentools_version": "1.2.0", - "regenerated": "2020-09-18 09:55:31.991375", - "spec_repo_commit": "49af2c4" + "regenerated": "2020-09-21 10:58:17.870982", + "spec_repo_commit": "f05e569" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ed60ee2e6f0..496400d5b35 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -136,6 +136,36 @@ docs/SecurityMonitoringSignalsListResponseLinks.md docs/SecurityMonitoringSignalsListResponseMeta.md docs/SecurityMonitoringSignalsListResponseMetaPage.md docs/SecurityMonitoringSignalsSort.md +docs/ServiceCreateAttributes.md +docs/ServiceCreateData.md +docs/ServiceCreateRequest.md +docs/ServiceIncludedItems.md +docs/ServiceRelationships.md +docs/ServiceResponse.md +docs/ServiceResponseAttributes.md +docs/ServiceResponseData.md +docs/ServiceType.md +docs/ServiceUpdateAttributes.md +docs/ServiceUpdateData.md +docs/ServiceUpdateRequest.md +docs/ServicesApi.md +docs/ServicesResponse.md +docs/ServicesResponseMeta.md +docs/ServicesResponseMetaPagination.md +docs/TeamCreateAttributes.md +docs/TeamCreateData.md +docs/TeamCreateRequest.md +docs/TeamIncludedItems.md +docs/TeamRelationships.md +docs/TeamResponse.md +docs/TeamResponseAttributes.md +docs/TeamResponseData.md +docs/TeamType.md +docs/TeamUpdateAttributes.md +docs/TeamUpdateData.md +docs/TeamUpdateRequest.md +docs/TeamsApi.md +docs/TeamsResponse.md docs/User.md docs/UserAttributes.md docs/UserCreateAttributes.md @@ -149,6 +179,8 @@ docs/UserInvitationResponseData.md docs/UserInvitationsRequest.md docs/UserInvitationsResponse.md docs/UserInvitationsType.md +docs/UserRelationship.md +docs/UserRelationshipData.md docs/UserRelationships.md docs/UserResponse.md docs/UserResponseIncludedItem.md @@ -182,6 +214,8 @@ src/main/java/com/datadog/api/v2/client/api/LogsApi.java src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java src/main/java/com/datadog/api/v2/client/api/RolesApi.java src/main/java/com/datadog/api/v2/client/api/SecurityMonitoringApi.java +src/main/java/com/datadog/api/v2/client/api/ServicesApi.java +src/main/java/com/datadog/api/v2/client/api/TeamsApi.java src/main/java/com/datadog/api/v2/client/api/UsersApi.java src/main/java/com/datadog/api/v2/client/auth/ApiKeyAuth.java src/main/java/com/datadog/api/v2/client/auth/Authentication.java @@ -317,6 +351,34 @@ src/main/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListRespo src/main/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListResponseMeta.java src/main/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListResponseMetaPage.java src/main/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsSort.java +src/main/java/com/datadog/api/v2/client/model/ServiceCreateAttributes.java +src/main/java/com/datadog/api/v2/client/model/ServiceCreateData.java +src/main/java/com/datadog/api/v2/client/model/ServiceCreateRequest.java +src/main/java/com/datadog/api/v2/client/model/ServiceIncludedItems.java +src/main/java/com/datadog/api/v2/client/model/ServiceRelationships.java +src/main/java/com/datadog/api/v2/client/model/ServiceResponse.java +src/main/java/com/datadog/api/v2/client/model/ServiceResponseAttributes.java +src/main/java/com/datadog/api/v2/client/model/ServiceResponseData.java +src/main/java/com/datadog/api/v2/client/model/ServiceType.java +src/main/java/com/datadog/api/v2/client/model/ServiceUpdateAttributes.java +src/main/java/com/datadog/api/v2/client/model/ServiceUpdateData.java +src/main/java/com/datadog/api/v2/client/model/ServiceUpdateRequest.java +src/main/java/com/datadog/api/v2/client/model/ServicesResponse.java +src/main/java/com/datadog/api/v2/client/model/ServicesResponseMeta.java +src/main/java/com/datadog/api/v2/client/model/ServicesResponseMetaPagination.java +src/main/java/com/datadog/api/v2/client/model/TeamCreateAttributes.java +src/main/java/com/datadog/api/v2/client/model/TeamCreateData.java +src/main/java/com/datadog/api/v2/client/model/TeamCreateRequest.java +src/main/java/com/datadog/api/v2/client/model/TeamIncludedItems.java +src/main/java/com/datadog/api/v2/client/model/TeamRelationships.java +src/main/java/com/datadog/api/v2/client/model/TeamResponse.java +src/main/java/com/datadog/api/v2/client/model/TeamResponseAttributes.java +src/main/java/com/datadog/api/v2/client/model/TeamResponseData.java +src/main/java/com/datadog/api/v2/client/model/TeamType.java +src/main/java/com/datadog/api/v2/client/model/TeamUpdateAttributes.java +src/main/java/com/datadog/api/v2/client/model/TeamUpdateData.java +src/main/java/com/datadog/api/v2/client/model/TeamUpdateRequest.java +src/main/java/com/datadog/api/v2/client/model/TeamsResponse.java src/main/java/com/datadog/api/v2/client/model/User.java src/main/java/com/datadog/api/v2/client/model/UserAttributes.java src/main/java/com/datadog/api/v2/client/model/UserCreateAttributes.java @@ -330,6 +392,8 @@ src/main/java/com/datadog/api/v2/client/model/UserInvitationResponseData.java src/main/java/com/datadog/api/v2/client/model/UserInvitationsRequest.java src/main/java/com/datadog/api/v2/client/model/UserInvitationsResponse.java src/main/java/com/datadog/api/v2/client/model/UserInvitationsType.java +src/main/java/com/datadog/api/v2/client/model/UserRelationship.java +src/main/java/com/datadog/api/v2/client/model/UserRelationshipData.java src/main/java/com/datadog/api/v2/client/model/UserRelationships.java src/main/java/com/datadog/api/v2/client/model/UserResponse.java src/main/java/com/datadog/api/v2/client/model/UserResponseIncludedItem.java @@ -339,6 +403,8 @@ src/main/java/com/datadog/api/v2/client/model/UserUpdateData.java src/main/java/com/datadog/api/v2/client/model/UserUpdateRequest.java src/main/java/com/datadog/api/v2/client/model/UsersResponse.java src/main/java/com/datadog/api/v2/client/model/UsersType.java +src/test/java/com/datadog/api/v2/client/api/ServicesApiTest.java +src/test/java/com/datadog/api/v2/client/api/TeamsApiTest.java src/test/java/com/datadog/api/v2/client/model/APIErrorResponseTest.java src/test/java/com/datadog/api/v2/client/model/CreatorTest.java src/test/java/com/datadog/api/v2/client/model/DashboardListAddItemsRequestTest.java @@ -468,6 +534,34 @@ src/test/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListRespo src/test/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListResponseMetaTest.java src/test/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsListResponseTest.java src/test/java/com/datadog/api/v2/client/model/SecurityMonitoringSignalsSortTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceCreateAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceCreateDataTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceCreateRequestTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceIncludedItemsTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceRelationshipsTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceResponseAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceResponseDataTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceResponseTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceTypeTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceUpdateAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceUpdateDataTest.java +src/test/java/com/datadog/api/v2/client/model/ServiceUpdateRequestTest.java +src/test/java/com/datadog/api/v2/client/model/ServicesResponseMetaPaginationTest.java +src/test/java/com/datadog/api/v2/client/model/ServicesResponseMetaTest.java +src/test/java/com/datadog/api/v2/client/model/ServicesResponseTest.java +src/test/java/com/datadog/api/v2/client/model/TeamCreateAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/TeamCreateDataTest.java +src/test/java/com/datadog/api/v2/client/model/TeamCreateRequestTest.java +src/test/java/com/datadog/api/v2/client/model/TeamIncludedItemsTest.java +src/test/java/com/datadog/api/v2/client/model/TeamRelationshipsTest.java +src/test/java/com/datadog/api/v2/client/model/TeamResponseAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/TeamResponseDataTest.java +src/test/java/com/datadog/api/v2/client/model/TeamResponseTest.java +src/test/java/com/datadog/api/v2/client/model/TeamTypeTest.java +src/test/java/com/datadog/api/v2/client/model/TeamUpdateAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/TeamUpdateDataTest.java +src/test/java/com/datadog/api/v2/client/model/TeamUpdateRequestTest.java +src/test/java/com/datadog/api/v2/client/model/TeamsResponseTest.java src/test/java/com/datadog/api/v2/client/model/UserAttributesTest.java src/test/java/com/datadog/api/v2/client/model/UserCreateAttributesTest.java src/test/java/com/datadog/api/v2/client/model/UserCreateDataTest.java @@ -480,6 +574,8 @@ src/test/java/com/datadog/api/v2/client/model/UserInvitationResponseTest.java src/test/java/com/datadog/api/v2/client/model/UserInvitationsRequestTest.java src/test/java/com/datadog/api/v2/client/model/UserInvitationsResponseTest.java src/test/java/com/datadog/api/v2/client/model/UserInvitationsTypeTest.java +src/test/java/com/datadog/api/v2/client/model/UserRelationshipDataTest.java +src/test/java/com/datadog/api/v2/client/model/UserRelationshipTest.java src/test/java/com/datadog/api/v2/client/model/UserRelationshipsTest.java src/test/java/com/datadog/api/v2/client/model/UserResponseIncludedItemTest.java src/test/java/com/datadog/api/v2/client/model/UserResponseRelationshipsTest.java diff --git a/api/openapi.yaml b/api/openapi.yaml index db21ed8185b..277649c5bc5 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -62,6 +62,10 @@ tags: name: Roles - description: Detection rules for generating signals and listing of generated signals name: Security Monitoring +- description: Create, update, delete and retrieve your organizations services. + name: Services +- description: Create, update, delete and retrieve your organizations Teams. + name: Teams - description: Create, edit, and disable users. externalDocs: url: https://docs.datadoghq.com/account_management/users @@ -1662,83 +1666,24 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-contentType: application/json x-accepts: application/json - /api/v2/user_invitations: - post: - description: Sends emails to one or more users inviting them to join the organization. - operationId: SendInvitations - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserInvitationsRequest' - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/UserInvitationsResponse' - description: OK - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - summary: Send invitation emails - tags: - - Users - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - /api/v2/user_invitations/{user_invitation_uuid}: + /api/v2/services: get: - description: Returns a single user invitation by its UUID. - operationId: GetInvitation + description: Get all services for the requesting user's organization. If the + `include[users]` query parameter is provided, the included attribute will + contain the users related to these services. + operationId: GetServices parameters: - - description: The UUID of the user invitation. - explode: false - in: path - name: user_invitation_uuid - required: true + - description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false schema: + enum: + - users type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UserInvitationResponse' - description: OK - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Not found - summary: Get a user invitation - tags: - - Users - x-codegen-request-body-name: body - x-accepts: application/json - /api/v2/users: - get: - description: Get the list of all users in the organization. This list includes - all users even if they are disabled or unverified. - operationId: ListUsers - parameters: + style: form - description: Size for a given page. explode: true in: query @@ -1749,60 +1694,22 @@ paths: format: int64 type: integer style: form - - description: Specific page number to return. + - description: Specific offset to use as the beginning of the returned page. explode: true in: query - name: page[number] + name: page[offset] required: false schema: default: 0 format: int64 type: integer style: form - - description: 'User attribute to order results by. Sort order is ascending - by default. Sort order is descending if the field is prefixed by a negative - sign, for example `sort=-name`. Options: `name`, `modified_at`, `user_count`.' - explode: true - in: query - name: sort - required: false - schema: - default: name - type: string - style: form - - description: 'Direction of sort. Options: `asc`, `desc`.' - explode: true - in: query - name: sort_dir - required: false - schema: - $ref: '#/components/schemas/QuerySortOrder' - style: form - - description: Filter all users by the given string. Defaults to no filtering. - explode: true - in: query - name: filter - required: false - schema: - type: string - style: form - - description: |- - Filter on status attribute. - Comma separated list, with possible values `Active`, `Pending`, and `Disabled`. - Defaults to no filtering. - explode: true - in: query - name: filter[status] - required: false - schema: - type: string - style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + $ref: '#/components/schemas/ServicesResponse' description: OK "400": content: @@ -1810,60 +1717,90 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - summary: List all users + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Get a list of all services tags: - - Users - x-codegen-request-body-name: body + - Services + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-accepts: application/json post: - description: Create a user for your organization. - operationId: CreateUser + description: Creates a new service. + operationId: CreateService requestBody: content: application/json: schema: - $ref: '#/components/schemas/UserCreateRequest' + $ref: '#/components/schemas/ServiceCreateRequest' + description: Service Payload. + required: true responses: "201": content: application/json: schema: - $ref: '#/components/schemas/UserResponse' - description: OK + $ref: '#/components/schemas/ServiceResponse' + description: CREATED "400": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - summary: Create a user + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Create a new service tags: - - Users + - Services x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-contentType: application/json x-accepts: application/json - /api/v2/users/{user_id}: + /api/v2/services/{service_id}: delete: - description: Disable a user. Can only be used with an application key belonging - to an administrator user. - operationId: DisableUser + description: Deletes an existing service. + operationId: DeleteService parameters: - - description: The ID of the user. + - description: The ID of the service. explode: false in: path - name: user_id + name: service_id required: true schema: type: string @@ -1871,68 +1808,109 @@ paths: responses: "204": description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found - summary: Disable a user + description: Not Found + summary: Delete an existing service tags: - - Users - x-codegen-request-body-name: body + - Services + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-accepts: application/json get: - description: Get a user in the organization specified by the user’s `user_id`. - operationId: GetUser + description: Get details of a service. If the `include[users]` query parameter + is provided, the included attribute will contain the users related to these + services + operationId: GetService parameters: - - description: The ID of the user. + - description: The ID of the service. explode: false in: path - name: user_id + name: service_id required: true schema: type: string style: simple + - description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false + schema: + enum: + - users + type: string + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UserResponse' - description: OK for get user + $ref: '#/components/schemas/ServiceResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found - summary: Get a user + description: Not Found + summary: Get details of a service tags: - - Users - x-codegen-request-body-name: body + - Services + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-accepts: application/json patch: - description: Edit a user. Can only be used with an application key belonging - to an administrator user. - operationId: UpdateUser + description: Updates an existing service. Only provide the attributes which + should be updated as this request is a partial update. + operationId: UpdateService parameters: - - description: The ID of the user. + - description: The ID of the service. explode: false in: path - name: user_id + name: service_id required: true schema: type: string @@ -1941,13 +1919,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserUpdateRequest' + $ref: '#/components/schemas/ServiceUpdateRequest' + description: Service Payload. + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + $ref: '#/components/schemas/ServiceResponse' description: OK "400": content: @@ -1955,125 +1935,741 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Bad Request - "403": + "401": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error - "404": + description: Unauthorized + "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found - "422": + description: Forbidden + "404": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Unprocessable Entity - summary: Update a user + description: Not Found + summary: Update an existing service tags: - - Users + - Services x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-contentType: application/json x-accepts: application/json - /api/v2/users/{user_id}/orgs: + /api/v2/teams: get: - description: Get a user organization. Returns the user information and all organizations - joined by this user. - operationId: ListUserOrganizations + description: Get all teams for the requesting user's organization. If the `include[users]` + query parameter is provided, the included attribute will contain the users + related to these teams. + operationId: GetTeams parameters: - - description: The ID of the user. - explode: false - in: path - name: user_id - required: true - schema: + - description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false + schema: + enum: + - users type: string - style: simple + style: form + - description: Size for a given page. + explode: true + in: query + name: page[size] + required: false + schema: + default: 10 + format: int64 + type: integer + style: form + - description: Specific offset to use as the beginning of the returned page. + explode: true + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + type: integer + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + $ref: '#/components/schemas/TeamsResponse' description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found - summary: Get a user organization + description: Not Found + summary: Get a list of all teams tags: - - Users + - Teams + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-accepts: application/json + post: + description: Creates a new team. + operationId: CreateTeam + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamCreateRequest' + description: Teams Payload. + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + description: CREATED + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Create a new team + tags: + - Teams x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-contentType: application/json + x-accepts: application/json + /api/v2/teams/{team_id}: + delete: + description: Deletes an existing team. + operationId: DeleteTeam + parameters: + - description: The ID of the team. + explode: false + in: path + name: team_id + required: true + schema: + type: string + style: simple + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Delete an existing team + tags: + - Teams + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). x-accepts: application/json - /api/v2/users/{user_id}/permissions: get: - description: Get a user permission set. Returns a list of the user’s permissions - granted by the associated user's roles. - operationId: ListUserPermissions + description: Get details of a team. If the `include[users]` query parameter + is provided, the included attribute will contain the users related to these + teams. + operationId: GetTeam parameters: - - description: The ID of the user. + - description: The ID of the team. explode: false in: path - name: user_id + name: team_id required: true schema: type: string style: simple + - description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false + schema: + enum: + - users + type: string + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/PermissionsResponse' + $ref: '#/components/schemas/TeamResponse' description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized "403": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: '#/components/schemas/APIErrorResponse' - description: Not found - summary: Get a user permissions + description: Not Found + summary: Get details of a team + tags: + - Teams + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-accepts: application/json + patch: + description: Updates an existing team. Only provide the attributes which should + be updated as this request is a partial update. + operationId: UpdateTeam + parameters: + - description: The ID of the team. + explode: false + in: path + name: team_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamUpdateRequest' + description: Teams Payload. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + summary: Update an existing team + tags: + - Teams + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-contentType: application/json + x-accepts: application/json + /api/v2/user_invitations: + post: + description: Sends emails to one or more users inviting them to join the organization. + operationId: SendInvitations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserInvitationsRequest' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/UserInvitationsResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + summary: Send invitation emails tags: - Users x-codegen-request-body-name: body + x-contentType: application/json x-accepts: application/json -components: - callbacks: {} - examples: {} - headers: {} - links: {} - parameters: - ArchiveID: - description: The ID of the archive. - explode: false - in: path - name: archive_id - required: true - schema: - type: string - style: simple - PageNumber: - description: Specific page number to return. - explode: true - in: query + /api/v2/user_invitations/{user_invitation_uuid}: + get: + description: Returns a single user invitation by its UUID. + operationId: GetInvitation + parameters: + - description: The UUID of the user invitation. + explode: false + in: path + name: user_invitation_uuid + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserInvitationResponse' + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get a user invitation + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json + /api/v2/users: + get: + description: Get the list of all users in the organization. This list includes + all users even if they are disabled or unverified. + operationId: ListUsers + parameters: + - description: Size for a given page. + explode: true + in: query + name: page[size] + required: false + schema: + default: 10 + format: int64 + type: integer + style: form + - description: Specific page number to return. + explode: true + in: query + name: page[number] + required: false + schema: + default: 0 + format: int64 + type: integer + style: form + - description: 'User attribute to order results by. Sort order is ascending + by default. Sort order is descending if the field is prefixed by a negative + sign, for example `sort=-name`. Options: `name`, `modified_at`, `user_count`.' + explode: true + in: query + name: sort + required: false + schema: + default: name + type: string + style: form + - description: 'Direction of sort. Options: `asc`, `desc`.' + explode: true + in: query + name: sort_dir + required: false + schema: + $ref: '#/components/schemas/QuerySortOrder' + style: form + - description: Filter all users by the given string. Defaults to no filtering. + explode: true + in: query + name: filter + required: false + schema: + type: string + style: form + - description: |- + Filter on status attribute. + Comma separated list, with possible values `Active`, `Pending`, and `Disabled`. + Defaults to no filtering. + explode: true + in: query + name: filter[status] + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UsersResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + summary: List all users + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json + post: + description: Create a user for your organization. + operationId: CreateUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreateRequest' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + summary: Create a user + tags: + - Users + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /api/v2/users/{user_id}: + delete: + description: Disable a user. Can only be used with an application key belonging + to an administrator user. + operationId: DisableUser + parameters: + - description: The ID of the user. + explode: false + in: path + name: user_id + required: true + schema: + type: string + style: simple + responses: + "204": + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Disable a user + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json + get: + description: Get a user in the organization specified by the user’s `user_id`. + operationId: GetUser + parameters: + - description: The ID of the user. + explode: false + in: path + name: user_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + description: OK for get user + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get a user + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json + patch: + description: Edit a user. Can only be used with an application key belonging + to an administrator user. + operationId: UpdateUser + parameters: + - description: The ID of the user. + explode: false + in: path + name: user_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unprocessable Entity + summary: Update a user + tags: + - Users + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /api/v2/users/{user_id}/orgs: + get: + description: Get a user organization. Returns the user information and all organizations + joined by this user. + operationId: ListUserOrganizations + parameters: + - description: The ID of the user. + explode: false + in: path + name: user_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserResponse' + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get a user organization + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json + /api/v2/users/{user_id}/permissions: + get: + description: Get a user permission set. Returns a list of the user’s permissions + granted by the associated user's roles. + operationId: ListUserPermissions + parameters: + - description: The ID of the user. + explode: false + in: path + name: user_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsResponse' + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get a user permissions + tags: + - Users + x-codegen-request-body-name: body + x-accepts: application/json +components: + callbacks: {} + examples: {} + headers: {} + links: {} + parameters: + ArchiveID: + description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + PageNumber: + description: Specific page number to return. + explode: true + in: query name: page[number] required: false schema: @@ -2081,6 +2677,17 @@ components: format: int64 type: integer style: form + PageOffset: + description: Specific offset to use as the beginning of the returned page. + explode: true + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + type: integer + style: form PageSize: description: Size for a given page. explode: true @@ -2109,7 +2716,49 @@ components: required: true schema: type: string - style: simple + style: simple + ServiceIDPathParameter: + description: The ID of the service. + explode: false + in: path + name: service_id + required: true + schema: + type: string + style: simple + ServiceIncludeQueryParameter: + description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false + schema: + enum: + - users + type: string + style: form + TeamIDPathParameter: + description: The ID of the team. + explode: false + in: path + name: team_id + required: true + schema: + type: string + style: simple + TeamIncludeQueryParameter: + description: Specifies which types of related objects should be included in + the response. + explode: true + in: query + name: include + required: false + schema: + enum: + - users + type: string + style: form UserID: description: The ID of the user. explode: false @@ -2133,6 +2782,12 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Concurrent Modification + ForbiddenResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden NotAuthorizedResponse: content: application/json: @@ -2145,6 +2800,12 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not Found + UnauthorizedResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized schemas: APIErrorResponse: description: API error response. @@ -3808,826 +4469,1434 @@ components: description: Attributes of the role. example: name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + properties: + created_at: + description: Creation time of the role. + format: date-time + readOnly: true + type: string + modified_at: + description: Time of last role modification. + format: date-time + readOnly: true + type: string + name: + description: Name of the role. + type: string + type: object + RoleUpdateData: + description: Data related to the update of a role. + example: + attributes: + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + id: id + type: roles + properties: + attributes: + $ref: '#/components/schemas/RoleUpdateAttributes' + id: + description: ID of the role. + type: string + type: + $ref: '#/components/schemas/RolesType' + type: object + RoleUpdateRequest: + description: Update a role. + example: + data: + attributes: + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + id: id + type: roles + properties: + data: + $ref: '#/components/schemas/RoleUpdateData' + type: object + RoleUpdateResponse: + description: Response containing information about an updated role. + example: + data: + relationships: + permissions: + data: + - id: id + type: permissions + - id: id + type: permissions + attributes: + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + id: id + type: roles + properties: + data: + $ref: '#/components/schemas/RoleUpdateResponse_data' + type: object + RolesResponse: + description: Response containing information about multiple roles. + example: + data: + - relationships: + permissions: + data: + - id: id + type: permissions + - id: id + type: permissions + attributes: + user_count: 0 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + id: id + type: roles + - relationships: + permissions: + data: + - id: id + type: permissions + - id: id + type: permissions + attributes: + user_count: 0 + name: name + created_at: 2000-01-23T04:56:07.000+00:00 + modified_at: 2000-01-23T04:56:07.000+00:00 + id: id + type: roles + meta: + page: + total_count: 6 + total_filtered_count: 1 + properties: + data: + description: Array of returned roles. + items: + $ref: '#/components/schemas/Role' + type: array + meta: + $ref: '#/components/schemas/ResponseMetaAttributes' + type: object + RolesSort: + default: name + description: Sorting options for roles. + enum: + - name + - -name + - modified_at + - -modified_at + - user_count + - -user_count + type: string + x-enum-varnames: + - NAME_ASCENDING + - NAME_DESCENDING + - MODIFIED_AT_ASCENDING + - MODIFIED_AT_DESCENDING + - USER_COUNT_ASCENDING + - USER_COUNT_DESCENDING + RolesType: + default: roles + description: Roles type. + enum: + - roles + example: roles + type: string + x-enum-varnames: + - ROLES + SecurityMonitoringListRulesResponse: + description: List of rules. + example: + data: + - cases: + - condition: condition + name: name + notifications: + - notifications + - notifications + - condition: condition + name: name + notifications: + - notifications + - notifications + message: message + queries: + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + version: 1 + tags: + - tags + - tags + creationAuthorId: 6 + createdAt: 0 + isDefault: true + isDeleted: true + isEnabled: true + name: name + options: {} + id: id + - cases: + - condition: condition + name: name + notifications: + - notifications + - notifications + - condition: condition + name: name + notifications: + - notifications + - notifications + message: message + queries: + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + version: 1 + tags: + - tags + - tags + creationAuthorId: 6 + createdAt: 0 + isDefault: true + isDeleted: true + isEnabled: true + name: name + options: {} + id: id + meta: + page: + total_count: 6 + total_filtered_count: 1 + properties: + data: + description: TODO. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleResponse' + type: array + meta: + $ref: '#/components/schemas/ResponseMetaAttributes' + type: object + SecurityMonitoringRuleCase: + description: Case when signal is generated. + example: + condition: condition + name: name + notifications: + - notifications + - notifications properties: - created_at: - description: Creation time of the role. - format: date-time - readOnly: true - type: string - modified_at: - description: Time of last role modification. - format: date-time - readOnly: true + condition: + description: |- + A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated + based on the event counts in the previously defined queries. type: string name: - description: Name of the role. + description: Name of the case. type: string + notifications: + description: Notification targets for each rule case. + items: + description: Notification. + type: string + type: array + status: + $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' type: object - RoleUpdateData: - description: Data related to the update of a role. - example: - attributes: - name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 - id: id - type: roles + SecurityMonitoringRuleCaseCreate: + description: Case when signal is generated. properties: - attributes: - $ref: '#/components/schemas/RoleUpdateAttributes' - id: - description: ID of the role. + condition: + description: |- + A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated + based on the event counts in the previously defined queries. type: string - type: - $ref: '#/components/schemas/RolesType' - type: object - RoleUpdateRequest: - description: Update a role. - example: - data: - attributes: - name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 - id: id - type: roles - properties: - data: - $ref: '#/components/schemas/RoleUpdateData' + name: + description: Name of the case. + type: string + notifications: + description: Notification targets for each rule case. + items: + description: Notification. + type: string + type: array + status: + $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' + required: + - status type: object - RoleUpdateResponse: - description: Response containing information about an updated role. + SecurityMonitoringRuleCreatePayload: + description: Create a new rule. example: - data: - relationships: - permissions: - data: - - id: id - type: permissions - - id: id - type: permissions - attributes: - name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 - id: id - type: roles + cases: [] + isEnabled: true + name: name + options: {} + message: message + queries: [] + tags: + - env:prod + - team:security properties: - data: - $ref: '#/components/schemas/RoleUpdateResponse_data' + cases: + description: Cases for generating signals. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' + type: array + isEnabled: + description: Whether the rule is enabled. + example: true + type: boolean + message: + description: Message for generated signals. + type: string + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryCreate' + type: array + tags: + description: Tags for generated signals. + example: + - env:prod + - team:security + items: + description: Tag. + type: string + type: array + required: + - cases + - isEnabled + - message + - name + - options + - queries type: object - RolesResponse: - description: Response containing information about multiple roles. - example: - data: - - relationships: - permissions: - data: - - id: id - type: permissions - - id: id - type: permissions - attributes: - user_count: 0 - name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 - id: id - type: roles - - relationships: - permissions: - data: - - id: id - type: permissions - - id: id - type: permissions - attributes: - user_count: 0 - name: name - created_at: 2000-01-23T04:56:07.000+00:00 - modified_at: 2000-01-23T04:56:07.000+00:00 - id: id - type: roles - meta: - page: - total_count: 6 - total_filtered_count: 1 + SecurityMonitoringRuleEvaluationWindow: + description: |- + A time window is specified to match when at least one of the cases matches true. This is a sliding window + and evaluates in real time. + enum: + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + format: int32 + type: integer + x-enum-varnames: + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + SecurityMonitoringRuleKeepAlive: + description: |- + Once a signal is generated, the signal will remain “open” if a case is matched at least once within + this keep alive window. + enum: + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + - 10800 + - 21600 + format: int32 + type: integer + x-enum-varnames: + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + - THREE_HOURS + - SIX_HOURS + SecurityMonitoringRuleMaxSignalDuration: + description: |- + A signal will “close” regardless of the query being matched once the time exceeds the maximum duration. + This time is calculated from the first seen timestamp. + enum: + - 0 + - 60 + - 300 + - 600 + - 900 + - 1800 + - 3600 + - 7200 + - 10800 + - 21600 + - 43200 + - 86400 + format: int32 + type: integer + x-enum-varnames: + - ZERO_MINUTES + - ONE_MINUTE + - FIVE_MINUTES + - TEN_MINUTES + - FIFTEEN_MINUTES + - THIRTY_MINUTES + - ONE_HOUR + - TWO_HOURS + - THREE_HOURS + - SIX_HOURS + - TWELVE_HOURS + - ONE_DAY + SecurityMonitoringRuleOptions: + description: Options on rules. + example: {} properties: - data: - description: Array of returned roles. + evaluationWindow: + $ref: '#/components/schemas/SecurityMonitoringRuleEvaluationWindow' + keepAlive: + $ref: '#/components/schemas/SecurityMonitoringRuleKeepAlive' + maxSignalDuration: + $ref: '#/components/schemas/SecurityMonitoringRuleMaxSignalDuration' + type: object + SecurityMonitoringRuleQuery: + description: Query for matching rule. + example: + distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + distinctFields: + description: Field for which the cardinality is measured. Sent as an array. items: - $ref: '#/components/schemas/Role' + description: Field. + type: string type: array - meta: - $ref: '#/components/schemas/ResponseMetaAttributes' + groupByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + metric: + description: The target field to aggregate over when using the sum or max + aggregations. + type: string + name: + description: Name of the query. + type: string + query: + description: Query to run on logs. + type: string type: object - RolesSort: - default: name - description: Sorting options for roles. - enum: - - name - - -name - - modified_at - - -modified_at - - user_count - - -user_count - type: string - x-enum-varnames: - - NAME_ASCENDING - - NAME_DESCENDING - - MODIFIED_AT_ASCENDING - - MODIFIED_AT_DESCENDING - - USER_COUNT_ASCENDING - - USER_COUNT_DESCENDING - RolesType: - default: roles - description: Roles type. + SecurityMonitoringRuleQueryAggregation: + description: The aggregation type. enum: - - roles - example: roles + - count + - cardinality + - sum + - max type: string x-enum-varnames: - - ROLES - SecurityMonitoringListRulesResponse: - description: List of rules. + - COUNT + - CARDINALITY + - SUM + - MAX + SecurityMonitoringRuleQueryCreate: + description: Query for matching rule. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + distinctFields: + description: Field for which the cardinality is measured. Sent as an array. + items: + description: Field. + type: string + type: array + groupByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + metric: + description: The target field to aggregate over when using the sum or max + aggregations. + type: string + name: + description: Name of the query. + type: string + query: + description: Query to run on logs. + type: string + required: + - query + type: object + SecurityMonitoringRuleResponse: + description: Detection rule. example: - data: - - cases: - - condition: condition - name: name - notifications: - - notifications - - notifications - - condition: condition - name: name - notifications: - - notifications - - notifications - message: message - queries: - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - version: 1 - tags: - - tags - - tags - creationAuthorId: 6 - createdAt: 0 - isDefault: true - isDeleted: true - isEnabled: true + cases: + - condition: condition name: name - options: {} - id: id - - cases: - - condition: condition - name: name - notifications: - - notifications - - notifications - - condition: condition - name: name - notifications: - - notifications - - notifications - message: message - queries: - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - version: 1 - tags: - - tags - - tags - creationAuthorId: 6 - createdAt: 0 - isDefault: true - isDeleted: true - isEnabled: true + notifications: + - notifications + - notifications + - condition: condition name: name - options: {} - id: id - meta: - page: - total_count: 6 - total_filtered_count: 1 + notifications: + - notifications + - notifications + message: message + queries: + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + version: 1 + tags: + - tags + - tags + creationAuthorId: 6 + createdAt: 0 + isDefault: true + isDeleted: true + isEnabled: true + name: name + options: {} + id: id properties: - data: - description: TODO. + cases: + description: Cases for generating signals. items: - $ref: '#/components/schemas/SecurityMonitoringRuleResponse' + $ref: '#/components/schemas/SecurityMonitoringRuleCase' type: array - meta: - $ref: '#/components/schemas/ResponseMetaAttributes' - type: object - SecurityMonitoringRuleCase: - description: Case when signal is generated. + createdAt: + description: When the rule was created, timestamp in milliseconds. + format: int64 + type: integer + creationAuthorId: + description: User ID of the user who created the rule. + format: int64 + type: integer + id: + description: The ID of the rule. + type: string + isDefault: + description: Whether the rule is included by default. + type: boolean + isDeleted: + description: Whether the rule has been deleted. + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. + type: string + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. + type: string + type: array + version: + description: The version of the rule. + format: int64 + type: integer + SecurityMonitoringRuleSeverity: + description: Severity of the Security Signal. + enum: + - info + - low + - medium + - high + - critical + type: string + x-enum-varnames: + - INFO + - LOW + - MEDIUM + - HIGH + - CRITICAL + SecurityMonitoringRuleUpdatePayload: + description: Update an existing rule. example: - condition: condition + cases: + - condition: condition + name: name + notifications: + - notifications + - notifications + - condition: condition + name: name + notifications: + - notifications + - notifications + isEnabled: true name: name - notifications: - - notifications - - notifications + options: {} + message: message + queries: + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + - distinctFields: + - distinctFields + - distinctFields + metric: metric + groupByFields: + - groupByFields + - groupByFields + query: query + name: name + tags: + - tags + - tags properties: - condition: - description: |- - A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated - based on the event counts in the previously defined queries. + cases: + description: Cases for generating signals. + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCase' + type: array + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. type: string name: - description: Name of the case. + description: Name of the rule. type: string - notifications: - description: Notification targets for each rule case. + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. items: - description: Notification. + $ref: '#/components/schemas/SecurityMonitoringRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. type: string type: array - status: - $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' type: object - SecurityMonitoringRuleCaseCreate: - description: Case when signal is generated. + SecurityMonitoringSignal: + description: Object description of a security signal. + example: + attributes: + attributes: + workflow: + first_seen: 2020-06-23T14:46:01.000Z + last_seen: 2020-06-23T14:46:49.000Z + rule: + id: 0f5-e0c-805 + name: 'Brute Force Attack Grouped By User ' + version: 12 + message: Detect Account Take Over (ATO) through brute force attempts + tags: + - security:attack + - technique:T1110-brute-force + timestamp: 2019-01-02T09:42:36.32Z + id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: signal properties: - condition: - description: |- - A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated - based on the event counts in the previously defined queries. - type: string - name: - description: Name of the case. + attributes: + $ref: '#/components/schemas/SecurityMonitoringSignal_attributes' + id: + description: The unique ID of the security signal. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA type: string - notifications: - description: Notification targets for each rule case. + type: + $ref: '#/components/schemas/SecurityMonitoringSignalType' + type: object + SecurityMonitoringSignalListRequest: + description: The request for a security signal list. + example: + filter: + query: security:attack status:high + from: 2019-01-02T09:42:36.32Z + to: 2019-01-03T09:42:36.32Z + page: + cursor: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + limit: 25 + properties: + filter: + $ref: '#/components/schemas/SecurityMonitoringSignalListRequest_filter' + page: + $ref: '#/components/schemas/SecurityMonitoringSignalListRequest_page' + sort: + $ref: '#/components/schemas/SecurityMonitoringSignalsSort' + type: object + SecurityMonitoringSignalType: + default: signal + description: The type of event. + enum: + - signal + example: signal + type: string + x-enum-varnames: + - SIGNAL + SecurityMonitoringSignalsListResponse: + description: The response object with all security signals matching the request + and pagination information. + example: + data: + - attributes: + attributes: + workflow: + first_seen: 2020-06-23T14:46:01.000Z + last_seen: 2020-06-23T14:46:49.000Z + rule: + id: 0f5-e0c-805 + name: 'Brute Force Attack Grouped By User ' + version: 12 + message: Detect Account Take Over (ATO) through brute force attempts + tags: + - security:attack + - technique:T1110-brute-force + timestamp: 2019-01-02T09:42:36.32Z + id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: signal + - attributes: + attributes: + workflow: + first_seen: 2020-06-23T14:46:01.000Z + last_seen: 2020-06-23T14:46:49.000Z + rule: + id: 0f5-e0c-805 + name: 'Brute Force Attack Grouped By User ' + version: 12 + message: Detect Account Take Over (ATO) through brute force attempts + tags: + - security:attack + - technique:T1110-brute-force + timestamp: 2019-01-02T09:42:36.32Z + id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: signal + meta: + page: + after: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + links: + next: https://app.datadoghq.com/api/v2/security_monitoring/signals?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + properties: + data: + description: An array of security signals matching the request. items: - description: Notification. - type: string + $ref: '#/components/schemas/SecurityMonitoringSignal' type: array - status: - $ref: '#/components/schemas/SecurityMonitoringRuleSeverity' - required: - - status + links: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse_links' + meta: + $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse_meta' type: object - SecurityMonitoringRuleCreatePayload: - description: Create a new rule. + SecurityMonitoringSignalsSort: + description: The sort parameters used for querying security signals. + enum: + - timestamp + - -timestamp + type: string + x-enum-varnames: + - TIMESTAMP_ASCENDING + - TIMESTAMP_DESCENDING + ServiceCreateAttributes: + description: The service's attributes for a create request. example: - cases: [] - isEnabled: true - name: name - options: {} - message: message - queries: [] - tags: - - env:prod - - team:security + name: an example service name properties: - cases: - description: Cases for generating signals. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' - type: array - isEnabled: - description: Whether the rule is enabled. - example: true - type: boolean - message: - description: Message for generated signals. - type: string name: - description: The name of the rule. + description: Name of the service. + example: an example service name type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryCreate' - type: array - tags: - description: Tags for generated signals. - example: - - env:prod - - team:security - items: - description: Tag. - type: string - type: array required: - - cases - - isEnabled - - message - name - - options - - queries type: object - SecurityMonitoringRuleEvaluationWindow: - description: |- - A time window is specified to match when at least one of the cases matches true. This is a sliding window - and evaluates in real time. - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - SecurityMonitoringRuleKeepAlive: - description: |- - Once a signal is generated, the signal will remain “open” if a case is matched at least once within - this keep alive window. - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - - 10800 - - 21600 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - - THREE_HOURS - - SIX_HOURS - SecurityMonitoringRuleMaxSignalDuration: - description: |- - A signal will “close” regardless of the query being matched once the time exceeds the maximum duration. - This time is calculated from the first seen timestamp. - enum: - - 0 - - 60 - - 300 - - 600 - - 900 - - 1800 - - 3600 - - 7200 - - 10800 - - 21600 - - 43200 - - 86400 - format: int32 - type: integer - x-enum-varnames: - - ZERO_MINUTES - - ONE_MINUTE - - FIVE_MINUTES - - TEN_MINUTES - - FIFTEEN_MINUTES - - THIRTY_MINUTES - - ONE_HOUR - - TWO_HOURS - - THREE_HOURS - - SIX_HOURS - - TWELVE_HOURS - - ONE_DAY - SecurityMonitoringRuleOptions: - description: Options on rules. - example: {} + ServiceCreateData: + description: Service payload for create requests. + example: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: an example service name + type: services properties: - evaluationWindow: - $ref: '#/components/schemas/SecurityMonitoringRuleEvaluationWindow' - keepAlive: - $ref: '#/components/schemas/SecurityMonitoringRuleKeepAlive' - maxSignalDuration: - $ref: '#/components/schemas/SecurityMonitoringRuleMaxSignalDuration' + attributes: + $ref: '#/components/schemas/ServiceCreateAttributes' + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - type type: object - SecurityMonitoringRuleQuery: - description: Query for matching rule. + ServiceCreateRequest: + description: Create request with a service payload. example: - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: an example service name + type: services properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. - items: - description: Field. - type: string - type: array - groupByFields: - description: Fields to group by. + data: + $ref: '#/components/schemas/ServiceCreateData' + required: + - data + type: object + ServiceIncludedItems: + description: An object related to a service which is present in the included + payload. + oneOf: + - $ref: '#/components/schemas/User' + type: object + ServiceRelationships: + description: The service's relationships. + example: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + properties: + created_by: + $ref: '#/components/schemas/UserRelationship' + last_modified_by: + $ref: '#/components/schemas/UserRelationship' + readOnly: true + type: object + ServiceResponse: + description: Response with a service payload. + example: + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: service name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: services + included: + - null + - null + properties: + data: + $ref: '#/components/schemas/ServiceResponseData' + included: + description: Included objects from relationships. items: - description: Field. - type: string + $ref: '#/components/schemas/ServiceIncludedItems' + readOnly: true type: array - metric: - description: The target field to aggregate over when using the sum or max - aggregations. + required: + - data + type: object + ServiceResponseAttributes: + description: The service's attributes from a response. + example: + created: 2000-01-23T04:56:07.000+00:00 + name: service name + modified: 2000-01-23T04:56:07.000+00:00 + properties: + created: + description: Timestamp of when the service was created. + format: date-time + readOnly: true + type: string + modified: + description: Timestamp of when the service was modified. + format: date-time + readOnly: true type: string name: - description: Name of the query. + description: Name of the service. + example: service name type: string - query: - description: Query to run on logs. + type: object + ServiceResponseData: + description: Service data from responses. + example: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: service name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: services + properties: + attributes: + $ref: '#/components/schemas/ServiceResponseAttributes' + id: + description: The service's ID. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - id + - type type: object - SecurityMonitoringRuleQueryAggregation: - description: The aggregation type. + ServiceType: + default: services + description: Service resource type. enum: - - count - - cardinality - - sum - - max + - services + example: services type: string x-enum-varnames: - - COUNT - - CARDINALITY - - SUM - - MAX - SecurityMonitoringRuleQueryCreate: - description: Query for matching rule. + - SERVICES + ServiceUpdateAttributes: + description: The service's attributes for an update request. + example: + name: an example service name properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. + name: + description: Name of the service. + example: an example service name + type: string + required: + - name + type: object + ServiceUpdateData: + description: Service payload for update requests. + example: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: an example service name + id: 00000000-0000-0000-0000-000000000000 + type: services + properties: + attributes: + $ref: '#/components/schemas/ServiceUpdateAttributes' + id: + description: The service's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - id + - type + type: object + ServiceUpdateRequest: + description: Update request with a service payload. + example: + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: an example service name + id: 00000000-0000-0000-0000-000000000000 + type: services + properties: + data: + $ref: '#/components/schemas/ServiceUpdateData' + required: + - data + type: object + ServicesResponse: + description: Response with a list of service payloads. + example: + data: + - relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: service name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: services + - relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: service name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: services + meta: + pagination: + offset: 10 + size: 1000 + next_offset: 1000 + included: + - null + - null + properties: + data: + description: An array of services. items: - description: Field. - type: string + $ref: '#/components/schemas/ServiceResponseData' type: array - groupByFields: - description: Fields to group by. + included: + description: Included related resources which the user requested. items: - description: Field. - type: string + $ref: '#/components/schemas/ServiceIncludedItems' + readOnly: true type: array - metric: - description: The target field to aggregate over when using the sum or max - aggregations. - type: string + meta: + $ref: '#/components/schemas/ServicesResponse_meta' + required: + - data + type: object + TeamCreateAttributes: + description: The team's attributes for a create request. + example: + name: team name + properties: name: - description: Name of the query. - type: string - query: - description: Query to run on logs. + description: Name of the team. + example: team name type: string required: - - query + - name type: object - SecurityMonitoringRuleResponse: - description: Detection rule. + TeamCreateData: + description: Team data for a create request. example: - cases: - - condition: condition - name: name - notifications: - - notifications - - notifications - - condition: condition - name: name - notifications: - - notifications - - notifications - message: message - queries: - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - version: 1 - tags: - - tags - - tags - creationAuthorId: 6 - createdAt: 0 - isDefault: true - isDeleted: true - isEnabled: true - name: name - options: {} - id: id + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: team name + type: teams properties: - cases: - description: Cases for generating signals. + attributes: + $ref: '#/components/schemas/TeamCreateAttributes' + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' + required: + - type + type: object + TeamCreateRequest: + description: Create request with a team payload. + example: + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: team name + type: teams + properties: + data: + $ref: '#/components/schemas/TeamCreateData' + required: + - data + type: object + TeamIncludedItems: + description: An object related to a team which is present in the included payload. + oneOf: + - $ref: '#/components/schemas/User' + type: object + TeamRelationships: + description: The team's relationships. + example: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + properties: + created_by: + $ref: '#/components/schemas/UserRelationship' + last_modified_by: + $ref: '#/components/schemas/UserRelationship' + readOnly: true + type: object + TeamResponse: + description: Response with a team payload. + example: + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: team name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: teams + included: + - null + - null + properties: + data: + $ref: '#/components/schemas/TeamResponseData' + included: + description: Included objects from relationships. items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' + $ref: '#/components/schemas/TeamIncludedItems' + readOnly: true type: array - createdAt: - description: When the rule was created, timestamp in milliseconds. - format: int64 - type: integer - creationAuthorId: - description: User ID of the user who created the rule. - format: int64 - type: integer - id: - description: The ID of the rule. + required: + - data + type: object + TeamResponseAttributes: + description: The team's attributes from a response. + example: + created: 2000-01-23T04:56:07.000+00:00 + name: team name + modified: 2000-01-23T04:56:07.000+00:00 + properties: + created: + description: Timestamp of when the team was created. + format: date-time + readOnly: true type: string - isDefault: - description: Whether the rule is included by default. - type: boolean - isDeleted: - description: Whether the rule has been deleted. - type: boolean - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. + modified: + description: Timestamp of when the team was modified. + format: date-time + readOnly: true type: string name: - description: The name of the rule. + description: Name of the team. + example: team name type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQuery' - type: array - tags: - description: Tags for generated signals. - items: - description: Tag. - type: string - type: array - version: - description: The version of the rule. - format: int64 - type: integer - SecurityMonitoringRuleSeverity: - description: Severity of the Security Signal. + type: object + TeamResponseData: + description: Team data from a response. + example: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: team name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: teams + properties: + attributes: + $ref: '#/components/schemas/TeamResponseAttributes' + id: + description: The team's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' + type: object + TeamType: + default: teams + description: Team resource type. enum: - - info - - low - - medium - - high - - critical + - teams + example: teams type: string x-enum-varnames: - - INFO - - LOW - - MEDIUM - - HIGH - - CRITICAL - SecurityMonitoringRuleUpdatePayload: - description: Update an existing rule. + - TEAMS + TeamUpdateAttributes: + description: The team's attributes for an update request. example: - cases: - - condition: condition - name: name - notifications: - - notifications - - notifications - - condition: condition - name: name - notifications: - - notifications - - notifications - isEnabled: true - name: name - options: {} - message: message - queries: - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - - distinctFields: - - distinctFields - - distinctFields - metric: metric - groupByFields: - - groupByFields - - groupByFields - query: query - name: name - tags: - - tags - - tags + name: team name properties: - cases: - description: Cases for generating signals. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' - type: array - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. - type: string name: - description: Name of the rule. + description: Name of the team. + example: team name type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQuery' - type: array - tags: - description: Tags for generated signals. - items: - description: Tag. - type: string - type: array + required: + - name type: object - SecurityMonitoringSignal: - description: Object description of a security signal. + TeamUpdateData: + description: Team data for an update request. example: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users attributes: - attributes: - workflow: - first_seen: 2020-06-23T14:46:01.000Z - last_seen: 2020-06-23T14:46:49.000Z - rule: - id: 0f5-e0c-805 - name: 'Brute Force Attack Grouped By User ' - version: 12 - message: Detect Account Take Over (ATO) through brute force attempts - tags: - - security:attack - - technique:T1110-brute-force - timestamp: 2019-01-02T09:42:36.32Z - id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA - type: signal + name: team name + id: 00000000-0000-0000-0000-000000000000 + type: teams properties: attributes: - $ref: '#/components/schemas/SecurityMonitoringSignal_attributes' + $ref: '#/components/schemas/TeamUpdateAttributes' id: - description: The unique ID of the security signal. - example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + description: The team's ID. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: '#/components/schemas/TeamRelationships' type: - $ref: '#/components/schemas/SecurityMonitoringSignalType' + $ref: '#/components/schemas/TeamType' + required: + - id + - type type: object - SecurityMonitoringSignalListRequest: - description: The request for a security signal list. + TeamUpdateRequest: + description: Update request with a team payload. example: - filter: - query: security:attack status:high - from: 2019-01-02T09:42:36.32Z - to: 2019-01-03T09:42:36.32Z - page: - cursor: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - limit: 25 + data: + relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + name: team name + id: 00000000-0000-0000-0000-000000000000 + type: teams properties: - filter: - $ref: '#/components/schemas/SecurityMonitoringSignalListRequest_filter' - page: - $ref: '#/components/schemas/SecurityMonitoringSignalListRequest_page' - sort: - $ref: '#/components/schemas/SecurityMonitoringSignalsSort' + data: + $ref: '#/components/schemas/TeamUpdateData' + required: + - data type: object - SecurityMonitoringSignalType: - default: signal - description: The type of event. - enum: - - signal - example: signal - type: string - x-enum-varnames: - - SIGNAL - SecurityMonitoringSignalsListResponse: - description: The response object with all security signals matching the request - and pagination information. + TeamsResponse: + description: Response with a list of team payloads. example: data: - - attributes: - attributes: - workflow: - first_seen: 2020-06-23T14:46:01.000Z - last_seen: 2020-06-23T14:46:49.000Z - rule: - id: 0f5-e0c-805 - name: 'Brute Force Attack Grouped By User ' - version: 12 - message: Detect Account Take Over (ATO) through brute force attempts - tags: - - security:attack - - technique:T1110-brute-force - timestamp: 2019-01-02T09:42:36.32Z - id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA - type: signal - - attributes: - attributes: - workflow: - first_seen: 2020-06-23T14:46:01.000Z - last_seen: 2020-06-23T14:46:49.000Z - rule: - id: 0f5-e0c-805 - name: 'Brute Force Attack Grouped By User ' - version: 12 - message: Detect Account Take Over (ATO) through brute force attempts - tags: - - security:attack - - technique:T1110-brute-force - timestamp: 2019-01-02T09:42:36.32Z - id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA - type: signal + - relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: team name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: teams + - relationships: + last_modified_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + created_by: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + attributes: + created: 2000-01-23T04:56:07.000+00:00 + name: team name + modified: 2000-01-23T04:56:07.000+00:00 + id: 00000000-0000-0000-0000-000000000000 + type: teams meta: - page: - after: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== - links: - next: https://app.datadoghq.com/api/v2/security_monitoring/signals?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== + pagination: + offset: 10 + size: 1000 + next_offset: 1000 + included: + - null + - null properties: data: - description: An array of security signals matching the request. + description: An array of teams. items: - $ref: '#/components/schemas/SecurityMonitoringSignal' + $ref: '#/components/schemas/TeamResponseData' + type: array + included: + description: Included related resources which the user requested. + items: + $ref: '#/components/schemas/TeamIncludedItems' + readOnly: true type: array - links: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse_links' meta: - $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse_meta' + $ref: '#/components/schemas/ServicesResponse_meta' + required: + - data type: object - SecurityMonitoringSignalsSort: - description: The sort parameters used for querying security signals. - enum: - - timestamp - - -timestamp - type: string - x-enum-varnames: - - TIMESTAMP_ASCENDING - - TIMESTAMP_DESCENDING User: description: User object returned by the API. example: @@ -4911,6 +6180,16 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserRelationship: + description: A relationship reference for users. + example: + data: + id: 00000000-0000-0000-0000-000000000000 + type: users + properties: + data: + $ref: '#/components/schemas/UserRelationship_data' + type: object UserRelationships: description: Relationships of the user object. example: @@ -5516,6 +6795,55 @@ components: page: $ref: '#/components/schemas/SecurityMonitoringSignalsListResponse_meta_page' type: object + ServicesResponse_meta_pagination: + description: Pagination properties. + example: + offset: 10 + size: 1000 + next_offset: 1000 + properties: + next_offset: + description: The index of the first element in the next page of results. + Equal to page size added to the current offset. + example: 1000 + format: int64 + type: integer + offset: + description: The index of the first element in the results. + example: 10 + format: int64 + type: integer + size: + description: Maximum size of pages to return. + example: 1000 + format: int64 + type: integer + type: object + ServicesResponse_meta: + description: The metadata object containing pagination metadata. + example: + pagination: + offset: 10 + size: 1000 + next_offset: 1000 + properties: + pagination: + $ref: '#/components/schemas/ServicesResponse_meta_pagination' + readOnly: true + type: object + UserRelationship_data: + description: The User relationship data. + example: + id: 00000000-0000-0000-0000-000000000000 + type: users + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UsersType' + type: object securitySchemes: apiKeyAuth: description: Your Datadog API Key. diff --git a/api_docs/v2/ServiceCreateAttributes.md b/api_docs/v2/ServiceCreateAttributes.md new file mode 100644 index 00000000000..ea32956cef5 --- /dev/null +++ b/api_docs/v2/ServiceCreateAttributes.md @@ -0,0 +1,13 @@ + + +# ServiceCreateAttributes + +The service's attributes for a create request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the service. | + + + diff --git a/api_docs/v2/ServiceCreateData.md b/api_docs/v2/ServiceCreateData.md new file mode 100644 index 00000000000..1dbe31484bd --- /dev/null +++ b/api_docs/v2/ServiceCreateData.md @@ -0,0 +1,15 @@ + + +# ServiceCreateData + +Service payload for create requests. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**ServiceCreateAttributes**](ServiceCreateAttributes.md) | | [optional] +**relationships** | [**ServiceRelationships**](ServiceRelationships.md) | | [optional] +**type** | [**ServiceType**](ServiceType.md) | | + + + diff --git a/api_docs/v2/ServiceCreateRequest.md b/api_docs/v2/ServiceCreateRequest.md new file mode 100644 index 00000000000..902fbce4633 --- /dev/null +++ b/api_docs/v2/ServiceCreateRequest.md @@ -0,0 +1,13 @@ + + +# ServiceCreateRequest + +Create request with a service payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ServiceCreateData**](ServiceCreateData.md) | | + + + diff --git a/api_docs/v2/ServiceIncludedItems.md b/api_docs/v2/ServiceIncludedItems.md new file mode 100644 index 00000000000..8b8396655ce --- /dev/null +++ b/api_docs/v2/ServiceIncludedItems.md @@ -0,0 +1,30 @@ + + +# ServiceIncludedItems + +An object related to a service which is present in the included payload. + +## oneOf schemas +* [User](User.md) + +## Example +```java +// Import classes: +import com.datadog.api.v2.client.model.ServiceIncludedItems; +import com.datadog.api.v2.client.model.User; + +public class Example { + public static void main(String[] args) { + ServiceIncludedItems exampleServiceIncludedItems = new ServiceIncludedItems(); + + // create a new User + User exampleUser = new User(); + // set ServiceIncludedItems to User + exampleServiceIncludedItems.setActualInstance(exampleUser); + // to get back the User set earlier + User testUser = (User) exampleServiceIncludedItems.getActualInstance(); + } +} +``` + + diff --git a/api_docs/v2/ServiceRelationships.md b/api_docs/v2/ServiceRelationships.md new file mode 100644 index 00000000000..ad890f7b52c --- /dev/null +++ b/api_docs/v2/ServiceRelationships.md @@ -0,0 +1,14 @@ + + +# ServiceRelationships + +The service's relationships. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdBy** | [**UserRelationship**](UserRelationship.md) | | [optional] +**lastModifiedBy** | [**UserRelationship**](UserRelationship.md) | | [optional] + + + diff --git a/api_docs/v2/ServiceResponse.md b/api_docs/v2/ServiceResponse.md new file mode 100644 index 00000000000..dbbfd9e1bf1 --- /dev/null +++ b/api_docs/v2/ServiceResponse.md @@ -0,0 +1,14 @@ + + +# ServiceResponse + +Response with a service payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ServiceResponseData**](ServiceResponseData.md) | | +**included** | [**List<ServiceIncludedItems>**](ServiceIncludedItems.md) | Included objects from relationships. | [optional] [readonly] + + + diff --git a/api_docs/v2/ServiceResponseAttributes.md b/api_docs/v2/ServiceResponseAttributes.md new file mode 100644 index 00000000000..a21d53d4d58 --- /dev/null +++ b/api_docs/v2/ServiceResponseAttributes.md @@ -0,0 +1,15 @@ + + +# ServiceResponseAttributes + +The service's attributes from a response. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp of when the service was created. | [optional] [readonly] +**modified** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp of when the service was modified. | [optional] [readonly] +**name** | **String** | Name of the service. | [optional] + + + diff --git a/api_docs/v2/ServiceResponseData.md b/api_docs/v2/ServiceResponseData.md new file mode 100644 index 00000000000..db40c97c0d2 --- /dev/null +++ b/api_docs/v2/ServiceResponseData.md @@ -0,0 +1,16 @@ + + +# ServiceResponseData + +Service data from responses. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**ServiceResponseAttributes**](ServiceResponseAttributes.md) | | [optional] +**id** | **String** | The service's ID. | +**relationships** | [**ServiceRelationships**](ServiceRelationships.md) | | [optional] +**type** | [**ServiceType**](ServiceType.md) | | + + + diff --git a/api_docs/v2/ServiceType.md b/api_docs/v2/ServiceType.md new file mode 100644 index 00000000000..8d63ba2d358 --- /dev/null +++ b/api_docs/v2/ServiceType.md @@ -0,0 +1,11 @@ + + +# ServiceType + +## Enum + + +* `SERVICES` (value: `"services"`) + + + diff --git a/api_docs/v2/ServiceUpdateAttributes.md b/api_docs/v2/ServiceUpdateAttributes.md new file mode 100644 index 00000000000..4ddb05f1f0d --- /dev/null +++ b/api_docs/v2/ServiceUpdateAttributes.md @@ -0,0 +1,13 @@ + + +# ServiceUpdateAttributes + +The service's attributes for an update request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the service. | + + + diff --git a/api_docs/v2/ServiceUpdateData.md b/api_docs/v2/ServiceUpdateData.md new file mode 100644 index 00000000000..32021353840 --- /dev/null +++ b/api_docs/v2/ServiceUpdateData.md @@ -0,0 +1,16 @@ + + +# ServiceUpdateData + +Service payload for update requests. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**ServiceUpdateAttributes**](ServiceUpdateAttributes.md) | | [optional] +**id** | **String** | The service's ID. | +**relationships** | [**ServiceRelationships**](ServiceRelationships.md) | | [optional] +**type** | [**ServiceType**](ServiceType.md) | | + + + diff --git a/api_docs/v2/ServiceUpdateRequest.md b/api_docs/v2/ServiceUpdateRequest.md new file mode 100644 index 00000000000..19e5bcce677 --- /dev/null +++ b/api_docs/v2/ServiceUpdateRequest.md @@ -0,0 +1,13 @@ + + +# ServiceUpdateRequest + +Update request with a service payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ServiceUpdateData**](ServiceUpdateData.md) | | + + + diff --git a/api_docs/v2/ServicesApi.md b/api_docs/v2/ServicesApi.md new file mode 100644 index 00000000000..94273924fa8 --- /dev/null +++ b/api_docs/v2/ServicesApi.md @@ -0,0 +1,436 @@ +# ServicesApi + +All URIs are relative to *https://api.datadoghq.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createService**](ServicesApi.md#createService) | **POST** /api/v2/services | Create a new service +[**deleteService**](ServicesApi.md#deleteService) | **DELETE** /api/v2/services/{service_id} | Delete an existing service +[**getService**](ServicesApi.md#getService) | **GET** /api/v2/services/{service_id} | Get details of a service +[**getServices**](ServicesApi.md#getServices) | **GET** /api/v2/services | Get a list of all services +[**updateService**](ServicesApi.md#updateService) | **PATCH** /api/v2/services/{service_id} | Update an existing service + + + +## createService + +> ServiceResponse createService().body(body).execute(); + +Create a new service + +Creates a new service. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.ServicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + ServicesApi apiInstance = new ServicesApi(defaultClient); + ServiceCreateRequest body = new ServiceCreateRequest(); // ServiceCreateRequest | Service Payload. + try { + ServiceResponse result = api.createService() + .body(body) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServicesApi#createService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**ServiceCreateRequest**](ServiceCreateRequest.md)| Service Payload. | + +### Return type + +[**ServiceResponse**](ServiceResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | CREATED | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## deleteService + +> deleteService(serviceId).execute(); + +Delete an existing service + +Deletes an existing service. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.ServicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + ServicesApi apiInstance = new ServicesApi(defaultClient); + String serviceId = "serviceId_example"; // String | The ID of the service. + try { + api.deleteService(serviceId) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling ServicesApi#deleteService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serviceId** | **String**| The ID of the service. | + +### Return type + +null (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## getService + +> ServiceResponse getService(serviceId).include(include).execute(); + +Get details of a service + +Get details of a service. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.ServicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + ServicesApi apiInstance = new ServicesApi(defaultClient); + String serviceId = "serviceId_example"; // String | The ID of the service. + String include = "include_example"; // String | Specifies which types of related objects should be included in the response. + try { + ServiceResponse result = api.getService(serviceId) + .include(include) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServicesApi#getService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serviceId** | **String**| The ID of the service. | + **include** | **String**| Specifies which types of related objects should be included in the response. | [optional] [enum: users] + +### Return type + +[**ServiceResponse**](ServiceResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## getServices + +> ServicesResponse getServices().include(include).pageSize(pageSize).pageOffset(pageOffset).execute(); + +Get a list of all services + +Get all services for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.ServicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + ServicesApi apiInstance = new ServicesApi(defaultClient); + String include = "include_example"; // String | Specifies which types of related objects should be included in the response. + Long pageSize = 10lL; // Long | Size for a given page. + Long pageOffset = 0lL; // Long | Specific offset to use as the beginning of the returned page. + try { + ServicesResponse result = api.getServices() + .include(include) + .pageSize(pageSize) + .pageOffset(pageOffset) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServicesApi#getServices"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **String**| Specifies which types of related objects should be included in the response. | [optional] [enum: users] + **pageSize** | **Long**| Size for a given page. | [optional] [default to 10l] + **pageOffset** | **Long**| Specific offset to use as the beginning of the returned page. | [optional] [default to 0l] + +### Return type + +[**ServicesResponse**](ServicesResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## updateService + +> ServiceResponse updateService(serviceId).body(body).execute(); + +Update an existing service + +Updates an existing service. Only provide the attributes which should be updated as this request is a partial update. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.ServicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + ServicesApi apiInstance = new ServicesApi(defaultClient); + String serviceId = "serviceId_example"; // String | The ID of the service. + ServiceUpdateRequest body = new ServiceUpdateRequest(); // ServiceUpdateRequest | Service Payload. + try { + ServiceResponse result = api.updateService(serviceId) + .body(body) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServicesApi#updateService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serviceId** | **String**| The ID of the service. | + **body** | [**ServiceUpdateRequest**](ServiceUpdateRequest.md)| Service Payload. | + +### Return type + +[**ServiceResponse**](ServiceResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + diff --git a/api_docs/v2/ServicesResponse.md b/api_docs/v2/ServicesResponse.md new file mode 100644 index 00000000000..e2f6f6d5240 --- /dev/null +++ b/api_docs/v2/ServicesResponse.md @@ -0,0 +1,15 @@ + + +# ServicesResponse + +Response with a list of service payloads. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List<ServiceResponseData>**](ServiceResponseData.md) | An array of services. | +**included** | [**List<ServiceIncludedItems>**](ServiceIncludedItems.md) | Included related resources which the user requested. | [optional] [readonly] +**meta** | [**ServicesResponseMeta**](ServicesResponseMeta.md) | | [optional] + + + diff --git a/api_docs/v2/ServicesResponseMeta.md b/api_docs/v2/ServicesResponseMeta.md new file mode 100644 index 00000000000..04df1e02224 --- /dev/null +++ b/api_docs/v2/ServicesResponseMeta.md @@ -0,0 +1,13 @@ + + +# ServicesResponseMeta + +The metadata object containing pagination metadata. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**ServicesResponseMetaPagination**](ServicesResponseMetaPagination.md) | | [optional] + + + diff --git a/api_docs/v2/ServicesResponseMetaPagination.md b/api_docs/v2/ServicesResponseMetaPagination.md new file mode 100644 index 00000000000..0e3475f1c8c --- /dev/null +++ b/api_docs/v2/ServicesResponseMetaPagination.md @@ -0,0 +1,15 @@ + + +# ServicesResponseMetaPagination + +Pagination properties. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nextOffset** | **Long** | The index of the first element in the next page of results. Equal to page size added to the current offset. | [optional] +**offset** | **Long** | The index of the first element in the results. | [optional] +**size** | **Long** | Maximum size of pages to return. | [optional] + + + diff --git a/api_docs/v2/TeamCreateAttributes.md b/api_docs/v2/TeamCreateAttributes.md new file mode 100644 index 00000000000..afd618af7ff --- /dev/null +++ b/api_docs/v2/TeamCreateAttributes.md @@ -0,0 +1,13 @@ + + +# TeamCreateAttributes + +The team's attributes for a create request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the team. | + + + diff --git a/api_docs/v2/TeamCreateData.md b/api_docs/v2/TeamCreateData.md new file mode 100644 index 00000000000..47d8fdca67e --- /dev/null +++ b/api_docs/v2/TeamCreateData.md @@ -0,0 +1,15 @@ + + +# TeamCreateData + +Team data for a create request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**TeamCreateAttributes**](TeamCreateAttributes.md) | | [optional] +**relationships** | [**TeamRelationships**](TeamRelationships.md) | | [optional] +**type** | [**TeamType**](TeamType.md) | | + + + diff --git a/api_docs/v2/TeamCreateRequest.md b/api_docs/v2/TeamCreateRequest.md new file mode 100644 index 00000000000..8aaf70942b5 --- /dev/null +++ b/api_docs/v2/TeamCreateRequest.md @@ -0,0 +1,13 @@ + + +# TeamCreateRequest + +Create request with a team payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TeamCreateData**](TeamCreateData.md) | | + + + diff --git a/api_docs/v2/TeamIncludedItems.md b/api_docs/v2/TeamIncludedItems.md new file mode 100644 index 00000000000..4e9c688e705 --- /dev/null +++ b/api_docs/v2/TeamIncludedItems.md @@ -0,0 +1,30 @@ + + +# TeamIncludedItems + +An object related to a team which is present in the included payload. + +## oneOf schemas +* [User](User.md) + +## Example +```java +// Import classes: +import com.datadog.api.v2.client.model.TeamIncludedItems; +import com.datadog.api.v2.client.model.User; + +public class Example { + public static void main(String[] args) { + TeamIncludedItems exampleTeamIncludedItems = new TeamIncludedItems(); + + // create a new User + User exampleUser = new User(); + // set TeamIncludedItems to User + exampleTeamIncludedItems.setActualInstance(exampleUser); + // to get back the User set earlier + User testUser = (User) exampleTeamIncludedItems.getActualInstance(); + } +} +``` + + diff --git a/api_docs/v2/TeamRelationships.md b/api_docs/v2/TeamRelationships.md new file mode 100644 index 00000000000..deb7240bb09 --- /dev/null +++ b/api_docs/v2/TeamRelationships.md @@ -0,0 +1,14 @@ + + +# TeamRelationships + +The team's relationships. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdBy** | [**UserRelationship**](UserRelationship.md) | | [optional] +**lastModifiedBy** | [**UserRelationship**](UserRelationship.md) | | [optional] + + + diff --git a/api_docs/v2/TeamResponse.md b/api_docs/v2/TeamResponse.md new file mode 100644 index 00000000000..bf107a5d97d --- /dev/null +++ b/api_docs/v2/TeamResponse.md @@ -0,0 +1,14 @@ + + +# TeamResponse + +Response with a team payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TeamResponseData**](TeamResponseData.md) | | +**included** | [**List<TeamIncludedItems>**](TeamIncludedItems.md) | Included objects from relationships. | [optional] [readonly] + + + diff --git a/api_docs/v2/TeamResponseAttributes.md b/api_docs/v2/TeamResponseAttributes.md new file mode 100644 index 00000000000..8163fd8b214 --- /dev/null +++ b/api_docs/v2/TeamResponseAttributes.md @@ -0,0 +1,15 @@ + + +# TeamResponseAttributes + +The team's attributes from a response. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp of when the team was created. | [optional] [readonly] +**modified** | [**OffsetDateTime**](OffsetDateTime.md) | Timestamp of when the team was modified. | [optional] [readonly] +**name** | **String** | Name of the team. | [optional] + + + diff --git a/api_docs/v2/TeamResponseData.md b/api_docs/v2/TeamResponseData.md new file mode 100644 index 00000000000..0a98dc27237 --- /dev/null +++ b/api_docs/v2/TeamResponseData.md @@ -0,0 +1,16 @@ + + +# TeamResponseData + +Team data from a response. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**TeamResponseAttributes**](TeamResponseAttributes.md) | | [optional] +**id** | **String** | The team's ID. | [optional] +**relationships** | [**TeamRelationships**](TeamRelationships.md) | | [optional] +**type** | [**TeamType**](TeamType.md) | | [optional] + + + diff --git a/api_docs/v2/TeamType.md b/api_docs/v2/TeamType.md new file mode 100644 index 00000000000..acfbb4af2ca --- /dev/null +++ b/api_docs/v2/TeamType.md @@ -0,0 +1,11 @@ + + +# TeamType + +## Enum + + +* `TEAMS` (value: `"teams"`) + + + diff --git a/api_docs/v2/TeamUpdateAttributes.md b/api_docs/v2/TeamUpdateAttributes.md new file mode 100644 index 00000000000..e6001727755 --- /dev/null +++ b/api_docs/v2/TeamUpdateAttributes.md @@ -0,0 +1,13 @@ + + +# TeamUpdateAttributes + +The team's attributes for an update request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the team. | + + + diff --git a/api_docs/v2/TeamUpdateData.md b/api_docs/v2/TeamUpdateData.md new file mode 100644 index 00000000000..73f653d75ba --- /dev/null +++ b/api_docs/v2/TeamUpdateData.md @@ -0,0 +1,16 @@ + + +# TeamUpdateData + +Team data for an update request. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**TeamUpdateAttributes**](TeamUpdateAttributes.md) | | [optional] +**id** | **String** | The team's ID. | +**relationships** | [**TeamRelationships**](TeamRelationships.md) | | [optional] +**type** | [**TeamType**](TeamType.md) | | + + + diff --git a/api_docs/v2/TeamUpdateRequest.md b/api_docs/v2/TeamUpdateRequest.md new file mode 100644 index 00000000000..982bf448529 --- /dev/null +++ b/api_docs/v2/TeamUpdateRequest.md @@ -0,0 +1,13 @@ + + +# TeamUpdateRequest + +Update request with a team payload. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TeamUpdateData**](TeamUpdateData.md) | | + + + diff --git a/api_docs/v2/TeamsApi.md b/api_docs/v2/TeamsApi.md new file mode 100644 index 00000000000..8a299af4e1d --- /dev/null +++ b/api_docs/v2/TeamsApi.md @@ -0,0 +1,436 @@ +# TeamsApi + +All URIs are relative to *https://api.datadoghq.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createTeam**](TeamsApi.md#createTeam) | **POST** /api/v2/teams | Create a new team +[**deleteTeam**](TeamsApi.md#deleteTeam) | **DELETE** /api/v2/teams/{team_id} | Delete an existing team +[**getTeam**](TeamsApi.md#getTeam) | **GET** /api/v2/teams/{team_id} | Get details of a team +[**getTeams**](TeamsApi.md#getTeams) | **GET** /api/v2/teams | Get a list of all teams +[**updateTeam**](TeamsApi.md#updateTeam) | **PATCH** /api/v2/teams/{team_id} | Update an existing team + + + +## createTeam + +> TeamResponse createTeam().body(body).execute(); + +Create a new team + +Creates a new team. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + TeamsApi apiInstance = new TeamsApi(defaultClient); + TeamCreateRequest body = new TeamCreateRequest(); // TeamCreateRequest | Teams Payload. + try { + TeamResponse result = api.createTeam() + .body(body) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#createTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**TeamCreateRequest**](TeamCreateRequest.md)| Teams Payload. | + +### Return type + +[**TeamResponse**](TeamResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | CREATED | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## deleteTeam + +> deleteTeam(teamId).execute(); + +Delete an existing team + +Deletes an existing team. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + TeamsApi apiInstance = new TeamsApi(defaultClient); + String teamId = "teamId_example"; // String | The ID of the team. + try { + api.deleteTeam(teamId) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#deleteTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **teamId** | **String**| The ID of the team. | + +### Return type + +null (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## getTeam + +> TeamResponse getTeam(teamId).include(include).execute(); + +Get details of a team + +Get details of a team. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + TeamsApi apiInstance = new TeamsApi(defaultClient); + String teamId = "teamId_example"; // String | The ID of the team. + String include = "include_example"; // String | Specifies which types of related objects should be included in the response. + try { + TeamResponse result = api.getTeam(teamId) + .include(include) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **teamId** | **String**| The ID of the team. | + **include** | **String**| Specifies which types of related objects should be included in the response. | [optional] [enum: users] + +### Return type + +[**TeamResponse**](TeamResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## getTeams + +> TeamsResponse getTeams().include(include).pageSize(pageSize).pageOffset(pageOffset).execute(); + +Get a list of all teams + +Get all teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + TeamsApi apiInstance = new TeamsApi(defaultClient); + String include = "include_example"; // String | Specifies which types of related objects should be included in the response. + Long pageSize = 10lL; // Long | Size for a given page. + Long pageOffset = 0lL; // Long | Specific offset to use as the beginning of the returned page. + try { + TeamsResponse result = api.getTeams() + .include(include) + .pageSize(pageSize) + .pageOffset(pageOffset) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **String**| Specifies which types of related objects should be included in the response. | [optional] [enum: users] + **pageSize** | **Long**| Size for a given page. | [optional] [default to 10l] + **pageOffset** | **Long**| Specific offset to use as the beginning of the returned page. | [optional] [default to 0l] + +### Return type + +[**TeamsResponse**](TeamsResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + + +## updateTeam + +> TeamResponse updateTeam(teamId).body(body).execute(); + +Update an existing team + +Updates an existing team. Only provide the attributes which should be updated as this request is a partial update. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.*; +import com.datadog.api.v2.client.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + TeamsApi apiInstance = new TeamsApi(defaultClient); + String teamId = "teamId_example"; // String | The ID of the team. + TeamUpdateRequest body = new TeamUpdateRequest(); // TeamUpdateRequest | Teams Payload. + try { + TeamResponse result = api.updateTeam(teamId) + .body(body) + .execute(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeam"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **teamId** | **String**| The ID of the team. | + **body** | [**TeamUpdateRequest**](TeamUpdateRequest.md)| Teams Payload. | + +### Return type + +[**TeamResponse**](TeamResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Not Found | - | + diff --git a/api_docs/v2/TeamsResponse.md b/api_docs/v2/TeamsResponse.md new file mode 100644 index 00000000000..c26d49328dd --- /dev/null +++ b/api_docs/v2/TeamsResponse.md @@ -0,0 +1,15 @@ + + +# TeamsResponse + +Response with a list of team payloads. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List<TeamResponseData>**](TeamResponseData.md) | An array of teams. | +**included** | [**List<TeamIncludedItems>**](TeamIncludedItems.md) | Included related resources which the user requested. | [optional] [readonly] +**meta** | [**ServicesResponseMeta**](ServicesResponseMeta.md) | | [optional] + + + diff --git a/api_docs/v2/UserRelationship.md b/api_docs/v2/UserRelationship.md new file mode 100644 index 00000000000..8d29f4ae118 --- /dev/null +++ b/api_docs/v2/UserRelationship.md @@ -0,0 +1,13 @@ + + +# UserRelationship + +A relationship reference for users. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**UserRelationshipData**](UserRelationshipData.md) | | [optional] + + + diff --git a/api_docs/v2/UserRelationshipData.md b/api_docs/v2/UserRelationshipData.md new file mode 100644 index 00000000000..80fc4c2a1fc --- /dev/null +++ b/api_docs/v2/UserRelationshipData.md @@ -0,0 +1,14 @@ + + +# UserRelationshipData + +The User relationship data. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | A unique identifier that represents the user. | [optional] +**type** | [**UsersType**](UsersType.md) | | [optional] + + + diff --git a/src/main/java/com/datadog/api/v2/client/ApiClient.java b/src/main/java/com/datadog/api/v2/client/ApiClient.java index 30a7be0548c..50eb9b2cebd 100644 --- a/src/main/java/com/datadog/api/v2/client/ApiClient.java +++ b/src/main/java/com/datadog/api/v2/client/ApiClient.java @@ -140,6 +140,16 @@ public class ApiClient { put("removeRoleFromArchive", false); put("listSecurityMonitoringSignals", false); put("searchSecurityMonitoringSignals", false); + put("createService", false); + put("deleteService", false); + put("getService", false); + put("getServices", false); + put("updateService", false); + put("createTeam", false); + put("deleteTeam", false); + put("getTeam", false); + put("getTeams", false); + put("updateTeam", false); }}; protected static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(ApiClient.class.getName()); diff --git a/src/main/java/com/datadog/api/v2/client/api/ServicesApi.java b/src/main/java/com/datadog/api/v2/client/api/ServicesApi.java new file mode 100644 index 00000000000..78cce6e9ba1 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/api/ServicesApi.java @@ -0,0 +1,662 @@ +package com.datadog.api.v2.client.api; + +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiResponse; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.Pair; + +import javax.ws.rs.core.GenericType; + +import com.datadog.api.v2.client.model.APIErrorResponse; +import com.datadog.api.v2.client.model.ServiceCreateRequest; +import com.datadog.api.v2.client.model.ServiceResponse; +import com.datadog.api.v2.client.model.ServiceUpdateRequest; +import com.datadog.api.v2.client.model.ServicesResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServicesApi { + private ApiClient apiClient; + + public ServicesApi() { + this(Configuration.getDefaultApiClient()); + } + + public ServicesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + +private ApiResponse createServiceWithHttpInfo(ServiceCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createService"); + } + + // create path and map variables + String localVarPath = "/api/v2/services"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "createService"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("ServicesApi.createService", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIcreateServiceRequest { + private ServiceCreateRequest body; + + private APIcreateServiceRequest() { + } + + /** + * Set body + * @param body Service Payload. (required) + * @return APIcreateServiceRequest + */ + public APIcreateServiceRequest body(ServiceCreateRequest body) { + this.body = body; + return this; + } + + /** + * Execute createService request + * @return ServiceResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public ServiceResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createService request with HTTP info returned + * @return ApiResponse<ServiceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createServiceWithHttpInfo(body); + } + } + + /** + * Create a new service + * Creates a new service. + * @return createServiceRequest + * @throws ApiException if fails to make API call + + + */ + public APIcreateServiceRequest createService() throws ApiException { + String operationId = "createService"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIcreateServiceRequest(); + } + +private ApiResponse deleteServiceWithHttpInfo(String serviceId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'serviceId' is set + if (serviceId == null) { + throw new ApiException(400, "Missing the required parameter 'serviceId' when calling deleteService"); + } + + // create path and map variables + String localVarPath = "/api/v2/services/{service_id}" + .replaceAll("\\{" + "service_id" + "\\}", apiClient.escapeString(serviceId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "deleteService"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + return apiClient.invokeAPI("ServicesApi.deleteService", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, false); + } + + public class APIdeleteServiceRequest { + private String serviceId; + + private APIdeleteServiceRequest(String serviceId) { + this.serviceId = serviceId; + } + + /** + * Execute deleteService request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute deleteService request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteServiceWithHttpInfo(serviceId); + } + } + + /** + * Delete an existing service + * Deletes an existing service. + * @param serviceId The ID of the service. (required) + * @return deleteServiceRequest + * @throws ApiException if fails to make API call + + + */ + public APIdeleteServiceRequest deleteService(String serviceId) throws ApiException { + String operationId = "deleteService"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIdeleteServiceRequest(serviceId); + } + +private ApiResponse getServiceWithHttpInfo(String serviceId, String include) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'serviceId' is set + if (serviceId == null) { + throw new ApiException(400, "Missing the required parameter 'serviceId' when calling getService"); + } + + // create path and map variables + String localVarPath = "/api/v2/services/{service_id}" + .replaceAll("\\{" + "service_id" + "\\}", apiClient.escapeString(serviceId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "getService"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("ServicesApi.getService", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIgetServiceRequest { + private String serviceId; + private String include; + + private APIgetServiceRequest(String serviceId) { + this.serviceId = serviceId; + } + + /** + * Set include + * @param include Specifies which types of related objects should be included in the response. (optional) + * @return APIgetServiceRequest + */ + public APIgetServiceRequest include(String include) { + this.include = include; + return this; + } + + /** + * Execute getService request + * @return ServiceResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public ServiceResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getService request with HTTP info returned + * @return ApiResponse<ServiceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getServiceWithHttpInfo(serviceId, include); + } + } + + /** + * Get details of a service + * Get details of a service. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services + * @param serviceId The ID of the service. (required) + * @return getServiceRequest + * @throws ApiException if fails to make API call + + + */ + public APIgetServiceRequest getService(String serviceId) throws ApiException { + String operationId = "getService"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIgetServiceRequest(serviceId); + } + +private ApiResponse getServicesWithHttpInfo(String include, Long pageSize, Long pageOffset) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v2/services"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "getServices"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("ServicesApi.getServices", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIgetServicesRequest { + private String include; + private Long pageSize; + private Long pageOffset; + + private APIgetServicesRequest() { + } + + /** + * Set include + * @param include Specifies which types of related objects should be included in the response. (optional) + * @return APIgetServicesRequest + */ + public APIgetServicesRequest include(String include) { + this.include = include; + return this; + } + + /** + * Set pageSize + * @param pageSize Size for a given page. (optional, default to 10l) + * @return APIgetServicesRequest + */ + public APIgetServicesRequest pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageOffset + * @param pageOffset Specific offset to use as the beginning of the returned page. (optional, default to 0l) + * @return APIgetServicesRequest + */ + public APIgetServicesRequest pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Execute getServices request + * @return ServicesResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public ServicesResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getServices request with HTTP info returned + * @return ApiResponse<ServicesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getServicesWithHttpInfo(include, pageSize, pageOffset); + } + } + + /** + * Get a list of all services + * Get all services for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services. + * @return getServicesRequest + * @throws ApiException if fails to make API call + + + */ + public APIgetServicesRequest getServices() throws ApiException { + String operationId = "getServices"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIgetServicesRequest(); + } + +private ApiResponse updateServiceWithHttpInfo(String serviceId, ServiceUpdateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'serviceId' is set + if (serviceId == null) { + throw new ApiException(400, "Missing the required parameter 'serviceId' when calling updateService"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateService"); + } + + // create path and map variables + String localVarPath = "/api/v2/services/{service_id}" + .replaceAll("\\{" + "service_id" + "\\}", apiClient.escapeString(serviceId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "updateService"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("ServicesApi.updateService", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIupdateServiceRequest { + private String serviceId; + private ServiceUpdateRequest body; + + private APIupdateServiceRequest(String serviceId) { + this.serviceId = serviceId; + } + + /** + * Set body + * @param body Service Payload. (required) + * @return APIupdateServiceRequest + */ + public APIupdateServiceRequest body(ServiceUpdateRequest body) { + this.body = body; + return this; + } + + /** + * Execute updateService request + * @return ServiceResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public ServiceResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateService request with HTTP info returned + * @return ApiResponse<ServiceResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateServiceWithHttpInfo(serviceId, body); + } + } + + /** + * Update an existing service + * Updates an existing service. Only provide the attributes which should be updated as this request is a partial update. + * @param serviceId The ID of the service. (required) + * @return updateServiceRequest + * @throws ApiException if fails to make API call + + + */ + public APIupdateServiceRequest updateService(String serviceId) throws ApiException { + String operationId = "updateService"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIupdateServiceRequest(serviceId); + } +} diff --git a/src/main/java/com/datadog/api/v2/client/api/TeamsApi.java b/src/main/java/com/datadog/api/v2/client/api/TeamsApi.java new file mode 100644 index 00000000000..b73d9126c43 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/api/TeamsApi.java @@ -0,0 +1,662 @@ +package com.datadog.api.v2.client.api; + +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiResponse; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.Pair; + +import javax.ws.rs.core.GenericType; + +import com.datadog.api.v2.client.model.APIErrorResponse; +import com.datadog.api.v2.client.model.TeamCreateRequest; +import com.datadog.api.v2.client.model.TeamResponse; +import com.datadog.api.v2.client.model.TeamUpdateRequest; +import com.datadog.api.v2.client.model.TeamsResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamsApi { + private ApiClient apiClient; + + public TeamsApi() { + this(Configuration.getDefaultApiClient()); + } + + public TeamsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + +private ApiResponse createTeamWithHttpInfo(TeamCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createTeam"); + } + + // create path and map variables + String localVarPath = "/api/v2/teams"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "createTeam"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("TeamsApi.createTeam", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIcreateTeamRequest { + private TeamCreateRequest body; + + private APIcreateTeamRequest() { + } + + /** + * Set body + * @param body Teams Payload. (required) + * @return APIcreateTeamRequest + */ + public APIcreateTeamRequest body(TeamCreateRequest body) { + this.body = body; + return this; + } + + /** + * Execute createTeam request + * @return TeamResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public TeamResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createTeam request with HTTP info returned + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
201 CREATED -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createTeamWithHttpInfo(body); + } + } + + /** + * Create a new team + * Creates a new team. + * @return createTeamRequest + * @throws ApiException if fails to make API call + + + */ + public APIcreateTeamRequest createTeam() throws ApiException { + String operationId = "createTeam"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIcreateTeamRequest(); + } + +private ApiResponse deleteTeamWithHttpInfo(String teamId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling deleteTeam"); + } + + // create path and map variables + String localVarPath = "/api/v2/teams/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "deleteTeam"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + return apiClient.invokeAPI("TeamsApi.deleteTeam", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, false); + } + + public class APIdeleteTeamRequest { + private String teamId; + + private APIdeleteTeamRequest(String teamId) { + this.teamId = teamId; + } + + /** + * Execute deleteTeam request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute deleteTeam request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteTeamWithHttpInfo(teamId); + } + } + + /** + * Delete an existing team + * Deletes an existing team. + * @param teamId The ID of the team. (required) + * @return deleteTeamRequest + * @throws ApiException if fails to make API call + + + */ + public APIdeleteTeamRequest deleteTeam(String teamId) throws ApiException { + String operationId = "deleteTeam"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIdeleteTeamRequest(teamId); + } + +private ApiResponse getTeamWithHttpInfo(String teamId, String include) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling getTeam"); + } + + // create path and map variables + String localVarPath = "/api/v2/teams/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "getTeam"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("TeamsApi.getTeam", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIgetTeamRequest { + private String teamId; + private String include; + + private APIgetTeamRequest(String teamId) { + this.teamId = teamId; + } + + /** + * Set include + * @param include Specifies which types of related objects should be included in the response. (optional) + * @return APIgetTeamRequest + */ + public APIgetTeamRequest include(String include) { + this.include = include; + return this; + } + + /** + * Execute getTeam request + * @return TeamResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public TeamResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getTeam request with HTTP info returned + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTeamWithHttpInfo(teamId, include); + } + } + + /** + * Get details of a team + * Get details of a team. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + * @param teamId The ID of the team. (required) + * @return getTeamRequest + * @throws ApiException if fails to make API call + + + */ + public APIgetTeamRequest getTeam(String teamId) throws ApiException { + String operationId = "getTeam"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIgetTeamRequest(teamId); + } + +private ApiResponse getTeamsWithHttpInfo(String include, Long pageSize, Long pageOffset) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v2/teams"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "getTeams"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("TeamsApi.getTeams", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIgetTeamsRequest { + private String include; + private Long pageSize; + private Long pageOffset; + + private APIgetTeamsRequest() { + } + + /** + * Set include + * @param include Specifies which types of related objects should be included in the response. (optional) + * @return APIgetTeamsRequest + */ + public APIgetTeamsRequest include(String include) { + this.include = include; + return this; + } + + /** + * Set pageSize + * @param pageSize Size for a given page. (optional, default to 10l) + * @return APIgetTeamsRequest + */ + public APIgetTeamsRequest pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageOffset + * @param pageOffset Specific offset to use as the beginning of the returned page. (optional, default to 0l) + * @return APIgetTeamsRequest + */ + public APIgetTeamsRequest pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Execute getTeams request + * @return TeamsResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public TeamsResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getTeams request with HTTP info returned + * @return ApiResponse<TeamsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getTeamsWithHttpInfo(include, pageSize, pageOffset); + } + } + + /** + * Get a list of all teams + * Get all teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + * @return getTeamsRequest + * @throws ApiException if fails to make API call + + + */ + public APIgetTeamsRequest getTeams() throws ApiException { + String operationId = "getTeams"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIgetTeamsRequest(); + } + +private ApiResponse updateTeamWithHttpInfo(String teamId, TeamUpdateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException(400, "Missing the required parameter 'teamId' when calling updateTeam"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateTeam"); + } + + // create path and map variables + String localVarPath = "/api/v2/teams/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "updateTeam"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("TeamsApi.updateTeam", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } + + public class APIupdateTeamRequest { + private String teamId; + private TeamUpdateRequest body; + + private APIupdateTeamRequest(String teamId) { + this.teamId = teamId; + } + + /** + * Set body + * @param body Teams Payload. (required) + * @return APIupdateTeamRequest + */ + public APIupdateTeamRequest body(TeamUpdateRequest body) { + this.body = body; + return this; + } + + /** + * Execute updateTeam request + * @return TeamResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + + public TeamResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateTeam request with HTTP info returned + * @return ApiResponse<TeamResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateTeamWithHttpInfo(teamId, body); + } + } + + /** + * Update an existing team + * Updates an existing team. Only provide the attributes which should be updated as this request is a partial update. + * @param teamId The ID of the team. (required) + * @return updateTeamRequest + * @throws ApiException if fails to make API call + + + */ + public APIupdateTeamRequest updateTeam(String teamId) throws ApiException { + String operationId = "updateTeam"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIupdateTeamRequest(teamId); + } +} diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceCreateAttributes.java b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateAttributes.java new file mode 100644 index 00000000000..8540f7557fe --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateAttributes.java @@ -0,0 +1,107 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The service's attributes for a create request. + */ +@ApiModel(description = "The service's attributes for a create request.") +@JsonPropertyOrder({ + ServiceCreateAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceCreateAttributes { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public ServiceCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the service. + * @return name + **/ + @ApiModelProperty(example = "an example service name", required = true, value = "Name of the service.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this ServiceCreateAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceCreateAttributes serviceCreateAttributes = (ServiceCreateAttributes) o; + return Objects.equals(this.name, serviceCreateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceCreateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceCreateData.java b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateData.java new file mode 100644 index 00000000000..800dcd06d7a --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateData.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceCreateAttributes; +import com.datadog.api.v2.client.model.ServiceRelationships; +import com.datadog.api.v2.client.model.ServiceType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Service payload for create requests. + */ +@ApiModel(description = "Service payload for create requests.") +@JsonPropertyOrder({ + ServiceCreateData.JSON_PROPERTY_ATTRIBUTES, + ServiceCreateData.JSON_PROPERTY_RELATIONSHIPS, + ServiceCreateData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceCreateData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceCreateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ServiceRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceType type = ServiceType.SERVICES; + + + public ServiceCreateData attributes(ServiceCreateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceCreateAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(ServiceCreateAttributes attributes) { + this.attributes = attributes; + } + + + public ServiceCreateData relationships(ServiceRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(ServiceRelationships relationships) { + this.relationships = relationships; + } + + + public ServiceCreateData type(ServiceType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceType getType() { + return type; + } + + + public void setType(ServiceType type) { + this.type = type; + } + + + /** + * Return true if this ServiceCreateData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceCreateData serviceCreateData = (ServiceCreateData) o; + return Objects.equals(this.attributes, serviceCreateData.attributes) && + Objects.equals(this.relationships, serviceCreateData.relationships) && + Objects.equals(this.type, serviceCreateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceCreateRequest.java b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateRequest.java new file mode 100644 index 00000000000..d582610788b --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceCreateRequest.java @@ -0,0 +1,108 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceCreateData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Create request with a service payload. + */ +@ApiModel(description = "Create request with a service payload.") +@JsonPropertyOrder({ + ServiceCreateRequest.JSON_PROPERTY_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceCreateRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceCreateData data; + + + public ServiceCreateRequest data(ServiceCreateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceCreateData getData() { + return data; + } + + + public void setData(ServiceCreateData data) { + this.data = data; + } + + + /** + * Return true if this ServiceCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceCreateRequest serviceCreateRequest = (ServiceCreateRequest) o; + return Objects.equals(this.data, serviceCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceIncludedItems.java b/src/main/java/com/datadog/api/v2/client/model/ServiceIncludedItems.java new file mode 100644 index 00000000000..5c11c7baafb --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceIncludedItems.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.User; +import com.datadog.api.v2.client.model.UserAttributes; +import com.datadog.api.v2.client.model.UserResponseRelationships; +import com.datadog.api.v2.client.model.UsersType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + +import com.fasterxml.jackson.core.type.TypeReference; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.datadog.api.v2.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonDeserialize(using = ServiceIncludedItems.ServiceIncludedItemsDeserializer.class) +@JsonSerialize(using = ServiceIncludedItems.ServiceIncludedItemsSerializer.class) +public class ServiceIncludedItems extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ServiceIncludedItems.class.getName()); + + public static class ServiceIncludedItemsSerializer extends StdSerializer { + public ServiceIncludedItemsSerializer(Class t) { + super(t); + } + + public ServiceIncludedItemsSerializer() { + this(null); + } + + @Override + public void serialize(ServiceIncludedItems value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ServiceIncludedItemsDeserializer extends StdDeserializer { + public ServiceIncludedItemsDeserializer() { + this(ServiceIncludedItems.class); + } + + public ServiceIncludedItemsDeserializer(Class vc) { + super(vc); + } + + @Override + public ServiceIncludedItems deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize User + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (User.class.equals(Integer.class) || User.class.equals(Long.class) || User.class.equals(Float.class) || User.class.equals(Double.class) || User.class.equals(Boolean.class) || User.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((User.class.equals(Integer.class) || User.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((User.class.equals(Float.class) || User.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (User.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (User.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(User.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'User'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'User'", e); + } + + if (match == 1) { + ServiceIncludedItems ret = new ServiceIncludedItems(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for ServiceIncludedItems: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public ServiceIncludedItems getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "ServiceIncludedItems cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public ServiceIncludedItems() { + super("oneOf", Boolean.FALSE); + } + + public ServiceIncludedItems(User o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("User", new GenericType() { + }); + JSON.registerDescendants(ServiceIncludedItems.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ServiceIncludedItems.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * User + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(User.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be User"); + } + + /** + * Get the actual instance, which can be the following: + * User + * + * @return The actual instance (User) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `User`. If the actual instanct is not `User`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `User` + * @throws ClassCastException if the instance is not `User` + */ + public User getUser() throws ClassCastException { + return (User)super.getActualInstance(); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceRelationships.java b/src/main/java/com/datadog/api/v2/client/model/ServiceRelationships.java new file mode 100644 index 00000000000..25635c382a8 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceRelationships.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.UserRelationship; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The service's relationships. + */ +@ApiModel(description = "The service's relationships.") +@JsonPropertyOrder({ + ServiceRelationships.JSON_PROPERTY_CREATED_BY, + ServiceRelationships.JSON_PROPERTY_LAST_MODIFIED_BY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceRelationships { + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private UserRelationship createdBy; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY = "last_modified_by"; + private UserRelationship lastModifiedBy; + + + public ServiceRelationships createdBy(UserRelationship createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserRelationship getCreatedBy() { + return createdBy; + } + + + public void setCreatedBy(UserRelationship createdBy) { + this.createdBy = createdBy; + } + + + public ServiceRelationships lastModifiedBy(UserRelationship lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get lastModifiedBy + * @return lastModifiedBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserRelationship getLastModifiedBy() { + return lastModifiedBy; + } + + + public void setLastModifiedBy(UserRelationship lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + + /** + * Return true if this ServiceRelationships object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceRelationships serviceRelationships = (ServiceRelationships) o; + return Objects.equals(this.createdBy, serviceRelationships.createdBy) && + Objects.equals(this.lastModifiedBy, serviceRelationships.lastModifiedBy); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, lastModifiedBy); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" lastModifiedBy: ").append(toIndentedString(lastModifiedBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceResponse.java b/src/main/java/com/datadog/api/v2/client/model/ServiceResponse.java new file mode 100644 index 00000000000..e9be48f0afe --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceResponse.java @@ -0,0 +1,133 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceIncludedItems; +import com.datadog.api.v2.client.model.ServiceResponseData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Response with a service payload. + */ +@ApiModel(description = "Response with a service payload.") +@JsonPropertyOrder({ + ServiceResponse.JSON_PROPERTY_DATA, + ServiceResponse.JSON_PROPERTY_INCLUDED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceResponseData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + + public ServiceResponse data(ServiceResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceResponseData getData() { + return data; + } + + + public void setData(ServiceResponseData data) { + this.data = data; + } + + + /** + * Included objects from relationships. + * @return included + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Included objects from relationships.") + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIncluded() { + return included; + } + + + + + /** + * Return true if this ServiceResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceResponse serviceResponse = (ServiceResponse) o; + return Objects.equals(this.data, serviceResponse.data) && + Objects.equals(this.included, serviceResponse.included); + } + + @Override + public int hashCode() { + return Objects.hash(data, included); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceResponseAttributes.java b/src/main/java/com/datadog/api/v2/client/model/ServiceResponseAttributes.java new file mode 100644 index 00000000000..80373e14899 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceResponseAttributes.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The service's attributes from a response. + */ +@ApiModel(description = "The service's attributes from a response.") +@JsonPropertyOrder({ + ServiceResponseAttributes.JSON_PROPERTY_CREATED, + ServiceResponseAttributes.JSON_PROPERTY_MODIFIED, + ServiceResponseAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceResponseAttributes { + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + /** + * Timestamp of when the service was created. + * @return created + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timestamp of when the service was created.") + @JsonProperty(JSON_PROPERTY_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreated() { + return created; + } + + + + + /** + * Timestamp of when the service was modified. + * @return modified + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timestamp of when the service was modified.") + @JsonProperty(JSON_PROPERTY_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getModified() { + return modified; + } + + + + + public ServiceResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the service. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "service name", value = "Name of the service.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this ServiceResponseAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceResponseAttributes serviceResponseAttributes = (ServiceResponseAttributes) o; + return Objects.equals(this.created, serviceResponseAttributes.created) && + Objects.equals(this.modified, serviceResponseAttributes.modified) && + Objects.equals(this.name, serviceResponseAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(created, modified, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceResponseAttributes {\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceResponseData.java b/src/main/java/com/datadog/api/v2/client/model/ServiceResponseData.java new file mode 100644 index 00000000000..3b763caa44d --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceResponseData.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceRelationships; +import com.datadog.api.v2.client.model.ServiceResponseAttributes; +import com.datadog.api.v2.client.model.ServiceType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Service data from responses. + */ +@ApiModel(description = "Service data from responses.") +@JsonPropertyOrder({ + ServiceResponseData.JSON_PROPERTY_ATTRIBUTES, + ServiceResponseData.JSON_PROPERTY_ID, + ServiceResponseData.JSON_PROPERTY_RELATIONSHIPS, + ServiceResponseData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceResponseData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ServiceRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceType type = ServiceType.SERVICES; + + + public ServiceResponseData attributes(ServiceResponseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceResponseAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(ServiceResponseAttributes attributes) { + this.attributes = attributes; + } + + + public ServiceResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The service's ID. + * @return id + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "The service's ID.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ServiceResponseData relationships(ServiceRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(ServiceRelationships relationships) { + this.relationships = relationships; + } + + + public ServiceResponseData type(ServiceType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceType getType() { + return type; + } + + + public void setType(ServiceType type) { + this.type = type; + } + + + /** + * Return true if this ServiceResponseData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceResponseData serviceResponseData = (ServiceResponseData) o; + return Objects.equals(this.attributes, serviceResponseData.attributes) && + Objects.equals(this.id, serviceResponseData.id) && + Objects.equals(this.relationships, serviceResponseData.relationships) && + Objects.equals(this.type, serviceResponseData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceType.java b/src/main/java/com/datadog/api/v2/client/model/ServiceType.java new file mode 100644 index 00000000000..d411db6e92c --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Service resource type. + */ +public enum ServiceType { + + SERVICES("services"); + + private String value; + + ServiceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ServiceType fromValue(String value) { + for (ServiceType b : ServiceType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateAttributes.java b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateAttributes.java new file mode 100644 index 00000000000..61e6323f56e --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateAttributes.java @@ -0,0 +1,107 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The service's attributes for an update request. + */ +@ApiModel(description = "The service's attributes for an update request.") +@JsonPropertyOrder({ + ServiceUpdateAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceUpdateAttributes { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public ServiceUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the service. + * @return name + **/ + @ApiModelProperty(example = "an example service name", required = true, value = "Name of the service.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this ServiceUpdateAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceUpdateAttributes serviceUpdateAttributes = (ServiceUpdateAttributes) o; + return Objects.equals(this.name, serviceUpdateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceUpdateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateData.java b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateData.java new file mode 100644 index 00000000000..873411d8f13 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateData.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceRelationships; +import com.datadog.api.v2.client.model.ServiceType; +import com.datadog.api.v2.client.model.ServiceUpdateAttributes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Service payload for update requests. + */ +@ApiModel(description = "Service payload for update requests.") +@JsonPropertyOrder({ + ServiceUpdateData.JSON_PROPERTY_ATTRIBUTES, + ServiceUpdateData.JSON_PROPERTY_ID, + ServiceUpdateData.JSON_PROPERTY_RELATIONSHIPS, + ServiceUpdateData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceUpdateData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ServiceUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private ServiceRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ServiceType type = ServiceType.SERVICES; + + + public ServiceUpdateData attributes(ServiceUpdateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceUpdateAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(ServiceUpdateAttributes attributes) { + this.attributes = attributes; + } + + + public ServiceUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The service's ID. + * @return id + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "The service's ID.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ServiceUpdateData relationships(ServiceRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServiceRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(ServiceRelationships relationships) { + this.relationships = relationships; + } + + + public ServiceUpdateData type(ServiceType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceType getType() { + return type; + } + + + public void setType(ServiceType type) { + this.type = type; + } + + + /** + * Return true if this ServiceUpdateData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceUpdateData serviceUpdateData = (ServiceUpdateData) o; + return Objects.equals(this.attributes, serviceUpdateData.attributes) && + Objects.equals(this.id, serviceUpdateData.id) && + Objects.equals(this.relationships, serviceUpdateData.relationships) && + Objects.equals(this.type, serviceUpdateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateRequest.java b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateRequest.java new file mode 100644 index 00000000000..cf238c1362e --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServiceUpdateRequest.java @@ -0,0 +1,108 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceUpdateData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Update request with a service payload. + */ +@ApiModel(description = "Update request with a service payload.") +@JsonPropertyOrder({ + ServiceUpdateRequest.JSON_PROPERTY_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServiceUpdateRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private ServiceUpdateData data; + + + public ServiceUpdateRequest data(ServiceUpdateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ServiceUpdateData getData() { + return data; + } + + + public void setData(ServiceUpdateData data) { + this.data = data; + } + + + /** + * Return true if this ServiceUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceUpdateRequest serviceUpdateRequest = (ServiceUpdateRequest) o; + return Objects.equals(this.data, serviceUpdateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServicesResponse.java b/src/main/java/com/datadog/api/v2/client/model/ServicesResponse.java new file mode 100644 index 00000000000..7501483bc4a --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServicesResponse.java @@ -0,0 +1,169 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServiceIncludedItems; +import com.datadog.api.v2.client.model.ServiceResponseData; +import com.datadog.api.v2.client.model.ServicesResponseMeta; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Response with a list of service payloads. + */ +@ApiModel(description = "Response with a list of service payloads.") +@JsonPropertyOrder({ + ServicesResponse.JSON_PROPERTY_DATA, + ServicesResponse.JSON_PROPERTY_INCLUDED, + ServicesResponse.JSON_PROPERTY_META +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServicesResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private ServicesResponseMeta meta; + + + public ServicesResponse data(List data) { + this.data = data; + return this; + } + + public ServicesResponse addDataItem(ServiceResponseData dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * An array of services. + * @return data + **/ + @ApiModelProperty(required = true, value = "An array of services.") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + /** + * Included related resources which the user requested. + * @return included + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Included related resources which the user requested.") + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIncluded() { + return included; + } + + + + + public ServicesResponse meta(ServicesResponseMeta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesResponseMeta getMeta() { + return meta; + } + + + public void setMeta(ServicesResponseMeta meta) { + this.meta = meta; + } + + + /** + * Return true if this ServicesResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesResponse servicesResponse = (ServicesResponse) o; + return Objects.equals(this.data, servicesResponse.data) && + Objects.equals(this.included, servicesResponse.included) && + Objects.equals(this.meta, servicesResponse.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMeta.java b/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMeta.java new file mode 100644 index 00000000000..9f0002dd0be --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMeta.java @@ -0,0 +1,109 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServicesResponseMetaPagination; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The metadata object containing pagination metadata. + */ +@ApiModel(description = "The metadata object containing pagination metadata.") +@JsonPropertyOrder({ + ServicesResponseMeta.JSON_PROPERTY_PAGINATION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServicesResponseMeta { + public static final String JSON_PROPERTY_PAGINATION = "pagination"; + private ServicesResponseMetaPagination pagination; + + + public ServicesResponseMeta pagination(ServicesResponseMetaPagination pagination) { + this.pagination = pagination; + return this; + } + + /** + * Get pagination + * @return pagination + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PAGINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesResponseMetaPagination getPagination() { + return pagination; + } + + + public void setPagination(ServicesResponseMetaPagination pagination) { + this.pagination = pagination; + } + + + /** + * Return true if this ServicesResponse_meta object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesResponseMeta servicesResponseMeta = (ServicesResponseMeta) o; + return Objects.equals(this.pagination, servicesResponseMeta.pagination); + } + + @Override + public int hashCode() { + return Objects.hash(pagination); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesResponseMeta {\n"); + sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMetaPagination.java b/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMetaPagination.java new file mode 100644 index 00000000000..55dfc0da8b5 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/ServicesResponseMetaPagination.java @@ -0,0 +1,168 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Pagination properties. + */ +@ApiModel(description = "Pagination properties.") +@JsonPropertyOrder({ + ServicesResponseMetaPagination.JSON_PROPERTY_NEXT_OFFSET, + ServicesResponseMetaPagination.JSON_PROPERTY_OFFSET, + ServicesResponseMetaPagination.JSON_PROPERTY_SIZE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ServicesResponseMetaPagination { + public static final String JSON_PROPERTY_NEXT_OFFSET = "next_offset"; + private Long nextOffset; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + + public ServicesResponseMetaPagination nextOffset(Long nextOffset) { + this.nextOffset = nextOffset; + return this; + } + + /** + * The index of the first element in the next page of results. Equal to page size added to the current offset. + * @return nextOffset + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1000", value = "The index of the first element in the next page of results. Equal to page size added to the current offset.") + @JsonProperty(JSON_PROPERTY_NEXT_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getNextOffset() { + return nextOffset; + } + + + public void setNextOffset(Long nextOffset) { + this.nextOffset = nextOffset; + } + + + public ServicesResponseMetaPagination offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * The index of the first element in the results. + * @return offset + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10", value = "The index of the first element in the results.") + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getOffset() { + return offset; + } + + + public void setOffset(Long offset) { + this.offset = offset; + } + + + public ServicesResponseMetaPagination size(Long size) { + this.size = size; + return this; + } + + /** + * Maximum size of pages to return. + * @return size + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1000", value = "Maximum size of pages to return.") + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getSize() { + return size; + } + + + public void setSize(Long size) { + this.size = size; + } + + + /** + * Return true if this ServicesResponse_meta_pagination object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServicesResponseMetaPagination servicesResponseMetaPagination = (ServicesResponseMetaPagination) o; + return Objects.equals(this.nextOffset, servicesResponseMetaPagination.nextOffset) && + Objects.equals(this.offset, servicesResponseMetaPagination.offset) && + Objects.equals(this.size, servicesResponseMetaPagination.size); + } + + @Override + public int hashCode() { + return Objects.hash(nextOffset, offset, size); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServicesResponseMetaPagination {\n"); + sb.append(" nextOffset: ").append(toIndentedString(nextOffset)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamCreateAttributes.java b/src/main/java/com/datadog/api/v2/client/model/TeamCreateAttributes.java new file mode 100644 index 00000000000..88aaf766ba8 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamCreateAttributes.java @@ -0,0 +1,107 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The team's attributes for a create request. + */ +@ApiModel(description = "The team's attributes for a create request.") +@JsonPropertyOrder({ + TeamCreateAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamCreateAttributes { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public TeamCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the team. + * @return name + **/ + @ApiModelProperty(example = "team name", required = true, value = "Name of the team.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this TeamCreateAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateAttributes teamCreateAttributes = (TeamCreateAttributes) o; + return Objects.equals(this.name, teamCreateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamCreateData.java b/src/main/java/com/datadog/api/v2/client/model/TeamCreateData.java new file mode 100644 index 00000000000..5aa4499c084 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamCreateData.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamCreateAttributes; +import com.datadog.api.v2.client.model.TeamRelationships; +import com.datadog.api.v2.client.model.TeamType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Team data for a create request. + */ +@ApiModel(description = "Team data for a create request.") +@JsonPropertyOrder({ + TeamCreateData.JSON_PROPERTY_ATTRIBUTES, + TeamCreateData.JSON_PROPERTY_RELATIONSHIPS, + TeamCreateData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamCreateData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamCreateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAMS; + + + public TeamCreateData attributes(TeamCreateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamCreateAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(TeamCreateAttributes attributes) { + this.attributes = attributes; + } + + + public TeamCreateData relationships(TeamRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(TeamRelationships relationships) { + this.relationships = relationships; + } + + + public TeamCreateData type(TeamType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamType getType() { + return type; + } + + + public void setType(TeamType type) { + this.type = type; + } + + + /** + * Return true if this TeamCreateData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateData teamCreateData = (TeamCreateData) o; + return Objects.equals(this.attributes, teamCreateData.attributes) && + Objects.equals(this.relationships, teamCreateData.relationships) && + Objects.equals(this.type, teamCreateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamCreateRequest.java b/src/main/java/com/datadog/api/v2/client/model/TeamCreateRequest.java new file mode 100644 index 00000000000..a2b1ca8aa3d --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamCreateRequest.java @@ -0,0 +1,108 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamCreateData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Create request with a team payload. + */ +@ApiModel(description = "Create request with a team payload.") +@JsonPropertyOrder({ + TeamCreateRequest.JSON_PROPERTY_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamCreateRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private TeamCreateData data; + + + public TeamCreateRequest data(TeamCreateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamCreateData getData() { + return data; + } + + + public void setData(TeamCreateData data) { + this.data = data; + } + + + /** + * Return true if this TeamCreateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamCreateRequest teamCreateRequest = (TeamCreateRequest) o; + return Objects.equals(this.data, teamCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamIncludedItems.java b/src/main/java/com/datadog/api/v2/client/model/TeamIncludedItems.java new file mode 100644 index 00000000000..ad3b755821f --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamIncludedItems.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.User; +import com.datadog.api.v2.client.model.UserAttributes; +import com.datadog.api.v2.client.model.UserResponseRelationships; +import com.datadog.api.v2.client.model.UsersType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + +import com.fasterxml.jackson.core.type.TypeReference; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.datadog.api.v2.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonDeserialize(using = TeamIncludedItems.TeamIncludedItemsDeserializer.class) +@JsonSerialize(using = TeamIncludedItems.TeamIncludedItemsSerializer.class) +public class TeamIncludedItems extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(TeamIncludedItems.class.getName()); + + public static class TeamIncludedItemsSerializer extends StdSerializer { + public TeamIncludedItemsSerializer(Class t) { + super(t); + } + + public TeamIncludedItemsSerializer() { + this(null); + } + + @Override + public void serialize(TeamIncludedItems value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TeamIncludedItemsDeserializer extends StdDeserializer { + public TeamIncludedItemsDeserializer() { + this(TeamIncludedItems.class); + } + + public TeamIncludedItemsDeserializer(Class vc) { + super(vc); + } + + @Override + public TeamIncludedItems deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize User + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (User.class.equals(Integer.class) || User.class.equals(Long.class) || User.class.equals(Float.class) || User.class.equals(Double.class) || User.class.equals(Boolean.class) || User.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((User.class.equals(Integer.class) || User.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((User.class.equals(Float.class) || User.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (User.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (User.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(User.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'User'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'User'", e); + } + + if (match == 1) { + TeamIncludedItems ret = new TeamIncludedItems(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for TeamIncludedItems: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public TeamIncludedItems getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "TeamIncludedItems cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public TeamIncludedItems() { + super("oneOf", Boolean.FALSE); + } + + public TeamIncludedItems(User o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("User", new GenericType() { + }); + JSON.registerDescendants(TeamIncludedItems.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return TeamIncludedItems.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * User + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(User.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be User"); + } + + /** + * Get the actual instance, which can be the following: + * User + * + * @return The actual instance (User) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `User`. If the actual instanct is not `User`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `User` + * @throws ClassCastException if the instance is not `User` + */ + public User getUser() throws ClassCastException { + return (User)super.getActualInstance(); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamRelationships.java b/src/main/java/com/datadog/api/v2/client/model/TeamRelationships.java new file mode 100644 index 00000000000..bb0a8abd2e5 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamRelationships.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.UserRelationship; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The team's relationships. + */ +@ApiModel(description = "The team's relationships.") +@JsonPropertyOrder({ + TeamRelationships.JSON_PROPERTY_CREATED_BY, + TeamRelationships.JSON_PROPERTY_LAST_MODIFIED_BY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamRelationships { + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private UserRelationship createdBy; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY = "last_modified_by"; + private UserRelationship lastModifiedBy; + + + public TeamRelationships createdBy(UserRelationship createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get createdBy + * @return createdBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserRelationship getCreatedBy() { + return createdBy; + } + + + public void setCreatedBy(UserRelationship createdBy) { + this.createdBy = createdBy; + } + + + public TeamRelationships lastModifiedBy(UserRelationship lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get lastModifiedBy + * @return lastModifiedBy + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserRelationship getLastModifiedBy() { + return lastModifiedBy; + } + + + public void setLastModifiedBy(UserRelationship lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + } + + + /** + * Return true if this TeamRelationships object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamRelationships teamRelationships = (TeamRelationships) o; + return Objects.equals(this.createdBy, teamRelationships.createdBy) && + Objects.equals(this.lastModifiedBy, teamRelationships.lastModifiedBy); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, lastModifiedBy); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" lastModifiedBy: ").append(toIndentedString(lastModifiedBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamResponse.java b/src/main/java/com/datadog/api/v2/client/model/TeamResponse.java new file mode 100644 index 00000000000..4e3629ea930 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamResponse.java @@ -0,0 +1,133 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamIncludedItems; +import com.datadog.api.v2.client.model.TeamResponseData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Response with a team payload. + */ +@ApiModel(description = "Response with a team payload.") +@JsonPropertyOrder({ + TeamResponse.JSON_PROPERTY_DATA, + TeamResponse.JSON_PROPERTY_INCLUDED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private TeamResponseData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + + public TeamResponse data(TeamResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamResponseData getData() { + return data; + } + + + public void setData(TeamResponseData data) { + this.data = data; + } + + + /** + * Included objects from relationships. + * @return included + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Included objects from relationships.") + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIncluded() { + return included; + } + + + + + /** + * Return true if this TeamResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamResponse teamResponse = (TeamResponse) o; + return Objects.equals(this.data, teamResponse.data) && + Objects.equals(this.included, teamResponse.included); + } + + @Override + public int hashCode() { + return Objects.hash(data, included); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamResponseAttributes.java b/src/main/java/com/datadog/api/v2/client/model/TeamResponseAttributes.java new file mode 100644 index 00000000000..7689f54dfa9 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamResponseAttributes.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The team's attributes from a response. + */ +@ApiModel(description = "The team's attributes from a response.") +@JsonPropertyOrder({ + TeamResponseAttributes.JSON_PROPERTY_CREATED, + TeamResponseAttributes.JSON_PROPERTY_MODIFIED, + TeamResponseAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamResponseAttributes { + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + /** + * Timestamp of when the team was created. + * @return created + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timestamp of when the team was created.") + @JsonProperty(JSON_PROPERTY_CREATED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getCreated() { + return created; + } + + + + + /** + * Timestamp of when the team was modified. + * @return modified + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Timestamp of when the team was modified.") + @JsonProperty(JSON_PROPERTY_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getModified() { + return modified; + } + + + + + public TeamResponseAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the team. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "team name", value = "Name of the team.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this TeamResponseAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamResponseAttributes teamResponseAttributes = (TeamResponseAttributes) o; + return Objects.equals(this.created, teamResponseAttributes.created) && + Objects.equals(this.modified, teamResponseAttributes.modified) && + Objects.equals(this.name, teamResponseAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(created, modified, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponseAttributes {\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamResponseData.java b/src/main/java/com/datadog/api/v2/client/model/TeamResponseData.java new file mode 100644 index 00000000000..7a435a61785 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamResponseData.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamRelationships; +import com.datadog.api.v2.client.model.TeamResponseAttributes; +import com.datadog.api.v2.client.model.TeamType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Team data from a response. + */ +@ApiModel(description = "Team data from a response.") +@JsonPropertyOrder({ + TeamResponseData.JSON_PROPERTY_ATTRIBUTES, + TeamResponseData.JSON_PROPERTY_ID, + TeamResponseData.JSON_PROPERTY_RELATIONSHIPS, + TeamResponseData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamResponseData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAMS; + + + public TeamResponseData attributes(TeamResponseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamResponseAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(TeamResponseAttributes attributes) { + this.attributes = attributes; + } + + + public TeamResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The team's ID. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "The team's ID.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TeamResponseData relationships(TeamRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(TeamRelationships relationships) { + this.relationships = relationships; + } + + + public TeamResponseData type(TeamType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamType getType() { + return type; + } + + + public void setType(TeamType type) { + this.type = type; + } + + + /** + * Return true if this TeamResponseData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamResponseData teamResponseData = (TeamResponseData) o; + return Objects.equals(this.attributes, teamResponseData.attributes) && + Objects.equals(this.id, teamResponseData.id) && + Objects.equals(this.relationships, teamResponseData.relationships) && + Objects.equals(this.type, teamResponseData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamType.java b/src/main/java/com/datadog/api/v2/client/model/TeamType.java new file mode 100644 index 00000000000..f127699f5be --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Team resource type. + */ +public enum TeamType { + + TEAMS("teams"); + + private String value; + + TeamType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TeamType fromValue(String value) { + for (TeamType b : TeamType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamUpdateAttributes.java b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateAttributes.java new file mode 100644 index 00000000000..7bf09630c4c --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateAttributes.java @@ -0,0 +1,107 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The team's attributes for an update request. + */ +@ApiModel(description = "The team's attributes for an update request.") +@JsonPropertyOrder({ + TeamUpdateAttributes.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamUpdateAttributes { + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public TeamUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the team. + * @return name + **/ + @ApiModelProperty(example = "team name", required = true, value = "Name of the team.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + /** + * Return true if this TeamUpdateAttributes object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateAttributes teamUpdateAttributes = (TeamUpdateAttributes) o; + return Objects.equals(this.name, teamUpdateAttributes.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamUpdateData.java b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateData.java new file mode 100644 index 00000000000..8df2ad71ec9 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateData.java @@ -0,0 +1,199 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamRelationships; +import com.datadog.api.v2.client.model.TeamType; +import com.datadog.api.v2.client.model.TeamUpdateAttributes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Team data for an update request. + */ +@ApiModel(description = "Team data for an update request.") +@JsonPropertyOrder({ + TeamUpdateData.JSON_PROPERTY_ATTRIBUTES, + TeamUpdateData.JSON_PROPERTY_ID, + TeamUpdateData.JSON_PROPERTY_RELATIONSHIPS, + TeamUpdateData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamUpdateData { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAMS; + + + public TeamUpdateData attributes(TeamUpdateAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamUpdateAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(TeamUpdateAttributes attributes) { + this.attributes = attributes; + } + + + public TeamUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The team's ID. + * @return id + **/ + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", required = true, value = "The team's ID.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TeamUpdateData relationships(TeamRelationships relationships) { + this.relationships = relationships; + return this; + } + + /** + * Get relationships + * @return relationships + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TeamRelationships getRelationships() { + return relationships; + } + + + public void setRelationships(TeamRelationships relationships) { + this.relationships = relationships; + } + + + public TeamUpdateData type(TeamType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamType getType() { + return type; + } + + + public void setType(TeamType type) { + this.type = type; + } + + + /** + * Return true if this TeamUpdateData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateData teamUpdateData = (TeamUpdateData) o; + return Objects.equals(this.attributes, teamUpdateData.attributes) && + Objects.equals(this.id, teamUpdateData.id) && + Objects.equals(this.relationships, teamUpdateData.relationships) && + Objects.equals(this.type, teamUpdateData.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamUpdateRequest.java b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateRequest.java new file mode 100644 index 00000000000..f39d6a8ae59 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamUpdateRequest.java @@ -0,0 +1,108 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.TeamUpdateData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Update request with a team payload. + */ +@ApiModel(description = "Update request with a team payload.") +@JsonPropertyOrder({ + TeamUpdateRequest.JSON_PROPERTY_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamUpdateRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private TeamUpdateData data; + + + public TeamUpdateRequest data(TeamUpdateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TeamUpdateData getData() { + return data; + } + + + public void setData(TeamUpdateData data) { + this.data = data; + } + + + /** + * Return true if this TeamUpdateRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamUpdateRequest teamUpdateRequest = (TeamUpdateRequest) o; + return Objects.equals(this.data, teamUpdateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/TeamsResponse.java b/src/main/java/com/datadog/api/v2/client/model/TeamsResponse.java new file mode 100644 index 00000000000..f661e750ac3 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/TeamsResponse.java @@ -0,0 +1,169 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.ServicesResponseMeta; +import com.datadog.api.v2.client.model.TeamIncludedItems; +import com.datadog.api.v2.client.model.TeamResponseData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * Response with a list of team payloads. + */ +@ApiModel(description = "Response with a list of team payloads.") +@JsonPropertyOrder({ + TeamsResponse.JSON_PROPERTY_DATA, + TeamsResponse.JSON_PROPERTY_INCLUDED, + TeamsResponse.JSON_PROPERTY_META +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TeamsResponse { + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private ServicesResponseMeta meta; + + + public TeamsResponse data(List data) { + this.data = data; + return this; + } + + public TeamsResponse addDataItem(TeamResponseData dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * An array of teams. + * @return data + **/ + @ApiModelProperty(required = true, value = "An array of teams.") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + /** + * Included related resources which the user requested. + * @return included + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Included related resources which the user requested.") + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIncluded() { + return included; + } + + + + + public TeamsResponse meta(ServicesResponseMeta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ServicesResponseMeta getMeta() { + return meta; + } + + + public void setMeta(ServicesResponseMeta meta) { + this.meta = meta; + } + + + /** + * Return true if this TeamsResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsResponse teamsResponse = (TeamsResponse) o; + return Objects.equals(this.data, teamsResponse.data) && + Objects.equals(this.included, teamsResponse.included) && + Objects.equals(this.meta, teamsResponse.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/UserRelationship.java b/src/main/java/com/datadog/api/v2/client/model/UserRelationship.java new file mode 100644 index 00000000000..654211fe2df --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/UserRelationship.java @@ -0,0 +1,109 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.UserRelationshipData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * A relationship reference for users. + */ +@ApiModel(description = "A relationship reference for users.") +@JsonPropertyOrder({ + UserRelationship.JSON_PROPERTY_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserRelationship { + public static final String JSON_PROPERTY_DATA = "data"; + private UserRelationshipData data; + + + public UserRelationship data(UserRelationshipData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UserRelationshipData getData() { + return data; + } + + + public void setData(UserRelationshipData data) { + this.data = data; + } + + + /** + * Return true if this UserRelationship object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRelationship userRelationship = (UserRelationship) o; + return Objects.equals(this.data, userRelationship.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/UserRelationshipData.java b/src/main/java/com/datadog/api/v2/client/model/UserRelationshipData.java new file mode 100644 index 00000000000..b6dbada2d9b --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/UserRelationshipData.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.datadog.api.v2.client.model.UsersType; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.datadog.api.v2.client.JSON; + + +/** + * The User relationship data. + */ +@ApiModel(description = "The User relationship data.") +@JsonPropertyOrder({ + UserRelationshipData.JSON_PROPERTY_ID, + UserRelationshipData.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class UserRelationshipData { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UsersType type = UsersType.USERS; + + + public UserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * A unique identifier that represents the user. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "00000000-0000-0000-0000-000000000000", value = "A unique identifier that represents the user.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public UserRelationshipData type(UsersType type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UsersType getType() { + return type; + } + + + public void setType(UsersType type) { + this.type = type; + } + + + /** + * Return true if this UserRelationship_data object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRelationshipData userRelationshipData = (UserRelationshipData) o; + return Objects.equals(this.id, userRelationshipData.id) && + Objects.equals(this.type, userRelationshipData.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/openapi.yaml b/src/main/java/com/datadog/api/v2/openapi.yaml index 7a53e0a5f82..8ae8ae20ed2 100644 --- a/src/main/java/com/datadog/api/v2/openapi.yaml +++ b/src/main/java/com/datadog/api/v2/openapi.yaml @@ -20,6 +20,15 @@ components: default: 0 format: int64 type: integer + PageOffset: + description: Specific offset to use as the beginning of the returned page. + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + type: integer PageSize: description: Size for a given page. in: query @@ -43,6 +52,40 @@ components: required: true schema: type: string + ServiceIDPathParameter: + description: The ID of the service. + in: path + name: service_id + required: true + schema: + type: string + ServiceIncludeQueryParameter: + description: Specifies which types of related objects should be included in + the response. + in: query + name: include + required: false + schema: + enum: + - users + type: string + TeamIDPathParameter: + description: The ID of the team. + in: path + name: team_id + required: true + schema: + type: string + TeamIncludeQueryParameter: + description: Specifies which types of related objects should be included in + the response. + in: query + name: include + required: false + schema: + enum: + - users + type: string UserID: description: The ID of the user. in: path @@ -64,6 +107,12 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Concurrent Modification + ForbiddenResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden NotAuthorizedResponse: content: application/json: @@ -76,6 +125,12 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Not Found + UnauthorizedResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Unauthorized schemas: APIErrorResponse: description: API error response. @@ -1991,6 +2046,362 @@ components: x-enum-varnames: - TIMESTAMP_ASCENDING - TIMESTAMP_DESCENDING + ServiceCreateAttributes: + description: The service's attributes for a create request. + properties: + name: + description: Name of the service. + example: an example service name + type: string + required: + - name + type: object + ServiceCreateData: + description: Service payload for create requests. + properties: + attributes: + $ref: '#/components/schemas/ServiceCreateAttributes' + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - type + type: object + ServiceCreateRequest: + description: Create request with a service payload. + properties: + data: + $ref: '#/components/schemas/ServiceCreateData' + required: + - data + type: object + ServiceIncludedItems: + description: An object related to a service which is present in the included + payload. + oneOf: + - $ref: '#/components/schemas/User' + type: object + ServiceRelationships: + description: The service's relationships. + properties: + created_by: + $ref: '#/components/schemas/UserRelationship' + last_modified_by: + $ref: '#/components/schemas/UserRelationship' + readOnly: true + type: object + ServiceResponse: + description: Response with a service payload. + properties: + data: + $ref: '#/components/schemas/ServiceResponseData' + included: + description: Included objects from relationships. + items: + $ref: '#/components/schemas/ServiceIncludedItems' + readOnly: true + type: array + required: + - data + type: object + ServiceResponseAttributes: + description: The service's attributes from a response. + properties: + created: + description: Timestamp of when the service was created. + format: date-time + readOnly: true + type: string + modified: + description: Timestamp of when the service was modified. + format: date-time + readOnly: true + type: string + name: + description: Name of the service. + example: service name + type: string + type: object + ServiceResponseData: + description: Service data from responses. + properties: + attributes: + $ref: '#/components/schemas/ServiceResponseAttributes' + id: + description: The service's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - id + - type + type: object + ServiceType: + default: services + description: Service resource type. + enum: + - services + example: services + type: string + x-enum-varnames: + - SERVICES + ServiceUpdateAttributes: + description: The service's attributes for an update request. + properties: + name: + description: Name of the service. + example: an example service name + type: string + required: + - name + type: object + ServiceUpdateData: + description: Service payload for update requests. + properties: + attributes: + $ref: '#/components/schemas/ServiceUpdateAttributes' + id: + description: The service's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/ServiceRelationships' + type: + $ref: '#/components/schemas/ServiceType' + required: + - id + - type + type: object + ServiceUpdateRequest: + description: Update request with a service payload. + properties: + data: + $ref: '#/components/schemas/ServiceUpdateData' + required: + - data + type: object + ServicesResponse: + description: Response with a list of service payloads. + properties: + data: + description: An array of services. + items: + $ref: '#/components/schemas/ServiceResponseData' + type: array + included: + description: Included related resources which the user requested. + items: + $ref: '#/components/schemas/ServiceIncludedItems' + readOnly: true + type: array + meta: + description: The metadata object containing pagination metadata. + properties: + pagination: + description: Pagination properties. + properties: + next_offset: + description: The index of the first element in the next page of + results. Equal to page size added to the current offset. + example: 1000 + format: int64 + type: integer + offset: + description: The index of the first element in the results. + example: 10 + format: int64 + type: integer + size: + description: Maximum size of pages to return. + example: 1000 + format: int64 + type: integer + type: object + readOnly: true + type: object + required: + - data + type: object + TeamCreateAttributes: + description: The team's attributes for a create request. + properties: + name: + description: Name of the team. + example: team name + type: string + required: + - name + type: object + TeamCreateData: + description: Team data for a create request. + properties: + attributes: + $ref: '#/components/schemas/TeamCreateAttributes' + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' + required: + - type + type: object + TeamCreateRequest: + description: Create request with a team payload. + properties: + data: + $ref: '#/components/schemas/TeamCreateData' + required: + - data + type: object + TeamIncludedItems: + description: An object related to a team which is present in the included payload. + oneOf: + - $ref: '#/components/schemas/User' + type: object + TeamRelationships: + description: The team's relationships. + properties: + created_by: + $ref: '#/components/schemas/UserRelationship' + last_modified_by: + $ref: '#/components/schemas/UserRelationship' + readOnly: true + type: object + TeamResponse: + description: Response with a team payload. + properties: + data: + $ref: '#/components/schemas/TeamResponseData' + included: + description: Included objects from relationships. + items: + $ref: '#/components/schemas/TeamIncludedItems' + readOnly: true + type: array + required: + - data + type: object + TeamResponseAttributes: + description: The team's attributes from a response. + properties: + created: + description: Timestamp of when the team was created. + format: date-time + readOnly: true + type: string + modified: + description: Timestamp of when the team was modified. + format: date-time + readOnly: true + type: string + name: + description: Name of the team. + example: team name + type: string + type: object + TeamResponseData: + description: Team data from a response. + properties: + attributes: + $ref: '#/components/schemas/TeamResponseAttributes' + id: + description: The team's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' + type: object + TeamType: + default: teams + description: Team resource type. + enum: + - teams + example: teams + type: string + x-enum-varnames: + - TEAMS + TeamUpdateAttributes: + description: The team's attributes for an update request. + properties: + name: + description: Name of the team. + example: team name + type: string + required: + - name + type: object + TeamUpdateData: + description: Team data for an update request. + properties: + attributes: + $ref: '#/components/schemas/TeamUpdateAttributes' + id: + description: The team's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/TeamRelationships' + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamUpdateRequest: + description: Update request with a team payload. + properties: + data: + $ref: '#/components/schemas/TeamUpdateData' + required: + - data + type: object + TeamsResponse: + description: Response with a list of team payloads. + properties: + data: + description: An array of teams. + items: + $ref: '#/components/schemas/TeamResponseData' + type: array + included: + description: Included related resources which the user requested. + items: + $ref: '#/components/schemas/TeamIncludedItems' + readOnly: true + type: array + meta: + description: The metadata object containing pagination metadata. + properties: + pagination: + description: Pagination properties. + properties: + next_offset: + description: The index of the first element in the next page of + results. Equal to page size added to the current offset. + example: 1000 + format: int64 + type: integer + offset: + description: The index of the first element in the results. + example: 10 + format: int64 + type: integer + size: + description: Maximum size of pages to return. + example: 1000 + format: int64 + type: integer + type: object + readOnly: true + type: object + required: + - data + type: object User: description: User object returned by the API. properties: @@ -2140,6 +2551,20 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserRelationship: + description: A relationship reference for users. + properties: + data: + description: The User relationship data. + properties: + id: + description: A unique identifier that represents the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UsersType' + type: object + type: object UserRelationships: description: Relationships of the user object. properties: @@ -3523,6 +3948,306 @@ 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/services: + get: + description: Get all services for the requesting user's organization. If the + `include[users]` query parameter is provided, the included attribute will + contain the users related to these services. + operationId: GetServices + parameters: + - $ref: '#/components/parameters/ServiceIncludeQueryParameter' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageOffset' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServicesResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Get a list of all services + tags: + - Services + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Creates a new service. + operationId: CreateService + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreateRequest' + description: Service Payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Create a new service + tags: + - Services + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/services/{service_id}: + delete: + description: Deletes an existing service. + operationId: DeleteService + parameters: + - $ref: '#/components/parameters/ServiceIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Delete an existing service + tags: + - Services + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get details of a service. If the `include[users]` query parameter + is provided, the included attribute will contain the users related to these + services + operationId: GetService + parameters: + - $ref: '#/components/parameters/ServiceIDPathParameter' + - $ref: '#/components/parameters/ServiceIncludeQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Get details of a service + tags: + - Services + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Updates an existing service. Only provide the attributes which + should be updated as this request is a partial update. + operationId: UpdateService + parameters: + - $ref: '#/components/parameters/ServiceIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceUpdateRequest' + description: Service Payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Update an existing service + tags: + - Services + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/teams: + get: + description: Get all teams for the requesting user's organization. If the `include[users]` + query parameter is provided, the included attribute will contain the users + related to these teams. + operationId: GetTeams + parameters: + - $ref: '#/components/parameters/TeamIncludeQueryParameter' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageOffset' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Get a list of all teams + tags: + - Teams + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Creates a new team. + operationId: CreateTeam + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamCreateRequest' + description: Teams Payload. + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + description: CREATED + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Create a new team + tags: + - Teams + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/teams/{team_id}: + delete: + description: Deletes an existing team. + operationId: DeleteTeam + parameters: + - $ref: '#/components/parameters/TeamIDPathParameter' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Delete an existing team + tags: + - Teams + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get details of a team. If the `include[users]` query parameter + is provided, the included attribute will contain the users related to these + teams. + operationId: GetTeam + parameters: + - $ref: '#/components/parameters/TeamIDPathParameter' + - $ref: '#/components/parameters/TeamIncludeQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Get details of a team + tags: + - Teams + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Updates an existing team. Only provide the attributes which should + be updated as this request is a partial update. + operationId: UpdateTeam + parameters: + - $ref: '#/components/parameters/TeamIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamUpdateRequest' + description: Teams Payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + summary: Update an existing team + tags: + - Teams + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. @@ -3905,6 +4630,10 @@ tags: name: Roles - description: Detection rules for generating signals and listing of generated signals name: Security Monitoring +- description: Create, update, delete and retrieve your organizations services. + name: Services +- description: Create, update, delete and retrieve your organizations Teams. + name: Teams - description: Create, edit, and disable users. externalDocs: url: https://docs.datadoghq.com/account_management/users diff --git a/src/test/java/com/datadog/api/v2/client/api/ServicesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/ServicesApiTest.java new file mode 100644 index 00000000000..b96b221a6e6 --- /dev/null +++ b/src/test/java/com/datadog/api/v2/client/api/ServicesApiTest.java @@ -0,0 +1,128 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.api; + +import com.datadog.api.v2.client.*; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.APIErrorResponse; +import com.datadog.api.v2.client.model.ServiceCreateRequest; +import com.datadog.api.v2.client.model.ServiceResponse; +import com.datadog.api.v2.client.model.ServiceUpdateRequest; +import com.datadog.api.v2.client.model.ServicesResponse; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ServicesApi + */ +public class ServicesApiTest { + + private final ServicesApi api = new ServicesApi(); + + /** + * Create a new service + * + * Creates a new service. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createServiceTest() throws ApiException { + //ServiceCreateRequest body = null; + //ServiceResponse response = api.createService() + // .body(body) + // .execute(); + // TODO: test validations + } + + /** + * Delete an existing service + * + * Deletes an existing service. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteServiceTest() throws ApiException { + //String serviceId = null; + //api.deleteService(serviceId) + // .execute(); + // TODO: test validations + } + + /** + * Get details of a service + * + * Get details of a service. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getServiceTest() throws ApiException { + //String serviceId = null; + //String include = null; + //ServiceResponse response = api.getService(serviceId) + // .include(include) + // .execute(); + // TODO: test validations + } + + /** + * Get a list of all services + * + * Get all services for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these services. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getServicesTest() throws ApiException { + //String include = null; + //Long pageSize = null; + //Long pageOffset = null; + //ServicesResponse response = api.getServices() + // .include(include) + // .pageSize(pageSize) + // .pageOffset(pageOffset) + // .execute(); + // TODO: test validations + } + + /** + * Update an existing service + * + * Updates an existing service. Only provide the attributes which should be updated as this request is a partial update. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateServiceTest() throws ApiException { + //String serviceId = null; + //ServiceUpdateRequest body = null; + //ServiceResponse response = api.updateService(serviceId) + // .body(body) + // .execute(); + // TODO: test validations + } + +} diff --git a/src/test/java/com/datadog/api/v2/client/api/TeamsApiTest.java b/src/test/java/com/datadog/api/v2/client/api/TeamsApiTest.java new file mode 100644 index 00000000000..861370dce5b --- /dev/null +++ b/src/test/java/com/datadog/api/v2/client/api/TeamsApiTest.java @@ -0,0 +1,128 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.api; + +import com.datadog.api.v2.client.*; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.model.APIErrorResponse; +import com.datadog.api.v2.client.model.TeamCreateRequest; +import com.datadog.api.v2.client.model.TeamResponse; +import com.datadog.api.v2.client.model.TeamUpdateRequest; +import com.datadog.api.v2.client.model.TeamsResponse; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for TeamsApi + */ +public class TeamsApiTest { + + private final TeamsApi api = new TeamsApi(); + + /** + * Create a new team + * + * Creates a new team. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createTeamTest() throws ApiException { + //TeamCreateRequest body = null; + //TeamResponse response = api.createTeam() + // .body(body) + // .execute(); + // TODO: test validations + } + + /** + * Delete an existing team + * + * Deletes an existing team. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteTeamTest() throws ApiException { + //String teamId = null; + //api.deleteTeam(teamId) + // .execute(); + // TODO: test validations + } + + /** + * Get details of a team + * + * Get details of a team. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTeamTest() throws ApiException { + //String teamId = null; + //String include = null; + //TeamResponse response = api.getTeam(teamId) + // .include(include) + // .execute(); + // TODO: test validations + } + + /** + * Get a list of all teams + * + * Get all teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these teams. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getTeamsTest() throws ApiException { + //String include = null; + //Long pageSize = null; + //Long pageOffset = null; + //TeamsResponse response = api.getTeams() + // .include(include) + // .pageSize(pageSize) + // .pageOffset(pageOffset) + // .execute(); + // TODO: test validations + } + + /** + * Update an existing team + * + * Updates an existing team. Only provide the attributes which should be updated as this request is a partial update. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateTeamTest() throws ApiException { + //String teamId = null; + //TeamUpdateRequest body = null; + //TeamResponse response = api.updateTeam(teamId) + // .body(body) + // .execute(); + // TODO: test validations + } + +}