1+ // Copyright (c) Microsoft Corporation. All rights reserved.
2+ // Licensed under the MIT License. See License.txt in the project root for
3+ // license information.
4+
5+ using Microsoft . Azure . Management . PowerBIDedicated . Models ;
6+ using Microsoft . Rest . Azure ;
7+ using System . Collections . Generic ;
8+ using System . Threading ;
9+ using System . Threading . Tasks ;
10+
11+ namespace Microsoft . Azure . Management . PowerBIDedicated
12+ {
13+ /// <summary>
14+ /// Customize UpdateWithHttpMessagesAsync to skip LRO when response is OK. -- migration engineer
15+ /// </summary>
16+ public class CustomCapacitiesOperations : ICapacitiesOperations
17+ {
18+ private readonly ICapacitiesOperations innerCapacityOperations ;
19+ private readonly PowerBIDedicatedManagementClient client ;
20+
21+ internal CustomCapacitiesOperations ( ICapacitiesOperations inner , PowerBIDedicatedManagementClient client )
22+ {
23+ this . innerCapacityOperations = inner ;
24+ this . client = client ;
25+ }
26+
27+ public PowerBIDedicatedManagementClient Client => client ;
28+
29+ /// <inheritdoc/>
30+ public async Task < AzureOperationResponse < DedicatedCapacity > > GetDetailsWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
31+ {
32+ return await innerCapacityOperations
33+ . GetDetailsWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
34+ . ConfigureAwait ( false ) ;
35+ }
36+
37+ /// <inheritdoc/>
38+ public async Task < AzureOperationResponse < DedicatedCapacity > > CreateWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , DedicatedCapacity capacityParameters , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
39+ {
40+ return await innerCapacityOperations
41+ . CreateWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , capacityParameters , customHeaders , cancellationToken )
42+ . ConfigureAwait ( false ) ;
43+ }
44+
45+ /// <inheritdoc/>
46+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > DeleteWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
47+ {
48+ return await innerCapacityOperations
49+ . DeleteWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
50+ . ConfigureAwait ( false ) ;
51+ }
52+
53+ /// <inheritdoc/>
54+ /// Customize response return 200 skip LRO operation. -- migration engineer
55+ public async Task < AzureOperationResponse < DedicatedCapacity > > UpdateWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , DedicatedCapacityUpdateParameters capacityUpdateParameters , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
56+ {
57+ AzureOperationResponse < DedicatedCapacity > _response = await BeginUpdateWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , capacityUpdateParameters , customHeaders , cancellationToken ) . ConfigureAwait ( false ) ;
58+ if ( _response . Response . StatusCode != System . Net . HttpStatusCode . OK )
59+ return await Client . GetPutOrPatchOperationResultAsync ( _response , customHeaders , cancellationToken ) . ConfigureAwait ( false ) ;
60+ return _response ;
61+ }
62+
63+ /// <inheritdoc/>
64+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > SuspendWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
65+ {
66+ return await innerCapacityOperations
67+ . SuspendWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
68+ . ConfigureAwait ( false ) ;
69+ }
70+
71+ /// <inheritdoc/>
72+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > ResumeWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
73+ {
74+ return await innerCapacityOperations
75+ . ResumeWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
76+ . ConfigureAwait ( false ) ;
77+ }
78+
79+ /// <inheritdoc/>
80+ public async Task < AzureOperationResponse < IEnumerable < DedicatedCapacity > > > ListByResourceGroupWithHttpMessagesAsync ( string resourceGroupName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
81+ {
82+ return await innerCapacityOperations
83+ . ListByResourceGroupWithHttpMessagesAsync ( resourceGroupName , customHeaders , cancellationToken )
84+ . ConfigureAwait ( false ) ;
85+ }
86+
87+ /// <inheritdoc/>
88+ public async Task < AzureOperationResponse < IEnumerable < DedicatedCapacity > > > ListWithHttpMessagesAsync ( Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
89+ {
90+ return await innerCapacityOperations
91+ . ListWithHttpMessagesAsync ( customHeaders , cancellationToken )
92+ . ConfigureAwait ( false ) ;
93+ }
94+
95+ /// <inheritdoc/>
96+ public async Task < AzureOperationResponse < SkuEnumerationForNewResourceResult > > ListSkusWithHttpMessagesAsync ( Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
97+ {
98+ return await innerCapacityOperations
99+ . ListSkusWithHttpMessagesAsync ( customHeaders , cancellationToken )
100+ . ConfigureAwait ( false ) ;
101+ }
102+
103+ /// <inheritdoc/>
104+ public async Task < AzureOperationResponse < SkuEnumerationForExistingResourceResult > > ListSkusForCapacityWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
105+ {
106+ return await innerCapacityOperations
107+ . ListSkusForCapacityWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
108+ . ConfigureAwait ( false ) ;
109+ }
110+
111+ /// <inheritdoc/>
112+ public async Task < AzureOperationResponse < DedicatedCapacity > > BeginCreateWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , DedicatedCapacity capacityParameters , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
113+ {
114+ return await innerCapacityOperations
115+ . BeginCreateWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , capacityParameters , customHeaders , cancellationToken )
116+ . ConfigureAwait ( false ) ;
117+ }
118+
119+ /// <inheritdoc/>
120+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > BeginDeleteWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
121+ {
122+ return await innerCapacityOperations
123+ . BeginDeleteWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
124+ . ConfigureAwait ( false ) ;
125+ }
126+
127+ /// <inheritdoc/>
128+ public async Task < AzureOperationResponse < DedicatedCapacity > > BeginUpdateWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , DedicatedCapacityUpdateParameters capacityUpdateParameters , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
129+ {
130+ return await innerCapacityOperations
131+ . BeginUpdateWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , capacityUpdateParameters , customHeaders , cancellationToken )
132+ . ConfigureAwait ( false ) ;
133+ }
134+
135+ /// <inheritdoc/>
136+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > BeginSuspendWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
137+ {
138+ return await innerCapacityOperations
139+ . BeginSuspendWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
140+ . ConfigureAwait ( false ) ;
141+ }
142+
143+ /// <inheritdoc/>
144+ public async Task < Microsoft . Rest . Azure . AzureOperationResponse > BeginResumeWithHttpMessagesAsync ( string resourceGroupName , string dedicatedCapacityName , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
145+ {
146+ return await innerCapacityOperations
147+ . BeginResumeWithHttpMessagesAsync ( resourceGroupName , dedicatedCapacityName , customHeaders , cancellationToken )
148+ . ConfigureAwait ( false ) ;
149+ }
150+ }
151+ }
0 commit comments