@@ -1246,6 +1246,105 @@ public virtual async Task<TPage> ListImageDetailsAsync<TPage>(Url url, Cancellat
12461246
12471247 #endregion
12481248
1249+ #region Server Groups
1250+
1251+ /// <summary />
1252+ public virtual async Task < T > GetServerGroupAsync < T > ( string serverGroupId , CancellationToken cancellationToken = default ( CancellationToken ) )
1253+ where T : IServiceResource
1254+ {
1255+ var result = await BuildGetServerGroupsAsync ( serverGroupId , cancellationToken )
1256+ . SendAsync ( )
1257+ . ReceiveJson < T > ( ) ;
1258+ result . PropogateOwner ( this ) ;
1259+ return result ;
1260+ }
1261+
1262+ /// <summary />
1263+ public virtual async Task < PreparedRequest > BuildGetServerGroupsAsync ( string serverGroupId , CancellationToken cancellationToken = default ( CancellationToken ) )
1264+ {
1265+ if ( serverGroupId == null )
1266+ throw new ArgumentNullException ( "serverGroupId" ) ;
1267+
1268+ Url endpoint = await UrlBuilder . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
1269+
1270+ return endpoint
1271+ . AppendPathSegment ( $ "os-server-groups/{ serverGroupId } ")
1272+ . Authenticate ( AuthenticationProvider )
1273+ . SetMicroversion ( this )
1274+ . PrepareGet ( cancellationToken ) ;
1275+ }
1276+
1277+ /// <summary />
1278+ public virtual async Task < T > CreateServerGroupAsync < T > ( object serverGroup , CancellationToken cancellationToken = default ( CancellationToken ) )
1279+ where T : IServiceResource
1280+ {
1281+ var result = await BuildCreateServerGroupAsync ( serverGroup , cancellationToken ) . SendAsync ( ) . ReceiveJson < T > ( ) ;
1282+ result . PropogateOwner ( this ) ;
1283+ return result ;
1284+ }
1285+
1286+ /// <summary />
1287+ public virtual async Task < PreparedRequest > BuildCreateServerGroupAsync ( object serverGroup , CancellationToken cancellationToken = default ( CancellationToken ) )
1288+ {
1289+ if ( serverGroup == null )
1290+ throw new ArgumentNullException ( "serverGroup" ) ;
1291+
1292+ Url endpoint = await UrlBuilder . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
1293+
1294+ return endpoint
1295+ . AppendPathSegments ( "os-server-groups" )
1296+ . Authenticate ( AuthenticationProvider )
1297+ . SetMicroversion ( this )
1298+ . PreparePostJson ( serverGroup , cancellationToken ) ;
1299+ }
1300+
1301+ /// <summary />
1302+ public virtual async Task < T > ListServerGroupsAsync < T > ( CancellationToken cancellationToken = default ( CancellationToken ) )
1303+ where T : IEnumerable < IServiceResource >
1304+ {
1305+ var result = await BuildListServerGroupsAsync ( cancellationToken )
1306+ . SendAsync ( )
1307+ . ReceiveJson < T > ( ) ;
1308+ result . PropogateOwner ( this ) ;
1309+ return result ;
1310+ }
1311+
1312+ /// <summary />
1313+ public virtual async Task < PreparedRequest > BuildListServerGroupsAsync ( CancellationToken cancellationToken = default ( CancellationToken ) )
1314+ {
1315+ Url endpoint = await UrlBuilder . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
1316+
1317+ return endpoint
1318+ . AppendPathSegment ( "os-server-groups" )
1319+ . Authenticate ( AuthenticationProvider )
1320+ . SetMicroversion ( this )
1321+ . PrepareGet ( cancellationToken ) ;
1322+ }
1323+
1324+ /// <summary />
1325+ public virtual Task DeleteServerGroupAsync ( string serverGroupId , CancellationToken cancellationToken = default ( CancellationToken ) )
1326+ {
1327+ return BuildDeleteServerGroupAsync ( serverGroupId , cancellationToken ) . SendAsync ( ) ;
1328+ }
1329+
1330+ /// <summary />
1331+ public virtual async Task < PreparedRequest > BuildDeleteServerGroupAsync ( string serverGroupId , CancellationToken cancellationToken = default ( CancellationToken ) )
1332+ {
1333+ if ( serverGroupId == null )
1334+ throw new ArgumentNullException ( "serverGroupId" ) ;
1335+
1336+ Url endpoint = await UrlBuilder . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
1337+
1338+ return ( PreparedRequest ) endpoint
1339+ . AppendPathSegment ( $ "os-server-groups/{ serverGroupId } ")
1340+ . Authenticate ( AuthenticationProvider )
1341+ . SetMicroversion ( this )
1342+ . PrepareDelete ( cancellationToken )
1343+ . AllowHttpStatus ( HttpStatusCode . NotFound ) ;
1344+ }
1345+
1346+ #endregion
1347+
12491348 #region Compute Service
12501349 /// <summary />
12511350 public virtual Task < T > GetLimitsAsync < T > ( CancellationToken cancellationToken = default ( CancellationToken ) )
0 commit comments