Skip to content

Commit 1ebba16

Browse files
committed
inline docs for android client, id and service files
1 parent 4fa87d5 commit 1ebba16

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

templates/android/library/src/main/java/io/package/Client.kt.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class Client @JvmOverloads constructor(
4444
) : CoroutineScope {
4545

4646
companion object {
47+
/**
48+
* The size for chunked uploads in bytes.
49+
*/
4750
internal const val CHUNK_SIZE = 5*1024*1024; // 5MB
4851
internal const val GLOBAL_PREFS = "{{ sdk.namespace | caseDot }}"
4952
internal const val COOKIE_PREFS = "myCookie"

templates/android/library/src/main/java/io/package/ID.kt.twig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import java.time.Instant
44
import kotlin.math.floor
55
import kotlin.random.Random
66

7+
/**
8+
* Helper class to generate ID strings for resources.
9+
*/
710
class ID {
811
companion object {
912
// Generate an hex ID based on timestamp
@@ -21,7 +24,12 @@ class ID {
2124
fun custom(id: String): String
2225
= id
2326

24-
// Generate a unique ID with padding to have a longer ID
27+
/**
28+
* Generate a unique ID with padding to have a longer ID
29+
*
30+
* @param padding The number of characters to add to the ID
31+
* @returns The unique ID
32+
*/
2533
fun unique(padding: Int = 7): String {
2634
val baseId = hexTimestamp()
2735
val randomPadding = (1..padding)

templates/android/library/src/main/java/io/package/Service.kt.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ package {{ sdk.namespace | caseDot }}
22

33
import {{ sdk.namespace | caseDot }}.Client
44

5+
/**
6+
* Abstract class for services.
7+
*
8+
* @param client The Appwrite client.
9+
*/
510
abstract class Service(val client: Client)

0 commit comments

Comments
 (0)