Skip to content

Commit 2c70e27

Browse files
committed
Update README.md
1 parent 4cff64f commit 2c70e27

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,15 @@ OperationResult<HypermediaAttributesListWrapper> attributes = session
931931
.attributes(asList("test_attribute_1", "test_attribute_2")
932932
.createOrUpdate(serverAttributes);
933933
```
934-
Be careful with definition of attribute names because the server uses different strategies for creating or updating attributes depending on list of attribute names, list of attributes and existing attributes on the server (see section [Setting User Attributes] (https://github.com/TanyaEf/jrs-rest-java-client#setting-user-attributes)).
934+
If you want to replace all existing attributes with new ones:
935+
```java
936+
OperationResult<HypermediaAttributesListWrapper> attributes = session
937+
.attributesService()
938+
.forOrganization("organization_1")
939+
.allAttributes()
940+
.createOrUpdate(serverAttributes);
941+
```
942+
Be careful with definition of attribute names because the server uses different strategies for creating or updating attributes depending on list of attribute names, list of attributes and existing attributes on the server (see section [Setting User Attributes] (https://github.com/Jaspersoft/jrs-rest-java-client#setting-user-attributes)).
935943
Or to create a single organization attribute code below:
936944
```java
937945
HypermediaAttribute attribute = new HypermediaAttribute(new ClientTenantAttribute().setName("industry").setValue("IT"));
@@ -990,6 +998,13 @@ OperationResult<HypermediaAttributesListWrapper> attributes = session
990998
.attributes("max_threads", "admin_cell_phone")
991999
.createOrUpdate(newServerAttributes);
9921000
```
1001+
If you want to replace all existing attributes with new ones:
1002+
```java
1003+
OperationResult<HypermediaAttributesListWrapper> attributes = session
1004+
.attributesService()
1005+
.allAttributes()
1006+
.createOrUpdate(serverAttributes);
1007+
```
9931008
Be careful with definition of attribute names because the server uses different strategies for creating or updating attributes depending on list of attribute names, list of attributes and existing attributes on the server (see section [Setting User Attributes] (https://github.com/TanyaEf/jrs-rest-java-client#setting-user-attributes)).
9941009
To create a single server attribute:
9951010
```java

0 commit comments

Comments
 (0)