1818
1919import org .cloudfoundry .Nullable ;
2020import org .cloudfoundry .client .CloudFoundryClient ;
21- import org .cloudfoundry .client .v2 .organizations .ListOrganizationsRequest ;
22- import org .cloudfoundry .client .v2 .organizations .OrganizationResource ;
23- import org .cloudfoundry .client .v2 .spaces .ListSpacesRequest ;
24- import org .cloudfoundry .client .v2 .spaces .SpaceResource ;
21+ import org .cloudfoundry .client .v3 .organizations .ListOrganizationsRequest ;
22+ import org .cloudfoundry .client .v3 .organizations .OrganizationResource ;
23+ import org .cloudfoundry .client .v3 .spaces .ListSpacesRequest ;
24+ import org .cloudfoundry .client .v3 .spaces .SpaceResource ;
2525import org .cloudfoundry .doppler .DopplerClient ;
2626import org .cloudfoundry .networking .NetworkingClient ;
2727import org .cloudfoundry .operations .advanced .Advanced ;
5656import org .cloudfoundry .uaa .UaaClient ;
5757import org .cloudfoundry .util .ExceptionUtils ;
5858import org .cloudfoundry .util .PaginationUtils ;
59- import org .cloudfoundry .util .ResourceUtils ;
6059import org .immutables .value .Value ;
6160import reactor .core .publisher .Flux ;
6261import reactor .core .publisher .Mono ;
@@ -211,7 +210,7 @@ Mono<String> getOrganizationId() {
211210
212211 if (hasText (organization )) {
213212 Mono <String > cached = getOrganization (getCloudFoundryClientPublisher (), organization )
214- .map (ResourceUtils ::getId );
213+ .map (OrganizationResource ::getId );
215214
216215 return getCacheDuration ()
217216 .map (cached ::cache )
@@ -247,7 +246,7 @@ Mono<String> getSpaceId() {
247246 if (hasText (getSpace ())) {
248247 Mono <String > cached = getOrganizationId ()
249248 .flatMap (organizationId -> getSpace (getCloudFoundryClientPublisher (), organizationId , space ))
250- .map (ResourceUtils ::getId );
249+ .map (SpaceResource ::getId );
251250
252251 return getCacheDuration ()
253252 .map (cached ::cache )
@@ -308,7 +307,7 @@ private static boolean hasText(CharSequence str) {
308307 private static Flux <OrganizationResource > requestOrganizations (Mono <CloudFoundryClient > cloudFoundryClientPublisher , String organization ) {
309308 return cloudFoundryClientPublisher
310309 .flatMapMany (cloudFoundryClient -> PaginationUtils
311- .requestClientV2Resources (page -> cloudFoundryClient .organizations ()
310+ .requestClientV3Resources (page -> cloudFoundryClient .organizationsV3 ()
312311 .list (ListOrganizationsRequest .builder ()
313312 .name (organization )
314313 .page (page )
@@ -318,7 +317,7 @@ private static Flux<OrganizationResource> requestOrganizations(Mono<CloudFoundry
318317 private static Flux <SpaceResource > requestSpaces (Mono <CloudFoundryClient > cloudFoundryClientPublisher , String organizationId , String space ) {
319318 return cloudFoundryClientPublisher
320319 .flatMapMany (cloudFoundryClient -> PaginationUtils
321- .requestClientV2Resources (page -> cloudFoundryClient .spaces ()
320+ .requestClientV3Resources (page -> cloudFoundryClient .spacesV3 ()
322321 .list (ListSpacesRequest .builder ()
323322 .organizationId (organizationId )
324323 .name (space )
0 commit comments