Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.cloudfoundry.reactor.client;

import jakarta.annotation.PostConstruct;
import org.cloudfoundry.client.CloudFoundryClient;
import org.cloudfoundry.client.v2.applications.ApplicationsV2;
import org.cloudfoundry.client.v2.applicationusageevents.ApplicationUsageEvents;
Expand All @@ -34,8 +35,6 @@
import org.cloudfoundry.client.v2.routemappings.RouteMappings;
import org.cloudfoundry.client.v2.routes.Routes;
import org.cloudfoundry.client.v2.securitygroups.SecurityGroups;
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
import org.cloudfoundry.client.v3.securitygroups.SecurityGroupsV3;
import org.cloudfoundry.client.v2.servicebindings.ServiceBindingsV2;
import org.cloudfoundry.client.v2.servicebrokers.ServiceBrokers;
import org.cloudfoundry.client.v2.serviceinstances.ServiceInstances;
Expand All @@ -60,17 +59,20 @@
import org.cloudfoundry.client.v3.droplets.Droplets;
import org.cloudfoundry.client.v3.isolationsegments.IsolationSegments;
import org.cloudfoundry.client.v3.jobs.JobsV3;
import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3;
import org.cloudfoundry.client.v3.organizations.OrganizationsV3;
import org.cloudfoundry.client.v3.packages.Packages;
import org.cloudfoundry.client.v3.processes.Processes;
import org.cloudfoundry.client.v3.resourcematch.ResourceMatchV3;
import org.cloudfoundry.client.v3.roles.RolesV3;
import org.cloudfoundry.client.v3.routes.RoutesV3;
import org.cloudfoundry.client.v3.serviceinstances.ServiceInstancesV3;
import org.cloudfoundry.client.v3.securitygroups.SecurityGroupsV3;
import org.cloudfoundry.client.v3.servicebindings.ServiceBindingsV3;
import org.cloudfoundry.client.v3.servicebrokers.ServiceBrokersV3;
import org.cloudfoundry.client.v3.serviceinstances.ServiceInstancesV3;
import org.cloudfoundry.client.v3.serviceofferings.ServiceOfferingsV3;
import org.cloudfoundry.client.v3.serviceplans.ServicePlansV3;
import org.cloudfoundry.client.v3.spacequotas.SpaceQuotasV3;
import org.cloudfoundry.client.v3.spaces.SpacesV3;
import org.cloudfoundry.client.v3.stacks.StacksV3;
import org.cloudfoundry.client.v3.tasks.Tasks;
Expand All @@ -93,8 +95,6 @@
import org.cloudfoundry.reactor.client.v2.routemappings.ReactorRouteMappings;
import org.cloudfoundry.reactor.client.v2.routes.ReactorRoutes;
import org.cloudfoundry.reactor.client.v2.securitygroups.ReactorSecurityGroups;
import org.cloudfoundry.reactor.client.v3.organizationquotadefinitions.ReactorOrganizationQuotaDefinitionsV3;
import org.cloudfoundry.reactor.client.v3.securitygroups.ReactorSecurityGroupsV3;
import org.cloudfoundry.reactor.client.v2.servicebindings.ReactorServiceBindingsV2;
import org.cloudfoundry.reactor.client.v2.servicebrokers.ReactorServiceBrokers;
import org.cloudfoundry.reactor.client.v2.serviceinstances.ReactorServiceInstances;
Expand All @@ -119,24 +119,26 @@
import org.cloudfoundry.reactor.client.v3.droplets.ReactorDroplets;
import org.cloudfoundry.reactor.client.v3.isolationsegments.ReactorIsolationSegments;
import org.cloudfoundry.reactor.client.v3.jobs.ReactorJobsV3;
import org.cloudfoundry.reactor.client.v3.organizationquotadefinitions.ReactorOrganizationQuotaDefinitionsV3;
import org.cloudfoundry.reactor.client.v3.organizations.ReactorOrganizationsV3;
import org.cloudfoundry.reactor.client.v3.packages.ReactorPackages;
import org.cloudfoundry.reactor.client.v3.processes.ReactorProcesses;
import org.cloudfoundry.reactor.client.v3.resourcematch.ReactorResourceMatchV3;
import org.cloudfoundry.reactor.client.v3.roles.ReactorRolesV3;
import org.cloudfoundry.reactor.client.v3.routes.ReactorRoutesV3;
import org.cloudfoundry.reactor.client.v3.securitygroups.ReactorSecurityGroupsV3;
import org.cloudfoundry.reactor.client.v3.servicebindings.ReactorServiceBindingsV3;
import org.cloudfoundry.reactor.client.v3.servicebrokers.ReactorServiceBrokersV3;
import org.cloudfoundry.reactor.client.v3.serviceinstances.ReactorServiceInstancesV3;
import org.cloudfoundry.reactor.client.v3.serviceofferings.ReactorServiceOfferingsV3;
import org.cloudfoundry.reactor.client.v3.serviceplans.ReactorServicePlansV3;
import org.cloudfoundry.reactor.client.v3.spacequotas.ReactorSpaceQuotasV3;
import org.cloudfoundry.reactor.client.v3.spaces.ReactorSpacesV3;
import org.cloudfoundry.reactor.client.v3.stacks.ReactorStacksV3;
import org.cloudfoundry.reactor.client.v3.tasks.ReactorTasks;
import org.immutables.value.Value;
import reactor.core.publisher.Mono;

import jakarta.annotation.PostConstruct;
import java.util.Collections;
import java.util.Map;

Expand Down Expand Up @@ -457,6 +459,13 @@ public SpaceQuotaDefinitions spaceQuotaDefinitions() {
getRequestTags());
}

@Override
@Value.Derived
public SpaceQuotasV3 spaceQuotasV3() {
return new ReactorSpaceQuotasV3(getConnectionContext(), getRootV3(), getTokenProvider(),
getRequestTags());
}

@Override
@Value.Derived
public Spaces spaces() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.cloudfoundry.reactor.client.v3.spacequotas;

import java.util.Map;
import org.cloudfoundry.client.v3.spacequotas.*;
import org.cloudfoundry.client.v3.spacequotas.CreateSpaceQuotaResponse;
import org.cloudfoundry.reactor.ConnectionContext;
import org.cloudfoundry.reactor.TokenProvider;
import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations;
import reactor.core.publisher.Mono;

/**
* The Reactor-based implementation of {@link ReactorSpaceQuotasV3}
*/
public class ReactorSpaceQuotasV3 extends AbstractClientV3Operations implements SpaceQuotasV3 {

/**
* Creates an instance
*
* @param connectionContext the {@link ConnectionContext} to use when communicating with the server
* @param root the root URI of the server. Typically, something like {@code https://api.run.pivotal.io}.
* @param tokenProvider the {@link TokenProvider} to use when communicating with the server
* @param requestTags map with custom http headers which will be added to web request
*/
public ReactorSpaceQuotasV3(
ConnectionContext connectionContext,
Mono<String> root,
TokenProvider tokenProvider,
Map<String, String> requestTags) {
super(connectionContext, root, tokenProvider, requestTags);
}

@Override
public Mono<CreateSpaceQuotaResponse> create(CreateSpaceQuotaRequest request) {
return post(
request,
CreateSpaceQuotaResponse.class,
builder -> builder.pathSegment("space_quotas"))
.checkpoint();
}

@Override
public Mono<GetSpaceQuotaResponse> get(GetSpaceQuotaRequest request) {
return get(
request,
GetSpaceQuotaResponse.class,
builder -> builder.pathSegment("space_quotas", request.getSpaceQuotaId()))
.checkpoint();
}

@Override
public Mono<ListSpaceQuotasResponse> list(ListSpaceQuotasRequest request) {
return get(
request,
ListSpaceQuotasResponse.class,
builder -> builder.pathSegment("space_quotas"))
.checkpoint();
}

@Override
public Mono<UpdateSpaceQuotaResponse> update(UpdateSpaceQuotaRequest request) {
return patch(
request,
UpdateSpaceQuotaResponse.class,
builder -> builder.pathSegment("space_quotas", request.getSpaceQuotaId()))
.checkpoint();
}

@Override
public Mono<String> delete(DeleteSpaceQuotaRequest request) {
return delete(
request,
builder -> builder.pathSegment("space_quotas", request.getSpaceQuotaId()))
.checkpoint();
}
}
Loading