@@ -12,11 +12,13 @@ https://www.fusio-project.org/
1212``` java
1313package org.fusioproject.sample ;
1414
15+ import app.sdkgen.client.Credentials.OAuth2 ;
16+ import app.sdkgen.client.CredentialsInterface ;
1517import app.sdkgen.client.Exception.ClientException ;
1618import app.sdkgen.client.TokenStore.MemoryTokenStore ;
1719import app.sdkgen.client.TokenStoreInterface ;
20+ import org.fusioproject.sdk.BackendOperationCollection ;
1821import org.fusioproject.sdk.Client ;
19- import org.fusioproject.sdk.backend.OperationCollection ;
2022
2123import java.util.ArrayList ;
2224import java.util.List ;
@@ -28,13 +30,14 @@ public class Main {
2830 scopes. add(" backend" );
2931 TokenStoreInterface tokenStore = new MemoryTokenStore ();
3032
31- Client client = new Client (" https://demo.fusio-project.org/" , " test" , " FRsNh1zKCXlB" , scopes, tokenStore);
33+ CredentialsInterface credentials = new OAuth2 (" test" , " FRsNh1zKCXlB" , " https://demo.fusio-project.org/authorization/token" , " " , tokenStore, scopes);
34+ Client client = new Client (" https://demo.fusio-project.org/" , credentials);
3235
33- OperationCollection operations = client. backend(). operation(). getAll(0 , 16 , " " );
36+ BackendOperationCollection operations = client. backend(). operation(). getAll(0 , 16 , " " );
3437
3538 System . out. println(" Operations:" );
36- for (int i = 0 ; i < operations. getEntry(). length ; i++ ) {
37- System . out. println(" * " + operations. getEntry()[i] . getHttpMethod() + " " + operations. getEntry()[i] . getHttpPath());
39+ for (int i = 0 ; i < operations. getEntry(). size() ; i++ ) {
40+ System . out. println(" * " + operations. getEntry(). get(i) . getHttpMethod() + " " + operations. getEntry(). get(i) . getHttpPath());
3841 }
3942 }
4043
0 commit comments