11package org .fusioproject .sample ;
22
3+ import app .sdkgen .client .Credentials .OAuth2 ;
4+ import app .sdkgen .client .CredentialsInterface ;
35import app .sdkgen .client .Exception .ClientException ;
46import app .sdkgen .client .TokenStore .MemoryTokenStore ;
57import app .sdkgen .client .TokenStoreInterface ;
8+ import org .fusioproject .sdk .BackendOperationCollection ;
69import org .fusioproject .sdk .Client ;
7- import org .fusioproject .sdk .backend .OperationCollection ;
810
911import java .util .ArrayList ;
1012import java .util .List ;
@@ -16,13 +18,14 @@ public static void main(String[] args) throws ClientException {
1618 scopes .add ("backend" );
1719 TokenStoreInterface tokenStore = new MemoryTokenStore ();
1820
19- Client client = new Client ("https://demo.fusio-project.org/" , "test" , "FRsNh1zKCXlB" , scopes , tokenStore );
21+ CredentialsInterface credentials = new OAuth2 ("test" , "FRsNh1zKCXlB" , "https://demo.fusio-project.org/authorization/token" , "" , tokenStore , scopes );
22+ Client client = new Client ("https://demo.fusio-project.org/" , credentials );
2023
21- OperationCollection operations = client .backend ().operation ().getAll (0 , 16 , "" );
24+ BackendOperationCollection operations = client .backend ().operation ().getAll (0 , 16 , "" );
2225
2326 System .out .println ("Operations:" );
24- for (int i = 0 ; i < operations .getEntry ().length ; i ++) {
25- System .out .println ("* " + operations .getEntry ()[ i ] .getHttpMethod () + " " + operations .getEntry ()[ i ] .getHttpPath ());
27+ for (int i = 0 ; i < operations .getEntry ().size () ; i ++) {
28+ System .out .println ("* " + operations .getEntry (). get ( i ) .getHttpMethod () + " " + operations .getEntry (). get ( i ) .getHttpPath ());
2629 }
2730 }
2831
0 commit comments