-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Expand file tree
/
Copy pathclient.tsp
More file actions
98 lines (72 loc) · 3.75 KB
/
client.tsp
File metadata and controls
98 lines (72 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import "@azure-tools/typespec-client-generator-core";
import "@typespec/rest";
import "@typespec/http";
import "@typespec/versioning";
import "./main.tsp";
using Azure.ClientGenerator.Core;
using ContentUnderstanding;
namespace ClientCustomizations;
@client({
name: "ContentUnderstandingClient",
service: ContentUnderstanding,
})
interface ContentUnderstandingClient {
// Flatten all ContentAnalyzers operations to client level
// LRO operations will automatically get "begin_" prefix in Python
analyze is ContentAnalyzers.analyze;
analyzeBinary is ContentAnalyzers.analyzeBinary;
copy is ContentAnalyzers.copy;
#suppress "@azure-tools/typespec-azure-core/use-standard-names" "Doesn't fit standard naming"
createAnalyzer is ContentAnalyzers.createOrReplace;
deleteAnalyzer is ContentAnalyzers.delete;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
deleteResult is ContentAnalyzers.deleteResult;
getAnalyzer is ContentAnalyzers.get;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getDefaults is ContentAnalyzers.getDefaults;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getOperationStatus is ContentAnalyzers.getOperationStatus;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getResult is ContentAnalyzers.getResult;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
getResultFile is ContentAnalyzers.getResultFile;
grantCopyAuthorization is ContentAnalyzers.grantCopyAuthorization;
listAnalyzers is ContentAnalyzers.list;
updateAnalyzer is ContentAnalyzers.update;
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Doesn't fit standard ops"
updateDefaults is ContentAnalyzers.updateDefaults;
}
// Rename type as fieldType to avoid conflict with built-in 'type' keyword.
@@clientName(ArrayField.type, "fieldType");
@@clientName(BooleanField.type, "fieldType");
@@clientName(DateField.type, "fieldType");
@@clientName(IntegerField.type, "fieldType");
@@clientName(NumberField.type, "fieldType");
@@clientName(ObjectField.type, "fieldType");
@@clientName(StringField.type, "fieldType");
@@clientName(TimeField.type, "fieldType");
@@clientName(JsonField.type, "fieldType");
// Rename 'items' to avoid conflict with built-in 'items' method.
@@clientName(ContentFieldDefinition.items, "itemDefinition");
@@clientName(AnalyzeBinaryRequest.input, "binaryInput");
// Rename 'range' to 'inputRange' for clarity that it specifies input range.
@@clientName(AnalyzeInput.range, "inputRange");
@@clientName(AnalyzeBinaryRequest.range, "inputRange");
// Rename copy operation to copyAnalyzer for all SDKs while keeping REST URL as :copy
@@clientName(ContentUnderstandingClient.copy, "copyAnalyzer");
// .NET-specific naming: use GetAnalyzers instead of ListAnalyzers
@@clientName(ContentUnderstandingClient.listAnalyzers,
"getAnalyzers",
"csharp"
);
// Mark polling operations as internal - client generators automatically handle
// the polling pattern for long-running operations. When users call analyze(), the
// generated SDK returns a poller that internally uses these endpoints to check status
// and retrieve results, eliminating the need for manual operation ID management.
@@access(ContentUnderstandingClient.getResult, Access.internal);
@@access(ContentUnderstandingClient.getOperationStatus, Access.internal);
// Client-only docs clarifying that these properties accept raw binary bytes (not base64 strings) in Python SDK.
@@clientDoc(AnalyzeInput.data,
"Raw image bytes. Provide bytes-like object; do not base64-encode. Only one of url or data should be specified.",
DocumentationMode.replace
);