Skip to content

Commit

Permalink
Addressing SDK archboard review comments (#31191)
Browse files Browse the repository at this point in the history
* Addressing SDK archboard review comments

* Fixing TypeSpecValidation error

* Updating the model property renames in client.tsp as per the review feedback

* Adding model property overrides for java

* Fixing formatting

* Trying the renaming of models in client.tsp to address swagger breaking changes

* Updating the return type of getSupportedFormats to an array if FileFormat

* Fixing the API name in the example

* Reverting the return type of getSupportedFormats and reverting guid to string type for id

* Reverting renaming of id property within TranslationStatus and DocumentStatus

* Reverting TranslationStatus id type

* Updating the opeapi accordingly

* Making getSupportedFormats() internal in Java , so it can we overriden

* Updating the StartTranslation API name to Translation for Java SDK

* Making getSupportedFormats method protocol only for Java

* Removing the space for langs

* Undoing SupportedFileFormats model as internal for Java

* Separating model access for Python and java

* Adding SupportedFileFormats model and making it internal for Java
  • Loading branch information
hamshavathimunibyraiah authored Oct 28, 2024
1 parent 7f4a479 commit ccc08b4
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 26 deletions.
93 changes: 81 additions & 12 deletions specification/translation/Azure.AI.DocumentTranslation/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,39 @@ interface SingleDocumentTranslationClient {
documentTranslate is DocumentTranslation.DocumentTranslationOperations.documentTranslate;
}

@@clientName(DocumentTranslation.DocumentTranslateBody.body,
"documentTranslateContent",
"csharp"
);
@@clientName(SingleDocumentTranslationClient.documentTranslate, "translate");

@@clientName(DocumentTranslation.StatusSummary, "translationStatusSummary");

@@clientName(DocumentTranslation.StorageSource, "translationStorageSource");

@@clientName(DocumentTranslation.DocumentTranslateBody.body,
"documentTranslateContent",
"java"
"csharp, java"
);

@@clientName(DocumentTranslation.StartTranslationBody.body,
"startTranslationDetails",
"csharp"
@@clientName(DocumentTranslation.StartTranslationDetails,
"translationBatch",
"csharp, java"
);

@@clientName(DocumentTranslation.StartTranslationBody.body,
"startTranslationDetails",
"java"
);
@@clientName(DocumentTranslation.BatchRequest, "documentBatch", "python");

@@convenientAPI(DocumentTranslationClient.getSupportedFormats, false, "java");

@@access(DocumentTranslationClient.getSupportedFormats,
Access.internal,
"python"
);
@@access(DocumentTranslation.SupportedFileFormats, Access.internal, "java");
@@usage(DocumentTranslation.SupportedFileFormats, Usage.output, "java");

@@access(DocumentTranslation.FileFormat, Access.public, "java");
@@usage(DocumentTranslation.FileFormat, Usage.output, "java");

@@access(DocumentTranslation.FileFormatType, Access.public, "java");
@@usage(DocumentTranslation.FileFormatType, Usage.output, "java");

@@access(DocumentTranslation.FileFormat, Access.public, "python");
@@usage(DocumentTranslation.FileFormat, Usage.output, "python");
@@access(DocumentTranslation.FileFormatType, Access.public, "python");
Expand Down Expand Up @@ -169,3 +178,63 @@ interface SingleDocumentTranslationClient {
@@clientName(DocumentTranslation.Status.Cancelled, "canceled", "python");

@@clientName(DocumentTranslation.Status.Cancelling, "canceling", "python");

@@clientName(DocumentTranslation.BatchRequest,
"documentTranslationInput",
"java"
);

@@clientName(DocumentTranslationClient.startTranslation, "translation", "java");

@@clientName(DocumentTranslationClient.getDocumentsStatus,
"listDocumentStatuses",
"java"
);

@@clientName(DocumentTranslationClient.getTranslationsStatus,
"listTranslationStatuses",
"java"
);

@@clientName(DocumentTranslation.TranslationStatus,
"translationStatusResult",
"java"
);

@@clientName(DocumentTranslation.Status, "translationStatus", "java");

@@clientName(DocumentTranslation.TranslationStatus.createdDateTimeUtc,
"createdOn",
"java"
);

@@clientName(DocumentTranslation.TranslationStatus.lastActionDateTimeUtc,
"lastUpdatedOn",
"java"
);

@@clientName(DocumentTranslation.StatusSummary.cancelled,
"cancelledCount",
"java"
);

@@clientName(DocumentTranslation.StatusSummary.failed, "failedCount", "java");

@@clientName(DocumentTranslation.StatusSummary.inProgress,
"inProgressCount",
"java"
);

@@clientName(DocumentTranslation.StatusSummary.notYetStarted,
"notYetStartedCount",
"java"
);

@@clientName(DocumentTranslation.StatusSummary.success, "successCount", "java");

@@clientName(DocumentTranslation.StatusSummary.total, "totalCount", "java");

@@clientName(DocumentTranslation.StatusSummary.totalCharacterCharged,
"totalCharactersChargedCount",
"java"
);
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ model TranslationsStatus {

@doc("Translation job status response")
model TranslationStatus {
@doc("Id of the operation.")
@doc("Id of the translation operation.")
id: string;

@doc("Operation created date time")
Expand Down Expand Up @@ -433,7 +433,7 @@ model FileFormat {
versions?: string[];

@doc("Supported Type for this format")
type?: string;
type?: FileFormatType;
}

@doc("Document Translate Request Body")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ interface DocumentTranslationOperations {
maxpagesize?: int32 = 50;

@doc("Ids to use in filtering")
@clientName("translationIds")
@query("ids")
ids?: uuid[];

Expand Down Expand Up @@ -216,7 +217,7 @@ interface DocumentTranslationOperations {
getDocumentStatus is Azure.Core.Foundations.Operation<
{
@doc("Format - uuid. The batch id")
@clientName("translation_id", "python")
@clientName("translationId")
@path
id: uuid;

Expand All @@ -240,7 +241,7 @@ interface DocumentTranslationOperations {
getTranslationStatus is Azure.Core.Foundations.Operation<
{
@doc("Format - uuid. The operation id")
@clientName("translation_id", "python")
@clientName("translationId")
@path
id: uuid;
},
Expand All @@ -264,7 +265,7 @@ interface DocumentTranslationOperations {
cancelTranslation is Azure.Core.Foundations.Operation<
{
@doc("Format - uuid. The operation-id")
@clientName("translation_id", "python")
@clientName("translationId")
@path
id: uuid;
},
Expand Down Expand Up @@ -326,7 +327,7 @@ interface DocumentTranslationOperations {
getDocumentsStatus is Azure.Core.Foundations.Operation<
{
@doc("Format - uuid. The operation id")
@clientName("translation_id", "python")
@clientName("translationId")
@path
id: uuid;

Expand Down Expand Up @@ -383,6 +384,7 @@ interface DocumentTranslationOperations {
maxpagesize?: int32 = 50;

@doc("Ids to use in filtering")
@clientName("documentIds")
@query("ids")
ids?: uuid[];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@
"type": "string",
"format": "uuid"
},
"collectionFormat": "csv"
"collectionFormat": "csv",
"x-ms-client-name": "translationIds"
},
{
"name": "statuses",
Expand Down Expand Up @@ -242,7 +243,8 @@
"description": "Format - uuid. The operation id",
"required": true,
"type": "string",
"format": "uuid"
"format": "uuid",
"x-ms-client-name": "translationId"
}
],
"responses": {
Expand Down Expand Up @@ -285,7 +287,8 @@
"description": "Format - uuid. The operation-id",
"required": true,
"type": "string",
"format": "uuid"
"format": "uuid",
"x-ms-client-name": "translationId"
}
],
"responses": {
Expand Down Expand Up @@ -330,7 +333,8 @@
"description": "Format - uuid. The operation id",
"required": true,
"type": "string",
"format": "uuid"
"format": "uuid",
"x-ms-client-name": "translationId"
},
{
"name": "top",
Expand Down Expand Up @@ -371,7 +375,8 @@
"type": "string",
"format": "uuid"
},
"collectionFormat": "csv"
"collectionFormat": "csv",
"x-ms-client-name": "documentIds"
},
{
"name": "statuses",
Expand Down Expand Up @@ -457,7 +462,8 @@
"description": "Format - uuid. The batch id",
"required": true,
"type": "string",
"format": "uuid"
"format": "uuid",
"x-ms-client-name": "translationId"
},
{
"name": "documentId",
Expand Down Expand Up @@ -925,7 +931,7 @@
}
},
"type": {
"type": "string",
"$ref": "#/definitions/FileFormatType",
"description": "Supported Type for this format"
}
},
Expand Down Expand Up @@ -1348,7 +1354,7 @@
"properties": {
"id": {
"type": "string",
"description": "Id of the operation."
"description": "Id of the translation operation."
},
"createdDateTimeUtc": {
"type": "string",
Expand Down

0 comments on commit ccc08b4

Please sign in to comment.