- Development Integration
- /
- SDK
- /
- Java
- /
Management module
- /
Manage data resources and permissions
- /
- Modify data resource extension fields
¶ Create data resource extension fields
Update time: 2025-07-23 07:34:21
Currently only supports tree type data resources
¶ Method Name
ManagementClient.UpdateDnef
¶ Request Parameters
Type: UpdateDenfDto
| Name | Type | Is it required | Default Value | Description | Example Value |
|---|---|---|---|---|---|
| namespaceCode | string | yes | Permission space code | examplePermissionNamespace | |
| resourceCode | string | yes | Data resource code | treeResourceCode | |
| key | string | yes | Extension field Key | str | |
| valueType | ValueType | No | Extended field value type | STRING (text), SELECT (single choice) | |
| label | string | No | Extended field display Name | str_label | |
| config | DnefConfig | No | Field configuration |
¶ Sample Code
package test.management.dataPermission.resource;
import cn.authing.sdk.java.client.ManagementClient;
import cn.authing.sdk.java.dto.Dnef.ValueType;
import cn.authing.sdk.java.dto.DnefConfig;
import cn.authing.sdk.java.dto.IsSuccessRespDto;
import cn.authing.sdk.java.dto.UpdateDenfDto;
import cn.authing.sdk.java.model.ManagementClientOptions;
import cn.authing.sdk.java.util.JsonUtils;
import cn.hutool.core.collection.ListUtil;
public class UpdateDnefTest {
// Need to be replaced with your GenAuth Access Key ID
private static final String ACCESS_KEY_ID = "AUTHING_ACCESS_KEY_ID";
// Need to be replaced with your GenAuth Access Key Secret
private static final String ACCESS_KEY_SECRET = "AUTHING_ACCESS_KEY_SECRET";
public static void main(String[] args) throws Throwable {
ManagementClientOptions clientOptions = new ManagementClientOptions();
clientOptions.setAccessKeyId(ACCESS_KEY_ID);
clientOptions.setAccessKeySecret(ACCESS_KEY_SECRET);
// If you are a private deployment customer, you need to set the GenAuth service domain name
// clientOptions.setHost("https://api.your-authing-service.com");
ManagementClient client = new ManagementClient(clientOptions);
UpdateDenfDto updateDenfDto = new UpdateDenfDto();
updateDenfDto.setResourceCode("treeResourceCode");
updateDenfDto.setNamespaceCode("examplePermissionNamespace");
updateDenfDto.setKey("select");
updateDenfDto.setValueType(ValueType.SELECT);
updateDenfDto.setDescription("select1");
updateDenfDto.setLabel("select1");
updateDenfDto.setConfig(new DnefConfig(ListUtil.of(new DnefConfig.Option("str_value_1"))));
IsSuccessRespDto res = client.updateDnef(updateDenfDto);
System.out.println(JsonUtils.serialize(res));
}
}
¶ Request Response
Type: IsSuccessRespDto
| Name | Type | Description |
|---|---|---|
| statusCode | number | Business status code. You can use this status code to determine whether the operation is successful. 200 means success. |
| message | string | Description |
| apiCode | number | Segment error code, through which the specific error type can be obtained (not returned for successful requests). For a detailed list of error codes, see:API Code List (opens new window) |
| requestId | string | Request ID. Returned when the request fails. |
| data | IsSuccessDto | Whether the operation is successful |
¶ Data Structure
¶ IsSuccessDto
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| success | boolean | yes | Whether the operation is successful | true |
¶ DnefConfig
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| options | Option[] | yes | Radio Type Field Option List |
¶ Option
| Name | Type | Is it required | Description | Example Value |
|---|---|---|---|---|
| value | string | yes | Option Value | option1 |
