-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from commercetools/gen-sdk-updates
- Loading branch information
Showing
525 changed files
with
55,304 additions
and
160 deletions.
There are no files selected for viewing
245 changes: 245 additions & 0 deletions
245
...main/java-generated/com/commercetools/api/client/ByProjectKeyBusinessUnitsByIDDelete.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
|
||
package com.commercetools.api.client; | ||
|
||
import java.net.URI; | ||
import java.time.Duration; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Function; | ||
import java.util.function.Supplier; | ||
import java.util.stream.Collectors; | ||
|
||
import io.vrap.rmf.base.client.*; | ||
import io.vrap.rmf.base.client.utils.Generated; | ||
|
||
import org.apache.commons.lang3.builder.EqualsBuilder; | ||
import org.apache.commons.lang3.builder.HashCodeBuilder; | ||
|
||
/** | ||
* | ||
* | ||
* <hr> | ||
* <div class=code-example> | ||
* <pre><code class='java'>{@code | ||
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.business_unit.BusinessUnit>> result = apiRoot | ||
* .withProjectKey("{projectKey}") | ||
* .businessUnits() | ||
* .withId("{ID}") | ||
* .delete() | ||
* .withVersion(version) | ||
* .execute() | ||
* }</code></pre> | ||
* </div> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
public class ByProjectKeyBusinessUnitsByIDDelete | ||
extends ApiMethod<ByProjectKeyBusinessUnitsByIDDelete, com.commercetools.api.models.business_unit.BusinessUnit> | ||
implements com.commercetools.api.client.VersionedTrait<ByProjectKeyBusinessUnitsByIDDelete>, | ||
com.commercetools.api.client.ConflictingTrait<ByProjectKeyBusinessUnitsByIDDelete>, | ||
com.commercetools.api.client.ExpandableTrait<ByProjectKeyBusinessUnitsByIDDelete>, | ||
com.commercetools.api.client.ErrorableTrait<ByProjectKeyBusinessUnitsByIDDelete>, | ||
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyBusinessUnitsByIDDelete> { | ||
|
||
private String projectKey; | ||
private String ID; | ||
|
||
public ByProjectKeyBusinessUnitsByIDDelete(final ApiHttpClient apiHttpClient, String projectKey, String ID) { | ||
super(apiHttpClient); | ||
this.projectKey = projectKey; | ||
this.ID = ID; | ||
} | ||
|
||
public ByProjectKeyBusinessUnitsByIDDelete(ByProjectKeyBusinessUnitsByIDDelete t) { | ||
super(t); | ||
this.projectKey = t.projectKey; | ||
this.ID = t.ID; | ||
} | ||
|
||
@Override | ||
protected ApiHttpRequest buildHttpRequest() { | ||
List<String> params = new ArrayList<>(getQueryParamUriStrings()); | ||
String httpRequestPath = String.format("/%s/business-units/%s", this.projectKey, this.ID); | ||
if (!params.isEmpty()) { | ||
httpRequestPath += "?" + String.join("&", params); | ||
} | ||
return new ApiHttpRequest(ApiHttpMethod.DELETE, URI.create(httpRequestPath), getHeaders(), null); | ||
} | ||
|
||
@Override | ||
public ApiHttpResponse<com.commercetools.api.models.business_unit.BusinessUnit> executeBlocking( | ||
final ApiHttpClient client, final Duration timeout) { | ||
return executeBlocking(client, timeout, com.commercetools.api.models.business_unit.BusinessUnit.class); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.business_unit.BusinessUnit>> execute( | ||
final ApiHttpClient client) { | ||
return execute(client, com.commercetools.api.models.business_unit.BusinessUnit.class); | ||
} | ||
|
||
public String getProjectKey() { | ||
return this.projectKey; | ||
} | ||
|
||
public String getID() { | ||
return this.ID; | ||
} | ||
|
||
public List<String> getVersion() { | ||
return this.getQueryParam("version"); | ||
} | ||
|
||
public List<String> getExpand() { | ||
return this.getQueryParam("expand"); | ||
} | ||
|
||
public void setProjectKey(final String projectKey) { | ||
this.projectKey = projectKey; | ||
} | ||
|
||
public void setID(final String ID) { | ||
this.ID = ID; | ||
} | ||
|
||
/** | ||
* set version with the specified value | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete withVersion(final TValue version) { | ||
return copy().withQueryParam("version", version); | ||
} | ||
|
||
/** | ||
* add additional version query parameter | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete addVersion(final TValue version) { | ||
return copy().addQueryParam("version", version); | ||
} | ||
|
||
/** | ||
* set version with the specified value | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete withVersion(final Supplier<Long> supplier) { | ||
return copy().withQueryParam("version", supplier.get()); | ||
} | ||
|
||
/** | ||
* add additional version query parameter | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete addVersion(final Supplier<Long> supplier) { | ||
return copy().addQueryParam("version", supplier.get()); | ||
} | ||
|
||
/** | ||
* set version with the specified value | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete withVersion(final Function<StringBuilder, StringBuilder> op) { | ||
return copy().withQueryParam("version", op.apply(new StringBuilder())); | ||
} | ||
|
||
/** | ||
* add additional version query parameter | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete addVersion(final Function<StringBuilder, StringBuilder> op) { | ||
return copy().addQueryParam("version", op.apply(new StringBuilder())); | ||
} | ||
|
||
/** | ||
* set version with the specified values | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete withVersion(final List<TValue> version) { | ||
return copy().withoutQueryParam("version") | ||
.addQueryParams( | ||
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); | ||
} | ||
|
||
/** | ||
* add additional version query parameters | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete addVersion(final List<TValue> version) { | ||
return copy().addQueryParams( | ||
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList())); | ||
} | ||
|
||
/** | ||
* set expand with the specified value | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete withExpand(final TValue expand) { | ||
return copy().withQueryParam("expand", expand); | ||
} | ||
|
||
/** | ||
* add additional expand query parameter | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete addExpand(final TValue expand) { | ||
return copy().addQueryParam("expand", expand); | ||
} | ||
|
||
/** | ||
* set expand with the specified value | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete withExpand(final Supplier<String> supplier) { | ||
return copy().withQueryParam("expand", supplier.get()); | ||
} | ||
|
||
/** | ||
* add additional expand query parameter | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete addExpand(final Supplier<String> supplier) { | ||
return copy().addQueryParam("expand", supplier.get()); | ||
} | ||
|
||
/** | ||
* set expand with the specified value | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete withExpand(final Function<StringBuilder, StringBuilder> op) { | ||
return copy().withQueryParam("expand", op.apply(new StringBuilder())); | ||
} | ||
|
||
/** | ||
* add additional expand query parameter | ||
*/ | ||
public ByProjectKeyBusinessUnitsByIDDelete addExpand(final Function<StringBuilder, StringBuilder> op) { | ||
return copy().addQueryParam("expand", op.apply(new StringBuilder())); | ||
} | ||
|
||
/** | ||
* set expand with the specified values | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete withExpand(final List<TValue> expand) { | ||
return copy().withoutQueryParam("expand") | ||
.addQueryParams( | ||
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); | ||
} | ||
|
||
/** | ||
* add additional expand query parameters | ||
*/ | ||
public <TValue> ByProjectKeyBusinessUnitsByIDDelete addExpand(final List<TValue> expand) { | ||
return copy().addQueryParams( | ||
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList())); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
|
||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
|
||
ByProjectKeyBusinessUnitsByIDDelete that = (ByProjectKeyBusinessUnitsByIDDelete) o; | ||
|
||
return new EqualsBuilder().append(projectKey, that.projectKey).append(ID, that.ID).isEquals(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder(17, 37).append(projectKey).append(ID).toHashCode(); | ||
} | ||
|
||
@Override | ||
protected ByProjectKeyBusinessUnitsByIDDelete copy() { | ||
return new ByProjectKeyBusinessUnitsByIDDelete(this); | ||
} | ||
} |
Oops, something went wrong.