Skip to content

Commit

Permalink
fix spread for purview datamap and translation document (#29707)
Browse files Browse the repository at this point in the history
* update

* update

* update

* update translation

* update

* fix ai document translation

* fix wrong change and regen

* fix

* update swagger

* update

* format

* change to use @Body

* update

* format

---------

Co-authored-by: tadelesh <tadelesh.shi@live.cn>
  • Loading branch information
ArcturusZhang and tadelesh authored Jul 9, 2024
1 parent cbbe228 commit 73e33d0
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 100 deletions.
48 changes: 30 additions & 18 deletions specification/purview/Azure.Analytics.Purview.DataMap/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ interface Entity {
""")
@query
collectionId?: string;
} & AtlasEntityWithExtInfo,
} & BodyParameter<AtlasEntityWithExtInfo>,
EntityMutationResult,
AtlasApiVersionParameterTraits
>;
Expand Down Expand Up @@ -174,7 +174,7 @@ interface Entity {
""")
@query
businessAttributeUpdateBehavior?: BusinessAttributeUpdateBehavior;
} & AtlasEntitiesWithExtInfo,
} & BodyParameter<AtlasEntitiesWithExtInfo>,
EntityMutationResult,
AtlasApiVersionParameterTraits
>;
Expand Down Expand Up @@ -205,7 +205,11 @@ interface Entity {
@doc("Associate a classification to multiple entities in bulk.")
@route("/atlas/v2/entity/bulk/classification")
@post
addClassification is AtlasOperation<ClassificationAssociateOptions, void, {}>;
addClassification is AtlasOperation<
BodyParameter<ClassificationAssociateOptions>,
void,
{}
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version"
Expand Down Expand Up @@ -447,7 +451,7 @@ interface Entity {
""")
@query("attr:qualifiedName")
attribute?: string;
} & AtlasEntityWithExtInfo,
} & BodyParameter<AtlasEntityWithExtInfo>,
EntityMutationResult,
{}
>;
Expand Down Expand Up @@ -576,7 +580,7 @@ interface Entity {
@route("/atlas/v2/entity/bulk/setClassifications")
@post
bulkSetClassifications is AtlasOperation<
AtlasEntityHeaders,
BodyParameter<AtlasEntityHeaders>,
OkResponse<string[]>,
{}
>;
Expand Down Expand Up @@ -765,7 +769,7 @@ interface Entity {
@route("/atlas/v2/entity/businessmetadata/import")
@post
importBusinessMetadata is AtlasImportOperation<
BusinessMetadataOptions,
BodyParameter<BusinessMetadataOptions>,
BulkImportResult,
MultipartFormDataRequestHeadersTraits
>;
Expand Down Expand Up @@ -966,7 +970,7 @@ interface Entity {
@doc("The collection where entities will be moved to.")
@query
collectionId: string;
} & MoveEntitiesOptions,
} & BodyParameter<MoveEntitiesOptions>,
EntityMutationResult,
{},
AtlasErrorResponse
Expand Down Expand Up @@ -1011,7 +1015,7 @@ interface Glossary {
@doc("Create a glossary.")
@route("/atlas/v2/glossary")
@post
create is AtlasOperation<AtlasGlossary, AtlasGlossary, {}>;
create is AtlasOperation<BodyParameter<AtlasGlossary>, AtlasGlossary, {}>;

#suppress "@azure-tools/typespec-azure-core/request-body-problem" "This is Atlas API behavior"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
Expand All @@ -1035,7 +1039,7 @@ interface Glossary {
@route("/atlas/v2/glossary/category")
@post
createCategory is AtlasOperation<
AtlasGlossaryCategory,
BodyParameter<AtlasGlossaryCategory>,
AtlasGlossaryCategory,
{}
>;
Expand Down Expand Up @@ -1065,7 +1069,7 @@ interface Glossary {
@doc("The globally unique identifier of the category.")
@path
categoryId: string;
} & AtlasGlossaryCategory,
} & BodyParameter<AtlasGlossaryCategory>,
AtlasGlossaryCategory,
{}
>;
Expand Down Expand Up @@ -1178,7 +1182,7 @@ interface Glossary {
@doc("Whether include term hierarchy")
@query
includeTermHierarchy?: boolean;
} & AtlasGlossaryTerm,
} & BodyParameter<AtlasGlossaryTerm>,
AtlasGlossaryTerm,
{}
>;
Expand Down Expand Up @@ -1210,7 +1214,7 @@ interface Glossary {
@doc("Whether include term hierarchy")
@query
includeTermHierarchy?: boolean;
} & AtlasGlossaryTerm,
} & BodyParameter<AtlasGlossaryTerm>,
AtlasGlossaryTerm,
AtlasApiVersionParameterTraits
>;
Expand Down Expand Up @@ -1412,7 +1416,7 @@ interface Glossary {
@doc("Whether ignore terms and categories")
@query
ignoreTermsAndCategories?: boolean;
} & AtlasGlossary,
} & BodyParameter<AtlasGlossary>,
AtlasGlossary,
AtlasApiVersionParameterTraits
>;
Expand Down Expand Up @@ -1752,14 +1756,22 @@ interface Relationship {
@doc("Create a new relationship between entities.")
@route("/atlas/v2/relationship")
@post
create is AtlasOperation<AtlasRelationship, AtlasRelationship, {}>;
create is AtlasOperation<
BodyParameter<AtlasRelationship>,
AtlasRelationship,
{}
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version"
@doc("Update an existing relationship between entities.")
@route("/atlas/v2/relationship")
@put
update is AtlasOperation<AtlasRelationship, AtlasRelationship, {}>;
update is AtlasOperation<
BodyParameter<AtlasRelationship>,
AtlasRelationship,
{}
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version"
Expand Down Expand Up @@ -2051,7 +2063,7 @@ interface Type {
""")
@route("/atlas/v2/types/typedefs")
@post
bulkCreate is AtlasOperation<AtlasTypesDef, AtlasTypesDef, {}>;
bulkCreate is AtlasOperation<BodyParameter<AtlasTypesDef>, AtlasTypesDef, {}>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version"
Expand All @@ -2061,14 +2073,14 @@ interface Type {
""")
@route("/atlas/v2/types/typedefs")
@put
bulkUpdate is AtlasOperation<AtlasTypesDef, AtlasTypesDef, {}>;
bulkUpdate is AtlasOperation<BodyParameter<AtlasTypesDef>, AtlasTypesDef, {}>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "This is Atlas API, which does not require api version"
@doc("Delete API for all types in bulk.")
@route("/atlas/v2/types/typedefs")
@delete
bulkDelete is AtlasOperation<AtlasTypesDef, void, {}>;
bulkDelete is AtlasOperation<BodyParameter<AtlasTypesDef>, void, {}>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is Atlas API"
@doc("List all type definitions returned as a list of minimal information header.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntityWithExtInfo"
Expand Down Expand Up @@ -241,6 +242,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntitiesWithExtInfo"
Expand Down Expand Up @@ -312,6 +314,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/ClassificationAssociateOptions"
Expand Down Expand Up @@ -344,6 +347,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntityHeaders"
Expand Down Expand Up @@ -438,7 +442,11 @@
],
"parameters": [
{
"$ref": "#/parameters/BusinessMetadataOptions"
"name": "file",
"in": "formData",
"description": "InputStream of file",
"required": true,
"type": "file"
}
],
"responses": {
Expand Down Expand Up @@ -1237,6 +1245,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntityWithExtInfo"
Expand Down Expand Up @@ -1671,6 +1680,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossary"
Expand Down Expand Up @@ -1755,6 +1765,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossary"
Expand Down Expand Up @@ -2203,6 +2214,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossaryCategory"
Expand Down Expand Up @@ -2277,6 +2289,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossaryCategory"
Expand Down Expand Up @@ -2519,6 +2532,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossaryTerm"
Expand Down Expand Up @@ -2612,6 +2626,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasGlossaryTerm"
Expand Down Expand Up @@ -3156,6 +3171,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasRelationship"
Expand Down Expand Up @@ -3189,6 +3205,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasRelationship"
Expand Down Expand Up @@ -3915,6 +3932,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasTypesDef"
Expand Down Expand Up @@ -3948,6 +3966,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasTypesDef"
Expand Down Expand Up @@ -3984,6 +4003,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasTypesDef"
Expand Down Expand Up @@ -4142,6 +4162,7 @@
{
"name": "body",
"in": "body",
"description": "Body parameter.",
"required": true,
"schema": {
"$ref": "#/definitions/MoveEntitiesOptions"
Expand Down Expand Up @@ -8241,14 +8262,6 @@
"minLength": 1,
"x-ms-parameter-location": "method",
"x-ms-client-name": "apiVersion"
},
"BusinessMetadataOptions": {
"name": "file",
"in": "formData",
"description": "InputStream of file",
"required": true,
"type": "file",
"x-ms-parameter-location": "method"
}
}
}
10 changes: 10 additions & 0 deletions specification/translation/Azure.AI.DocumentTranslation/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,13 @@ interface SingleDocumentTranslationClient {
@@access(DocumentTranslation.DocumentsStatus, Access.internal, "python");
@@access(DocumentTranslation.SupportedFileFormats, Access.internal, "python");
@@access(DocumentTranslation.FileFormat, Access.internal, "python");

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

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

0 comments on commit 73e33d0

Please sign in to comment.