+ * Spec: RSN2, RTS2 + * @param name The channel name. + * @return `true` if it contains the specified [name]. + */ + fun contains(name: String): Boolean + + /** + * Creates a new [Channel] object, or returns the existing channel object. + *
+ * Spec: RSN3a, RTS3a + * @param name The channel name. + * @return A [Channel] object. + */ + fun get(name: String): ChannelType + + /** + * Creates a new [Channel] object, with the specified [ChannelOptions], or returns the existing channel object. + *
+ * Spec: RSN3c, RTS3c + * @param name The channel name. + * @param options A [ChannelOptions] object. + * @return A [Channel] object. + */ + fun get(name: String, options: ChannelOptions): ChannelType + + /** + * Releases a [Channel] object, deleting it, and enabling it to be garbage collected. + * It also removes any listeners associated with the channel. + * To release a channel, the [ChannelState] must be `INITIALIZED`, `DETACHED`, or `FAILED`. + *
+ * Spec: RSN4, RTS4
+ * @param name The channel name.
+ */
+ fun release(name: String)
+}
diff --git a/pubsub-adapter/src/main/kotlin/com/ably/pubsub/Client.kt b/pubsub-adapter/src/main/kotlin/com/ably/pubsub/Client.kt
new file mode 100644
index 000000000..83539b3f3
--- /dev/null
+++ b/pubsub-adapter/src/main/kotlin/com/ably/pubsub/Client.kt
@@ -0,0 +1,174 @@
+package com.ably.pubsub
+
+import com.ably.query.OrderBy
+import com.ably.query.TimeUnit
+import com.ably.http.HttpMethod
+import io.ably.lib.http.HttpCore
+import io.ably.lib.push.Push
+import io.ably.lib.rest.Auth
+import io.ably.lib.types.*
+
+/**
+ * A client that offers a base interface to interact with Ably's API.
+ *
+ * This class implements {@link AutoCloseable} so you can use it in
+ * try-with-resources constructs and have the JDK close it for you.
+ */
+interface Client : AutoCloseable {
+
+ /**
+ * An [Auth] object.
+ *
+ * Spec: RSC5
+ */
+ val auth: Auth
+
+ /**
+ * A [Channels] object.
+ *
+ * Spec: RTC3, RTS1
+ */
+ val channels: Channels
+ * Spec: RSC16
+ * @return The time as milliseconds since the Unix epoch.
+ */
+ fun time(): Long
+
+ /**
+ * Asynchronously retrieves the time from the Ably service as milliseconds
+ * since the Unix epoch. Clients that do not have access
+ * to a sufficiently well maintained time source and wish
+ * to issue Ably [Auth.TokenRequest] with
+ * a more accurate timestamp should use the
+ * [ClientOptions.queryTime] property instead of this method.
+ *
+ * Spec: RSC16
+ *
+ * @param callback Listener with the time as milliseconds since the Unix epoch.
+ * This callback is invoked on a background thread
+ */
+ fun timeAsync(callback: Callback
+ * Spec: RTC2
+ */
+ val connection: Connection
+
+ /**
+ * Collection of [RealtimeChannel] instances currently managed by Realtime client
+ */
+ override val channels: Channels