Conversation
|
|
||
| } | ||
|
|
||
| [Action("GetUsage", Description = "Get usage information")] |
There was a problem hiding this comment.
Action name should follow the same naming convention as a description. So it should be "Get usage"
| { | ||
| var result = await Client.GetUsageAsync(); | ||
| var response = new GetUsageResponse(); | ||
| if (result.Character != null) |
There was a problem hiding this comment.
No need to check each property for null and then add it to the response. You can just add all the values with nullchecks, it will be null anyway. Worth adding a constructor to GetUsageResponse
| public bool DocumentLimitReached { get; set; } | ||
|
|
||
| [Display("Team Documents translated current billing period")] | ||
| public long? TeamDocumentCount { get; set; } |
There was a problem hiding this comment.
According to our naming conventions only the first word must start with the capital letter. So it should be "Team documents translated current billing period". Same for other properties
| namespace Apps.DeepL.Actions; | ||
|
|
||
| [ActionList] | ||
| public class GetUsageActionActions : DeepLInvocable |
There was a problem hiding this comment.
Action class is meant to contain actions for a specific entity and not only for one method. So the naming should be like "UsageActions"
bZverok
left a comment
There was a problem hiding this comment.
Need to fix namings and building of the response
Added the GetUsageAction which can be used to make sure translate actions can actually be performed based on remaining quota, mostly interesting for free users.