All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pubnub.api.services.ObjectsService.kt Maven / Gradle / Ivy

Go to download

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!

There is a newer version: 10.2.0
Show newest version
package com.pubnub.api.services

import com.pubnub.api.models.consumer.objects.channel.PNChannelMetadata
import com.pubnub.api.models.consumer.objects.member.PNMember
import com.pubnub.api.models.consumer.objects.membership.PNChannelMembership
import com.pubnub.api.models.consumer.objects.uuid.PNUUIDMetadata
import com.pubnub.api.models.server.objects_api.ChangeMemberInput
import com.pubnub.api.models.server.objects_api.ChangeMembershipInput
import com.pubnub.api.models.server.objects_api.ChannelMetadataInput
import com.pubnub.api.models.server.objects_api.EntityArrayEnvelope
import com.pubnub.api.models.server.objects_api.EntityEnvelope
import com.pubnub.api.models.server.objects_api.UUIDMetadataInput
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.PATCH
import retrofit2.http.Path
import retrofit2.http.QueryMap

internal interface ObjectsService {
    @GET("v2/objects/{subKey}/uuids")
    fun getAllUUIDMetadata(
        @Path("subKey") subKey: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @GET("v2/objects/{subKey}/uuids/{uuid}")
    fun getUUIDMetadata(
        @Path("subKey") subKey: String,
        @Path("uuid") uuid: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @PATCH("v2/objects/{subKey}/uuids/{uuid}")
    @Headers("Content-Type: application/json; charset=UTF-8")
    fun setUUIDMetadata(
        @Path("subKey") subKey: String,
        @Path("uuid") uuid: String,
        @Body body: UUIDMetadataInput,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @DELETE("v2/objects/{subKey}/uuids/{uuid}")
    fun deleteUUIDMetadata(
        @Path("subKey") subKey: String,
        @Path("uuid") uuid: String
    ): Call>

    @GET("v2/objects/{subKey}/channels")
    fun getAllChannelMetadata(
        @Path("subKey") subKey: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @GET("v2/objects/{subKey}/channels/{channel}")
    fun getChannelMetadata(
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @PATCH("v2/objects/{subKey}/channels/{channel}")
    @Headers("Content-Type: application/json; charset=UTF-8")
    fun setChannelMetadata(
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @Body body: ChannelMetadataInput,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @DELETE("v2/objects/{subKey}/channels/{channel}")
    fun deleteChannelMetadata(
        @Path("subKey") subKey: String,
        @Path("channel") channel: String
    ): Call>

    @GET("/v2/objects/{subKey}/uuids/{uuid}/channels")
    fun getMemberships(
        @Path("subKey") subKey: String,
        @Path("uuid") uuid: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @PATCH("/v2/objects/{subKey}/uuids/{uuid}/channels")
    @Headers("Content-Type: application/json; charset=UTF-8")
    fun patchMemberships(
        @Path("subKey") subKey: String,
        @Path("uuid") uuid: String,
        @Body body: ChangeMembershipInput,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @GET("/v2/objects/{subKey}/channels/{channel}/uuids")
    fun getChannelMembers(
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>

    @PATCH("/v2/objects/{subKey}/channels/{channel}/uuids")
    @Headers("Content-Type: application/json; charset=UTF-8")
    fun patchChannelMembers(
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @Body body: ChangeMemberInput,
        @QueryMap(encoded = true) options: Map = mapOf()
    ): Call>
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy