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
16 changes: 13 additions & 3 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
**Import changes**
**Api changes**

<details>
<summary>Removed Type(s)</summary>
<summary>Added Resource(s)</summary>

- :warning: removed type `ReferencedResourceNotFound`
- added resource `/{projectKey}/channels/key={key}`
</details>


<details>
<summary>Added Method(s)</summary>

- added method `apiRoot.withProjectKey().channels().withKey().get()`
- added method `apiRoot.withProjectKey().channels().withKey().head()`
- added method `apiRoot.withProjectKey().channels().withKey().post()`
- added method `apiRoot.withProjectKey().channels().withKey().delete()`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -5571,8 +5571,20 @@ type Mutation {
"Queries with specified key"
key: String): Category
createChannel(draft: ChannelDraft!): Channel
updateChannel(id: String!, version: Long!, actions: [ChannelUpdateAction!]!): Channel
deleteChannel(id: String!, version: Long!): Channel
updateChannel(version: Long!, actions: [ChannelUpdateAction!]!,

"Queries with specified ID"
id: String,

"Queries with specified key"
key: String): Channel
deleteChannel(version: Long!,

"Queries with specified ID"
id: String,

"Queries with specified key"
key: String): Channel
createOrUpdateCustomObject(draft: CustomObjectDraft!): CustomObject
deleteCustomObject(version: Long,

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@

package com.commercetools.api.client;

import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
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 com.fasterxml.jackson.core.type.TypeReference;

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;

/**
* <p>Returns a ReferenceExists error if other resources reference the Channel to be deleted.</p>
*
* <hr>
* <div class=code-example>
* <pre><code class='java'>{@code
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.channel.Channel>> result = apiRoot
* .withProjectKey("{projectKey}")
* .channels()
* .withKey("{key}")
* .delete()
* .withVersion(version)
* .execute()
* }</code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ByProjectKeyChannelsKeyByKeyDelete
extends TypeApiMethod<ByProjectKeyChannelsKeyByKeyDelete, com.commercetools.api.models.channel.Channel>
implements com.commercetools.api.client.VersionedTrait<ByProjectKeyChannelsKeyByKeyDelete>,
com.commercetools.api.client.ConflictingTrait<ByProjectKeyChannelsKeyByKeyDelete>,
com.commercetools.api.client.ExpandableTrait<ByProjectKeyChannelsKeyByKeyDelete>,
com.commercetools.api.client.ErrorableTrait<ByProjectKeyChannelsKeyByKeyDelete>,
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyChannelsKeyByKeyDelete> {

@Override
public TypeReference<com.commercetools.api.models.channel.Channel> resultType() {
return new TypeReference<com.commercetools.api.models.channel.Channel>() {
};
}

private String projectKey;
private String key;

public ByProjectKeyChannelsKeyByKeyDelete(final ApiHttpClient apiHttpClient, String projectKey, String key) {
super(apiHttpClient);
this.projectKey = projectKey;
this.key = key;
}

public ByProjectKeyChannelsKeyByKeyDelete(ByProjectKeyChannelsKeyByKeyDelete t) {
super(t);
this.projectKey = t.projectKey;
this.key = t.key;
}

@Override
protected ApiHttpRequest buildHttpRequest() {
List<String> params = new ArrayList<>(getQueryParamUriStrings());
String httpRequestPath = String.format("%s/channels/key=%s", encodePathParam(this.projectKey),
encodePathParam(this.key));
if (!params.isEmpty()) {
httpRequestPath += "?" + String.join("&", params);
}
return new ApiHttpRequest(ApiHttpMethod.DELETE, URI.create(httpRequestPath), getHeaders(), null);
}

@Override
public ApiHttpResponse<com.commercetools.api.models.channel.Channel> executeBlocking(final ApiHttpClient client,
final Duration timeout) {
return executeBlocking(client, timeout, com.commercetools.api.models.channel.Channel.class);
}

@Override
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.channel.Channel>> execute(
final ApiHttpClient client) {
return execute(client, com.commercetools.api.models.channel.Channel.class);
}

public String getProjectKey() {
return this.projectKey;
}

public String getKey() {
return this.key;
}

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 setKey(final String key) {
this.key = key;
}

/**
* set version with the specified value
* @param version value to be set
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete withVersion(final TValue version) {
return copy().withQueryParam("version", version);
}

/**
* add additional version query parameter
* @param version value to be added
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete addVersion(final TValue version) {
return copy().addQueryParam("version", version);
}

/**
* set version with the specified value
* @param supplier supplier for the value to be set
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete withVersion(final Supplier<Long> supplier) {
return copy().withQueryParam("version", supplier.get());
}

/**
* add additional version query parameter
* @param supplier supplier for the value to be added
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete addVersion(final Supplier<Long> supplier) {
return copy().addQueryParam("version", supplier.get());
}

/**
* set version with the specified value
* @param op builder for the value to be set
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete withVersion(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("version", op.apply(new StringBuilder()));
}

/**
* add additional version query parameter
* @param op builder for the value to be added
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete addVersion(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("version", op.apply(new StringBuilder()));
}

/**
* set version with the specified values
* @param version values to be set
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete withVersion(final Collection<TValue> version) {
return copy().withoutQueryParam("version")
.addQueryParams(
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList()));
}

/**
* add additional version query parameters
* @param version values to be added
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete addVersion(final Collection<TValue> version) {
return copy().addQueryParams(
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList()));
}

/**
* set expand with the specified value
* @param expand value to be set
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete withExpand(final TValue expand) {
return copy().withQueryParam("expand", expand);
}

/**
* add additional expand query parameter
* @param expand value to be added
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete addExpand(final TValue expand) {
return copy().addQueryParam("expand", expand);
}

/**
* set expand with the specified value
* @param supplier supplier for the value to be set
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete withExpand(final Supplier<String> supplier) {
return copy().withQueryParam("expand", supplier.get());
}

/**
* add additional expand query parameter
* @param supplier supplier for the value to be added
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete addExpand(final Supplier<String> supplier) {
return copy().addQueryParam("expand", supplier.get());
}

/**
* set expand with the specified value
* @param op builder for the value to be set
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete withExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
}

/**
* add additional expand query parameter
* @param op builder for the value to be added
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public ByProjectKeyChannelsKeyByKeyDelete addExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
}

/**
* set expand with the specified values
* @param expand values to be set
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete withExpand(final Collection<TValue> expand) {
return copy().withoutQueryParam("expand")
.addQueryParams(
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
}

/**
* add additional expand query parameters
* @param expand values to be added
* @param <TValue> value type
* @return ByProjectKeyChannelsKeyByKeyDelete
*/
public <TValue> ByProjectKeyChannelsKeyByKeyDelete addExpand(final Collection<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;

ByProjectKeyChannelsKeyByKeyDelete that = (ByProjectKeyChannelsKeyByKeyDelete) o;

return new EqualsBuilder().append(projectKey, that.projectKey).append(key, that.key).isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(projectKey).append(key).toHashCode();
}

@Override
protected ByProjectKeyChannelsKeyByKeyDelete copy() {
return new ByProjectKeyChannelsKeyByKeyDelete(this);
}
}
Loading
Loading