-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored api_data.cr into separate files
- Loading branch information
Showing
8 changed files
with
86 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
module DeepL | ||
class DocumentHandle | ||
include JSON::Serializable | ||
|
||
@[JSON::Field(key: "document_id")] | ||
property id : String | ||
|
||
@[JSON::Field(key: "document_key")] | ||
property key : String | ||
end | ||
end |
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,22 @@ | ||
module DeepL | ||
class DocumentStatus | ||
include JSON::Serializable | ||
|
||
@[JSON::Field(key: "document_id")] | ||
property id : String | ||
property status : String | ||
property seconds_remaining : Int32? | ||
property billed_characters : UInt64? | ||
property error_message : String? | ||
|
||
def summary : String | ||
String.build do |s| | ||
s << "(i) #{id}" | ||
s << " (s) #{status}" | ||
s << " (t) #{seconds_remaining}" if seconds_remaining | ||
s << " (c) #{billed_characters}" if billed_characters | ||
s << " (e) #{error_message}" if error_message | ||
end | ||
end | ||
end | ||
end |
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,16 @@ | ||
module DeepL | ||
class GlossaryInfo | ||
include JSON::Serializable | ||
|
||
property glossary_id : String | ||
property name : String | ||
property ready : Bool | ||
property source_lang : String | ||
property target_lang : String | ||
property creation_time : String # FIXME | ||
property entry_count : UInt32 | ||
|
||
def initialize(@glossary_id, @name, @ready, @source_lang, @target_lang, @creation_time, @entry_count) | ||
end | ||
end | ||
end |
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 @@ | ||
module DeepL | ||
class GlossaryLanguagePair | ||
include JSON::Serializable | ||
|
||
property source_lang : String | ||
property target_lang : String | ||
end | ||
end |
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,9 @@ | ||
module DeepL | ||
class LanguageInfo | ||
include JSON::Serializable | ||
|
||
property language : String | ||
property name : String | ||
property supports_formality : Bool? | ||
end | ||
end |
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,3 @@ | ||
module DeepL | ||
record TextResult, text : String, detected_source_language : String | ||
end |
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