-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
292 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class Tuba.API.AkkomaTranslation : Entity { | ||
public string text { get; set; default = ""; } | ||
public string detected_language { get; set; default = ""; } | ||
|
||
public static AkkomaTranslation from (Json.Node node) throws Error { | ||
return Entity.from_json (typeof (API.AkkomaTranslation), node) as API.AkkomaTranslation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sources += files( | ||
'Source.vala', | ||
'Translation.vala', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public class Tuba.API.InstanceV2 : Entity { | ||
public class Configuration : Entity { | ||
public class Translation : Entity { | ||
public bool enabled { get; set; default = false; } | ||
} | ||
public Translation translation { get; set; default = null; } | ||
} | ||
|
||
public Configuration configuration { get; set; default = null; } | ||
|
||
public static InstanceV2 from (Json.Node node) throws Error { | ||
return Entity.from_json (typeof (API.InstanceV2), node) as API.InstanceV2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
public class Tuba.API.PollOption : Entity { | ||
public string? title { get; set; } | ||
public int64 votes_count { get; set; default=0; } | ||
public string? tuba_translated_title { get; set; default = null; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
public class Tuba.API.Translation : Entity { | ||
public class Poll : Entity { | ||
public class Option : Entity { | ||
public string title { get; set; default = ""; } | ||
} | ||
public string id { get; set; default = ""; } | ||
public Gee.ArrayList<Option>? options { get; set; default = null; } | ||
|
||
public override Type deserialize_array_type (string prop) { | ||
switch (prop) { | ||
case "options": | ||
return typeof (Option); | ||
} | ||
|
||
return base.deserialize_array_type (prop); | ||
} | ||
} | ||
|
||
public class Attachment : Entity { | ||
public string id { get; set; default = ""; } | ||
public string description { get; set; default = ""; } | ||
} | ||
|
||
public string content { get; set; default = ""; } | ||
public string spoiler_text { get; set; default = ""; } | ||
public Poll? poll { get; set; default = null; } | ||
public Gee.ArrayList<Attachment>? media_attachments { get; set; default = null; } | ||
public string detected_source_language { get; set; default = ""; } | ||
public string provider { get; set; default = ""; } | ||
|
||
public static Translation from (Json.Node node) throws Error { | ||
return Entity.from_json (typeof (API.Translation), node) as API.Translation; | ||
} | ||
|
||
public override Type deserialize_array_type (string prop) { | ||
switch (prop) { | ||
case "media-attachments": | ||
return typeof (Attachment); | ||
} | ||
|
||
return base.deserialize_array_type (prop); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.