com.pubnub.internal.endpoints.objects_api.channel.RemoveChannelMetadataImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-gson-impl Show documentation
Show all versions of pubnub-gson-impl Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
package com.pubnub.internal.endpoints.objects_api.channel;
import com.pubnub.api.endpoints.objects_api.channel.RemoveChannelMetadata;
import com.pubnub.api.endpoints.remoteaction.ExtendedRemoteAction;
import com.pubnub.api.endpoints.remoteaction.MappingRemoteAction;
import com.pubnub.api.models.consumer.objects_api.channel.PNRemoveChannelMetadataResult;
import com.pubnub.internal.EndpointInterface;
import com.pubnub.internal.PubNubCore;
import com.pubnub.internal.endpoints.DelegatingEndpoint;
import com.pubnub.internal.models.consumer.objects.PNRemoveMetadataResult;
import lombok.AllArgsConstructor;
import org.jetbrains.annotations.NotNull;
public class RemoveChannelMetadataImpl extends DelegatingEndpoint implements RemoveChannelMetadata {
public RemoveChannelMetadataImpl(String channel, final PubNubCore pubnubInstance) {
super(pubnubInstance);
this.channel = channel;
}
private final String channel;
@NotNull
@Override
protected ExtendedRemoteAction mapResult(@NotNull ExtendedRemoteAction action) {
return new MappingRemoteAction<>(action,
result -> new PNRemoveChannelMetadataResult(
result.getStatus(),
null
)
);
}
@Override
@NotNull
protected EndpointInterface createAction() {
return pubnub.removeChannelMetadata(channel);
}
@AllArgsConstructor
public static class Builder implements RemoveChannelMetadata.Builder {
private final PubNubCore pubnubInstance;
@Override
public RemoveChannelMetadata channel(String channel) {
return new RemoveChannelMetadataImpl(channel, pubnubInstance);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy