@@ -11,7 +11,7 @@ namespace Azure.AI.DocumentIntelligence
1111 public partial class DocumentIntelligenceAdministrationClient
1212 {
1313 // CUSTOM CODE NOTE: we're overwriting the behavior of the BuildDocumentModel, ComposeModel,
14- // CopyModelTo, BuildClassifier, and CopyClassifierTo APIs to return an instance of TrainingOperation .
14+ // CopyModelTo, BuildClassifier, and CopyClassifierTo APIs to return an instance of OperationWithId .
1515 // This is a workaround since Operation.Id is not supported by our generator yet (it throws a
1616 // NotSupportedException), but this ID is needed for the GetOperation API.
1717
@@ -47,7 +47,7 @@ public virtual async Task<Operation<BinaryData>> BuildDocumentModelAsync(WaitUnt
4747 {
4848 using HttpMessage message = CreateBuildDocumentModelRequest ( content , context ) ;
4949 var internalOperation = await ProtocolOperationHelpers . ProcessMessageAsync ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.BuildDocumentModel" , OperationFinalStateVia . OperationLocation , context , waitUntil ) . ConfigureAwait ( false ) ;
50- return new TrainingOperation ( internalOperation ) ;
50+ return new OperationWithId ( internalOperation ) ;
5151 }
5252 catch ( Exception e )
5353 {
@@ -88,7 +88,7 @@ public virtual Operation<BinaryData> BuildDocumentModel(WaitUntil waitUntil, Req
8888 {
8989 using HttpMessage message = CreateBuildDocumentModelRequest ( content , context ) ;
9090 var internalOperation = ProtocolOperationHelpers . ProcessMessage ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.BuildDocumentModel" , OperationFinalStateVia . OperationLocation , context , waitUntil ) ;
91- return new TrainingOperation ( internalOperation ) ;
91+ return new OperationWithId ( internalOperation ) ;
9292 }
9393 catch ( Exception e )
9494 {
@@ -129,7 +129,7 @@ public virtual async Task<Operation<BinaryData>> ComposeModelAsync(WaitUntil wai
129129 {
130130 using HttpMessage message = CreateComposeModelRequest ( content , context ) ;
131131 var internalOperation = await ProtocolOperationHelpers . ProcessMessageAsync ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.ComposeModel" , OperationFinalStateVia . OperationLocation , context , waitUntil ) . ConfigureAwait ( false ) ;
132- return new TrainingOperation ( internalOperation ) ;
132+ return new OperationWithId ( internalOperation ) ;
133133 }
134134 catch ( Exception e )
135135 {
@@ -170,7 +170,7 @@ public virtual Operation<BinaryData> ComposeModel(WaitUntil waitUntil, RequestCo
170170 {
171171 using HttpMessage message = CreateComposeModelRequest ( content , context ) ;
172172 var internalOperation = ProtocolOperationHelpers . ProcessMessage ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.ComposeModel" , OperationFinalStateVia . OperationLocation , context , waitUntil ) ;
173- return new TrainingOperation ( internalOperation ) ;
173+ return new OperationWithId ( internalOperation ) ;
174174 }
175175 catch ( Exception e )
176176 {
@@ -214,7 +214,7 @@ public virtual async Task<Operation<BinaryData>> CopyModelToAsync(WaitUntil wait
214214 {
215215 using HttpMessage message = CreateCopyModelToRequest ( modelId , content , context ) ;
216216 var internalOperation = await ProtocolOperationHelpers . ProcessMessageAsync ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.CopyModelTo" , OperationFinalStateVia . OperationLocation , context , waitUntil ) . ConfigureAwait ( false ) ;
217- return new TrainingOperation ( internalOperation ) ;
217+ return new OperationWithId ( internalOperation ) ;
218218 }
219219 catch ( Exception e )
220220 {
@@ -258,7 +258,7 @@ public virtual Operation<BinaryData> CopyModelTo(WaitUntil waitUntil, string mod
258258 {
259259 using HttpMessage message = CreateCopyModelToRequest ( modelId , content , context ) ;
260260 var internalOperation = ProtocolOperationHelpers . ProcessMessage ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.CopyModelTo" , OperationFinalStateVia . OperationLocation , context , waitUntil ) ;
261- return new TrainingOperation ( internalOperation ) ;
261+ return new OperationWithId ( internalOperation ) ;
262262 }
263263 catch ( Exception e )
264264 {
@@ -299,7 +299,7 @@ public virtual async Task<Operation<BinaryData>> BuildClassifierAsync(WaitUntil
299299 {
300300 using HttpMessage message = CreateBuildClassifierRequest ( content , context ) ;
301301 var internalOperation = await ProtocolOperationHelpers . ProcessMessageAsync ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.BuildClassifier" , OperationFinalStateVia . OperationLocation , context , waitUntil ) . ConfigureAwait ( false ) ;
302- return new TrainingOperation ( internalOperation ) ;
302+ return new OperationWithId ( internalOperation ) ;
303303 }
304304 catch ( Exception e )
305305 {
@@ -340,7 +340,7 @@ public virtual Operation<BinaryData> BuildClassifier(WaitUntil waitUntil, Reques
340340 {
341341 using HttpMessage message = CreateBuildClassifierRequest ( content , context ) ;
342342 var internalOperation = ProtocolOperationHelpers . ProcessMessage ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.BuildClassifier" , OperationFinalStateVia . OperationLocation , context , waitUntil ) ;
343- return new TrainingOperation ( internalOperation ) ;
343+ return new OperationWithId ( internalOperation ) ;
344344 }
345345 catch ( Exception e )
346346 {
@@ -384,7 +384,7 @@ public virtual async Task<Operation<BinaryData>> CopyClassifierToAsync(WaitUntil
384384 {
385385 using HttpMessage message = CreateCopyClassifierToRequest ( classifierId , content , context ) ;
386386 var internalOperation = await ProtocolOperationHelpers . ProcessMessageAsync ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.CopyClassifierTo" , OperationFinalStateVia . OperationLocation , context , waitUntil ) . ConfigureAwait ( false ) ;
387- return new TrainingOperation ( internalOperation ) ;
387+ return new OperationWithId ( internalOperation ) ;
388388 }
389389 catch ( Exception e )
390390 {
@@ -428,7 +428,7 @@ public virtual Operation<BinaryData> CopyClassifierTo(WaitUntil waitUntil, strin
428428 {
429429 using HttpMessage message = CreateCopyClassifierToRequest ( classifierId , content , context ) ;
430430 var internalOperation = ProtocolOperationHelpers . ProcessMessage ( _pipeline , message , ClientDiagnostics , "DocumentIntelligenceAdministrationClient.CopyClassifierTo" , OperationFinalStateVia . OperationLocation , context , waitUntil ) ;
431- return new TrainingOperation ( internalOperation ) ;
431+ return new OperationWithId ( internalOperation ) ;
432432 }
433433 catch ( Exception e )
434434 {
0 commit comments