io.sphere.sdk.channels.commands.ChannelCreateCommandImpl Maven / Gradle / Ivy
The newest version!
/*
This class has been generated by class io.sphere.sdk.annotations.processors.CreateCommandEndpointAnnotationProcessor
induced by the annotation io.sphere.sdk.annotations.HasCreateCommand.
in the source class io.sphere.sdk.channels.Channel.
To render this class the handlebars template 'commands/createCommandImplementation.hbs' has been used.
*/
package io.sphere.sdk.channels.commands;
import io.sphere.sdk.commands.MetaModelCreateCommandBuilder;
import io.sphere.sdk.commands.MetaModelCreateCommandImpl;
import io.sphere.sdk.channels.Channel;
import io.sphere.sdk.channels.ChannelDraft;
import io.sphere.sdk.channels.expansion.ChannelExpansionModel;
import io.sphere.sdk.client.JsonEndpoint;
final class ChannelCreateCommandImpl extends MetaModelCreateCommandImpl> implements ChannelCreateCommand {
ChannelCreateCommandImpl(final MetaModelCreateCommandBuilder> builder) {
super(builder);
}
ChannelCreateCommandImpl(final ChannelDraft body) {
super(body, JsonEndpoint.of(Channel.typeReference(), "/channels"), ChannelExpansionModel.of(), ChannelCreateCommandImpl::new);
}
@Override
public ChannelCreateCommand withDraft(final ChannelDraft draft) {
return new ChannelCreateCommandImpl(copyBuilder().draft(draft));
}
}