|
| 1 | +/* |
| 2 | + * Copyright 2013-2025 the original author or authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.cloudfoundry.reactor.client.v3.organizationquotadefinitions; |
| 18 | + |
| 19 | +import java.util.Map; |
| 20 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionRequest; |
| 21 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.CreateOrganizationQuotaDefinitionResponse; |
| 22 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.DeleteOrganizationQuotaDefinitionRequest; |
| 23 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionRequest; |
| 24 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.GetOrganizationQuotaDefinitionResponse; |
| 25 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsRequest; |
| 26 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.ListOrganizationQuotaDefinitionsResponse; |
| 27 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.OrganizationQuotaDefinitionsV3; |
| 28 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionRequest; |
| 29 | +import org.cloudfoundry.client.v3.organizationquotadefinitions.UpdateOrganizationQuotaDefinitionResponse; |
| 30 | +import org.cloudfoundry.reactor.ConnectionContext; |
| 31 | +import org.cloudfoundry.reactor.TokenProvider; |
| 32 | +import org.cloudfoundry.reactor.client.v3.AbstractClientV3Operations; |
| 33 | +import reactor.core.publisher.Mono; |
| 34 | + |
| 35 | +/** |
| 36 | + * The Reactor-based implementation of {@link ReactorOrganizationQuotaDefinitionsV3} |
| 37 | + */ |
| 38 | +public class ReactorOrganizationQuotaDefinitionsV3 extends AbstractClientV3Operations |
| 39 | + implements OrganizationQuotaDefinitionsV3 { |
| 40 | + |
| 41 | + /** |
| 42 | + * Creates an instance |
| 43 | + * |
| 44 | + * @param connectionContext the {@link ConnectionContext} to use when communicating with the server |
| 45 | + * @param root the root URI of the server. Typically, something like {@code https://api.run.pivotal.io}. |
| 46 | + * @param tokenProvider the {@link TokenProvider} to use when communicating with the server |
| 47 | + * @param requestTags map with custom http headers which will be added to web request |
| 48 | + */ |
| 49 | + public ReactorOrganizationQuotaDefinitionsV3( |
| 50 | + ConnectionContext connectionContext, |
| 51 | + Mono<String> root, |
| 52 | + TokenProvider tokenProvider, |
| 53 | + Map<String, String> requestTags) { |
| 54 | + super(connectionContext, root, tokenProvider, requestTags); |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public Mono<CreateOrganizationQuotaDefinitionResponse> create( |
| 59 | + CreateOrganizationQuotaDefinitionRequest request) { |
| 60 | + return post( |
| 61 | + request, |
| 62 | + CreateOrganizationQuotaDefinitionResponse.class, |
| 63 | + builder -> builder.pathSegment("organization_quotas")) |
| 64 | + .checkpoint(); |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public Mono<GetOrganizationQuotaDefinitionResponse> get( |
| 69 | + GetOrganizationQuotaDefinitionRequest request) { |
| 70 | + return get( |
| 71 | + request, |
| 72 | + GetOrganizationQuotaDefinitionResponse.class, |
| 73 | + builder -> |
| 74 | + builder.pathSegment( |
| 75 | + "organization_quotas", |
| 76 | + request.getOrganizationQuotaDefinitionId())) |
| 77 | + .checkpoint(); |
| 78 | + } |
| 79 | + |
| 80 | + @Override |
| 81 | + public Mono<ListOrganizationQuotaDefinitionsResponse> list( |
| 82 | + ListOrganizationQuotaDefinitionsRequest request) { |
| 83 | + return get( |
| 84 | + request, |
| 85 | + ListOrganizationQuotaDefinitionsResponse.class, |
| 86 | + builder -> builder.pathSegment("organization_quotas")) |
| 87 | + .checkpoint(); |
| 88 | + } |
| 89 | + |
| 90 | + @Override |
| 91 | + public Mono<UpdateOrganizationQuotaDefinitionResponse> update( |
| 92 | + UpdateOrganizationQuotaDefinitionRequest request) { |
| 93 | + return patch( |
| 94 | + request, |
| 95 | + UpdateOrganizationQuotaDefinitionResponse.class, |
| 96 | + builder -> |
| 97 | + builder.pathSegment( |
| 98 | + "organization_quotas", |
| 99 | + request.getOrganizationQuotaDefinitionId())) |
| 100 | + .checkpoint(); |
| 101 | + } |
| 102 | + |
| 103 | + @Override |
| 104 | + public Mono<String> delete(DeleteOrganizationQuotaDefinitionRequest request) { |
| 105 | + return delete( |
| 106 | + request, |
| 107 | + builder -> |
| 108 | + builder.pathSegment( |
| 109 | + "organization_quotas", |
| 110 | + request.getOrganizationQuotaDefinitionId())) |
| 111 | + .checkpoint(); |
| 112 | + } |
| 113 | +} |
0 commit comments