-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit c445899 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Dec 17, 2021
1 parent
d1820ec
commit 3fcf3e2
Showing
23 changed files
with
2,306 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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** | | | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | | | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
# CloneRoleType | ||
|
||
## Enum | ||
|
||
|
||
* `CLONE_ROLE` (value: `"clone_role"`) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.