Skip to content

Commit

Permalink
Generate proper request types for encoding strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
christiandeange committed Nov 9, 2024
1 parent 50111d8 commit a181562
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
12 changes: 6 additions & 6 deletions bluesky/api/bluesky.api
Original file line number Diff line number Diff line change
Expand Up @@ -12176,7 +12176,7 @@ public abstract interface class sh/christian/ozone/BlueskyApi {
public abstract fun getUnreadCount (Lapp/bsky/notification/GetUnreadCountQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getUploadLimits (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getValues (Ltools/ozone/set/GetValuesQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun importRepo (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun importRepo ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun leaveConvo (Lchat/bsky/convo/LeaveConvoRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun listAppPasswords (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun listBlobs (Lcom/atproto/sync/ListBlobsQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -12243,8 +12243,8 @@ public abstract interface class sh/christian/ozone/BlueskyApi {
public abstract fun updateSeen (Lapp/bsky/notification/UpdateSeenRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun updateSubjectStatus (Lcom/atproto/admin/UpdateSubjectStatusRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun updateTemplate (Ltools/ozone/communication/UpdateTemplateRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun uploadBlob (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun uploadVideo (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun uploadBlob ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun uploadVideo ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun upsertOption (Ltools/ozone/setting/UpsertOptionRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun upsertSet (Ltools/ozone/set/Set;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
Expand Down Expand Up @@ -12353,7 +12353,7 @@ public final class sh/christian/ozone/XrpcBlueskyApi : sh/christian/ozone/Bluesk
public fun getUnreadCount (Lapp/bsky/notification/GetUnreadCountQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun getUploadLimits (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun getValues (Ltools/ozone/set/GetValuesQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun importRepo (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun importRepo ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun leaveConvo (Lchat/bsky/convo/LeaveConvoRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun listAppPasswords (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun listBlobs (Lcom/atproto/sync/ListBlobsQueryParams;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -12420,8 +12420,8 @@ public final class sh/christian/ozone/XrpcBlueskyApi : sh/christian/ozone/Bluesk
public fun updateSeen (Lapp/bsky/notification/UpdateSeenRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun updateSubjectStatus (Lcom/atproto/admin/UpdateSubjectStatusRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun updateTemplate (Ltools/ozone/communication/UpdateTemplateRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadBlob (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadVideo (Lkotlin/Unit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadBlob ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadVideo ([BLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun upsertOption (Ltools/ozone/setting/UpsertOptionRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun upsertSet (Ltools/ozone/set/Set;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,14 @@ class LexiconApiGenerator(

private fun LexiconXrpcBody.type(context: GeneratorContext, suffix: String): ApiType {
return ApiType(
typeName = if (schema != null) {
when (encoding) {
"*/*",
"application/vnd.ipld.car" -> BYTE_ARRAY
"text/plain" -> STRING
"application/json",
"application/jsonl" -> ClassName(context.authority, "${context.classPrefix}$suffix")
else -> error("Unknown encoding: $encoding")
}
} else {
UNIT
typeName = when (encoding) {
"*/*",
"video/mp4",
"application/jsonl",
"application/vnd.ipld.car" -> BYTE_ARRAY
"text/plain" -> STRING
"application/json" -> ClassName(context.authority, "${context.classPrefix}$suffix")
else -> error("Unknown encoding: $encoding")
},
description = description,
encoding = encoding,
Expand Down

0 comments on commit a181562

Please sign in to comment.