Skip to content

Commit 849ea3e

Browse files
committed
Document all classes in the 'model' package
1 parent bf45498 commit 849ea3e

File tree

5 files changed

+61
-3
lines changed

5 files changed

+61
-3
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package net.pearx.kpastebin.model
22

3-
public enum class AccountType
4-
{
3+
/**
4+
* The list of Pastebin account types
5+
*/
6+
public enum class AccountType {
7+
/** Free basic account */
58
NORMAL,
9+
10+
/** Paid pro account */
611
PRO;
712
}

src/commonMain/kotlin/net/pearx/kpastebin/model/ExpireDate.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
11
package net.pearx.kpastebin.model
22

3+
/**
4+
* The list of possible Pastebin paste expire durations
5+
*/
36
public enum class ExpireDate(internal val code: String) {
7+
/** Paste will never expire */
48
NEVER("N"),
9+
10+
/** Paste will expire in 10 minutes after publication */
511
TEN_MINUTES("10M"),
12+
13+
/** Paste will expire in a hour after publication */
614
ONE_HOUR("1H"),
15+
16+
/** Paste will expire in a day after publication */
717
ONE_DAY("1D"),
18+
19+
/** Paste will expire in a week after publication */
820
ONE_WEEK("1W"),
21+
22+
/** Paste will expire in two weeks after publication */
923
TWO_WEEEKS("2W"),
24+
25+
/** Paste will expire in a month after publication */
1026
ONE_MONTH("1M"),
27+
28+
/** Paste will expire in six months after publication */
1129
SIX_MONTHS("6M"),
30+
31+
/** Paste will expire in a year after publication */
1232
ONE_YEAR("1Y");
1333

1434
internal companion object {

src/commonMain/kotlin/net/pearx/kpastebin/model/PasteDetails.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,30 @@ package net.pearx.kpastebin.model
33
import net.pearx.kpastebin.internal.XML_PARENT_REGEX
44
import net.pearx.kpastebin.internal.XML_PROPERTY_REGEX
55

6+
/**
7+
* A detailed Pastebin paste information
8+
*/
69
public data class PasteDetails(
10+
/** Paste key */
711
val key: String,
12+
/** Paste publication date */
813
val date: Int,
14+
/** Paste title */
915
val title: String,
16+
/** Paste size in bytes */
1017
val size: Int,
18+
/** Paste expiration date */ // todo
1119
val expireDate: Int,
20+
/** Paste privacy status */
1221
val privacy: Privacy,
22+
/** Paste syntax highlighting language in a user-readable format (e.g., Kotlin or C#) */
1323
val formatLong: String,
24+
/** Paste syntax highlighting language in a short format (e.g. kotlin or csharp) */
1425
val formatShort: String,
26+
/** Paste URL */
1527
val url: String,
16-
val hist: Int
28+
/** Paste views count */
29+
val hits: Int
1730
) {
1831
internal companion object {
1932
fun parseList(input: String): List<PasteDetails> {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
package net.pearx.kpastebin.model
22

3+
/**
4+
* The list of possible Pastebin paste privacy states
5+
*/
36
public enum class Privacy {
7+
/** Paste is visible for all users */
48
PUBLIC,
9+
10+
/** Paste is invisible for others unless you share your paste link */
511
UNLISTED,
12+
13+
/** Paste is visible only for you */
614
PRIVATE;
715
}

src/commonMain/kotlin/net/pearx/kpastebin/model/UserDetails.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,27 @@ package net.pearx.kpastebin.model
33
import net.pearx.kpastebin.internal.XML_PARENT_REGEX
44
import net.pearx.kpastebin.internal.XML_PROPERTY_REGEX
55

6+
/**
7+
* A detailed Pastebin user information
8+
*/
69
public data class UserDetails(
10+
/** Full user name */
711
val name: String,
12+
/** Default paste syntax highlighting language for this user in a short format (e.g., kotlin or csharp) */
813
val defaultFormatShort: String,
14+
/** Default paste expiration duration for this user */
915
val defaultExpiration: ExpireDate,
16+
/** User avatar URL */
1017
val avatarUrl: String,
18+
/** Default paste privacy status for this user */
1119
val defaultPrivacy: Privacy,
20+
/** User website */
1221
val website: String,
22+
/** User E-Mail */
1323
val email: String,
24+
/** User location */
1425
val location: String,
26+
/** User account type */
1527
val accountType: AccountType
1628
) {
1729
internal companion object {

0 commit comments

Comments
 (0)