Skip to content

Commit

Permalink
Regenerate client from commit c445899 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Dec 17, 2021
1 parent d1820ec commit 3fcf3e2
Show file tree
Hide file tree
Showing 23 changed files with 2,306 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-12-16 15:30:43.954966",
"spec_repo_commit": "54aeadc"
"regenerated": "2021-12-17 02:30:03.073899",
"spec_repo_commit": "c445899"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-12-16 15:30:44.876996",
"spec_repo_commit": "54aeadc"
"regenerated": "2021-12-17 02:30:03.962808",
"spec_repo_commit": "c445899"
}
}
}
110 changes: 110 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,45 @@ components:
type: string
x-enum-varnames:
- APPLICATION_KEYS
CloneRole:
description: Data for clone role request
properties:
attributes:
$ref: '#/components/schemas/CloneRoleAttributes'
type:
$ref: '#/components/schemas/CloneRoleType'
required:
- type
- attributes
type: object
CloneRoleAttributes:
description: Attributes required to create a new role by cloning an existing
one
properties:
name:
description: Name of the new role that is cloned
example: cloned-role
type: string
required:
- name
type: object
CloneRoleRequest:
description: Request to create a role by cloning an existing role
properties:
data:
$ref: '#/components/schemas/CloneRole'
required:
- data
type: object
CloneRoleType:
default: clone_role
description: Clone Role type
enum:
- clone_role
example: clone_role
type: string
x-enum-varnames:
- CLONE_ROLE
ContentEncoding:
description: HTTP header used to compress the media-type.
enum:
Expand Down Expand Up @@ -8028,6 +8067,77 @@ paths:
x-menu-order: 4
x-undo:
type: idempotent
/api/v2/roles/{role_id}/clone:
post:
description: Clone an existing role
operationId: CloneRole
parameters:
- $ref: '#/components/parameters/RoleID'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CloneRoleRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RoleResponse'
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
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Conflict
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- user_access_manage
summary: Create a new role by cloning an existing role
tags:
- Roles
x-codegen-request-body-name: body
x-given:
role:
parameters:
- name: role_id
source: role.data.id
- name: body
value: "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{
unique }}\"\n },\n \"type\": \"clone_role\"\n }\n}"
step: there is a valid "role" in the system
x-menu-order: 12
x-permission: OR(USER_ACCESS_MANAGE)
x-undo:
operationId: DeleteRole
parameters:
- name: role_id
source: data.id
type: unsafe
/api/v2/roles/{role_id}/permissions:
delete:
description: Removes a permission from a role.
Expand Down
15 changes: 15 additions & 0 deletions api_docs/v2/CloneRole.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# CloneRole

Data for clone role request

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attributes** | [**CloneRoleAttributes**](CloneRoleAttributes.md) | |
**type** | **CloneRoleType** | |



14 changes: 14 additions & 0 deletions api_docs/v2/CloneRoleAttributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# CloneRoleAttributes

Attributes required to create a new role by cloning an existing one

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | Name of the new role that is cloned |



14 changes: 14 additions & 0 deletions api_docs/v2/CloneRoleRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# CloneRoleRequest

Request to create a role by cloning an existing role

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**CloneRole**](CloneRole.md) | |



11 changes: 11 additions & 0 deletions api_docs/v2/CloneRoleType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


# CloneRoleType

## Enum


* `CLONE_ROLE` (value: `"clone_role"`)



5 changes: 5 additions & 0 deletions api_docs/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ All URIs are relative to *https://api.datadoghq.com*
| _ProcessesApi_ | [**listProcesses**](ProcessesApi.md#listProcesses) | **GET** /api/v2/processes | Get all processes |
| _RolesApi_ | [**addPermissionToRole**](RolesApi.md#addPermissionToRole) | **POST** /api/v2/roles/{role_id}/permissions | Grant permission to a role |
| _RolesApi_ | [**addUserToRole**](RolesApi.md#addUserToRole) | **POST** /api/v2/roles/{role_id}/users | Add a user to a role |
| _RolesApi_ | [**cloneRole**](RolesApi.md#cloneRole) | **POST** /api/v2/roles/{role_id}/clone | Create a new role by cloning an existing role |
| _RolesApi_ | [**createRole**](RolesApi.md#createRole) | **POST** /api/v2/roles | Create role |
| _RolesApi_ | [**deleteRole**](RolesApi.md#deleteRole) | **DELETE** /api/v2/roles/{role_id} | Delete role |
| _RolesApi_ | [**getRole**](RolesApi.md#getRole) | **GET** /api/v2/roles/{role_id} | Get a role |
Expand Down Expand Up @@ -130,6 +131,10 @@ All URIs are relative to *https://api.datadoghq.com*
- [ApplicationKeyUpdateRequest](ApplicationKeyUpdateRequest.md)
- [ApplicationKeysSort](ApplicationKeysSort.md)
- [ApplicationKeysType](ApplicationKeysType.md)
- [CloneRole](CloneRole.md)
- [CloneRoleAttributes](CloneRoleAttributes.md)
- [CloneRoleRequest](CloneRoleRequest.md)
- [CloneRoleType](CloneRoleType.md)
- [ContentEncoding](ContentEncoding.md)
- [Creator](Creator.md)
- [DashboardListAddItemsRequest](DashboardListAddItemsRequest.md)
Expand Down
97 changes: 83 additions & 14 deletions api_docs/v2/RolesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

All URIs are relative to *https://api.datadoghq.com*

| Method | HTTP request | Description |
| -------------------------------------------------------------------- | ---------------------------------------------- | --------------------------- |
| [**addPermissionToRole**](RolesApi.md#addPermissionToRole) | **POST** /api/v2/roles/{role_id}/permissions | Grant permission to a role |
| [**addUserToRole**](RolesApi.md#addUserToRole) | **POST** /api/v2/roles/{role_id}/users | Add a user to a role |
| [**createRole**](RolesApi.md#createRole) | **POST** /api/v2/roles | Create role |
| [**deleteRole**](RolesApi.md#deleteRole) | **DELETE** /api/v2/roles/{role_id} | Delete role |
| [**getRole**](RolesApi.md#getRole) | **GET** /api/v2/roles/{role_id} | Get a role |
| [**listPermissions**](RolesApi.md#listPermissions) | **GET** /api/v2/permissions | List permissions |
| [**listRolePermissions**](RolesApi.md#listRolePermissions) | **GET** /api/v2/roles/{role_id}/permissions | List permissions for a role |
| [**listRoleUsers**](RolesApi.md#listRoleUsers) | **GET** /api/v2/roles/{role_id}/users | Get all users of a role |
| [**listRoles**](RolesApi.md#listRoles) | **GET** /api/v2/roles | List roles |
| [**removePermissionFromRole**](RolesApi.md#removePermissionFromRole) | **DELETE** /api/v2/roles/{role_id}/permissions | Revoke permission |
| [**removeUserFromRole**](RolesApi.md#removeUserFromRole) | **DELETE** /api/v2/roles/{role_id}/users | Remove a user from a role |
| [**updateRole**](RolesApi.md#updateRole) | **PATCH** /api/v2/roles/{role_id} | Update a role |
| Method | HTTP request | Description |
| -------------------------------------------------------------------- | ---------------------------------------------- | --------------------------------------------- |
| [**addPermissionToRole**](RolesApi.md#addPermissionToRole) | **POST** /api/v2/roles/{role_id}/permissions | Grant permission to a role |
| [**addUserToRole**](RolesApi.md#addUserToRole) | **POST** /api/v2/roles/{role_id}/users | Add a user to a role |
| [**cloneRole**](RolesApi.md#cloneRole) | **POST** /api/v2/roles/{role_id}/clone | Create a new role by cloning an existing role |
| [**createRole**](RolesApi.md#createRole) | **POST** /api/v2/roles | Create role |
| [**deleteRole**](RolesApi.md#deleteRole) | **DELETE** /api/v2/roles/{role_id} | Delete role |
| [**getRole**](RolesApi.md#getRole) | **GET** /api/v2/roles/{role_id} | Get a role |
| [**listPermissions**](RolesApi.md#listPermissions) | **GET** /api/v2/permissions | List permissions |
| [**listRolePermissions**](RolesApi.md#listRolePermissions) | **GET** /api/v2/roles/{role_id}/permissions | List permissions for a role |
| [**listRoleUsers**](RolesApi.md#listRoleUsers) | **GET** /api/v2/roles/{role_id}/users | Get all users of a role |
| [**listRoles**](RolesApi.md#listRoles) | **GET** /api/v2/roles | List roles |
| [**removePermissionFromRole**](RolesApi.md#removePermissionFromRole) | **DELETE** /api/v2/roles/{role_id}/permissions | Revoke permission |
| [**removeUserFromRole**](RolesApi.md#removeUserFromRole) | **DELETE** /api/v2/roles/{role_id}/users | Remove a user from a role |
| [**updateRole**](RolesApi.md#updateRole) | **PATCH** /api/v2/roles/{role_id} | Update a role |

## addPermissionToRole

Expand Down Expand Up @@ -151,6 +152,74 @@ public class Example {
| **404** | Not found | - |
| **429** | Too many requests | - |

## cloneRole

> RoleResponse cloneRole(roleId, body);
Clone an existing role

### Example

```java
import java.util.*;
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.model.*;
import com.datadog.api.v2.client.api.RolesApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();

RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | The ID of the role.
CloneRoleRequest body = new CloneRoleRequest(); // CloneRoleRequest |
try {
RoleResponse result = apiInstance.cloneRole(roleId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#cloneRole");
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 |
| ---------- | ------------------------------------------- | ------------------- | ----- |
| **roleId** | **String** | The ID of the role. |
| **body** | [**CloneRoleRequest**](CloneRoleRequest.md) | |

### Return type

[**RoleResponse**](RoleResponse.md)

### Authorization

[AuthZ](README.md#AuthZ), [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 | - |
| **403** | Authentication error | - |
| **404** | Not found | - |
| **409** | Conflict | - |
| **429** | Too many requests | - |

## createRole

> RoleCreateResponse createRole(body);
Expand Down
43 changes: 43 additions & 0 deletions examples/v2/roles/CloneRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Create a new role by cloning an existing role returns "OK" response

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.api.RolesApi;
import com.datadog.api.v2.client.model.CloneRole;
import com.datadog.api.v2.client.model.CloneRoleAttributes;
import com.datadog.api.v2.client.model.CloneRoleRequest;
import com.datadog.api.v2.client.model.CloneRoleType;
import com.datadog.api.v2.client.model.RoleResponse;
import java.util.*;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
RolesApi apiInstance = new RolesApi(defaultClient);

// there is a valid "role" in the system
String ROLE_DATA_ID = System.getenv("ROLE_DATA_ID");

CloneRoleRequest body =
new CloneRoleRequest()
.data(
new CloneRole()
.attributes(
new CloneRoleAttributes()
.name(
"Example-Create_a_new_role_by_cloning_an_existing_role_returns_OK_response"))
.type(CloneRoleType.CLONE_ROLE));

try {
RoleResponse result = apiInstance.cloneRole(ROLE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DowntimesApi#updateDowntime");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
4 changes: 3 additions & 1 deletion examples/v2/roles/UpdateRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public static void main(String[] args) {
new RoleUpdateData()
.id(ROLE_DATA_ID)
.type(RolesType.ROLES)
.attributes(new RoleUpdateAttributes().name("developers-updated")));
.attributes(
new RoleUpdateAttributes()
.name("b9089d38-651f-3c29-c126-decdf6a0ee4f-updated")));

try {
RoleUpdateResponse result = apiInstance.updateRole(ROLE_DATA_ID, body);
Expand Down
Loading

0 comments on commit 3fcf3e2

Please sign in to comment.