Skip to content

Commit

Permalink
Devcenter dataplane TypeSpec preview SDK v2023-04-01 (#39358)
Browse files Browse the repository at this point in the history
* add tsp location and remove autorest

* SDK generation from TypeSpec

* Update tests and samples reflected by client changes

* Generate snippets

* Generate API updates

* Add breaking changes to CHANGELOG

* Update parameter to delayUntil
  • Loading branch information
drielenr authored Oct 25, 2023
1 parent 1d4fd54 commit a83d185
Show file tree
Hide file tree
Showing 24 changed files with 958 additions and 916 deletions.
5 changes: 5 additions & 0 deletions sdk/devcenter/Azure.Developer.DevCenter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ This release updates the Azure DevCenter library to use the 2023-04-01 GA API.
- `DeploymentEnvironmentsClient` now works with "environment definitions" instead of "catalog items"
- Creating a new environment requires passing `environmentDefinitionName` instead of `catalogItemName`
- Creating a new environment requires passing an additional parameter `catalogName`
- `DevCenterClientOptions` renamed to `AzureDeveloperDevCenterClientOptions`
- No more default parameters in the clients. `userId`, `filter`, `maxCount`, `hibernate` and `context` parameters need to be specified in the methods.
- `GetAction` renamed to `GetDevBoxAction`
- `GetActions` renamed to `GetDevBoxActions`


## 1.0.0-beta.2 (2023-02-07)
This release updates the Azure DevCenter library to use the 2022-11-11-preview API.
Expand Down
11 changes: 6 additions & 5 deletions sdk/devcenter/Azure.Developer.DevCenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You can familiarize yourself with different APIs using [Samples](https://github.

```C# Snippet:Azure_DevCenter_GetProjects_Scenario
string targetProjectName = null;
await foreach (BinaryData data in devCenterClient.GetProjectsAsync())
await foreach (BinaryData data in devCenterClient.GetProjectsAsync(null, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
targetProjectName = result.GetProperty("name").ToString();
Expand All @@ -90,7 +90,7 @@ Interaction with DevBox pools is facilitated through the `DevBoxesClient`. Pools

```C# Snippet:Azure_DevCenter_GetPools_Scenario
string targetPoolName = null;
await foreach (BinaryData data in devBoxesClient.GetPoolsAsync(targetProjectName))
await foreach (BinaryData data in devBoxesClient.GetPoolsAsync(targetProjectName, null, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
targetPoolName = result.GetProperty("name").ToString();
Expand Down Expand Up @@ -127,7 +127,8 @@ Once a DevBox is provisioned, you can connect to it using an RDP connection stri
Response remoteConnectionResponse = await devBoxesClient.GetRemoteConnectionAsync(
targetProjectName,
"me",
"MyDevBox");
"MyDevBox",
null);
JsonElement remoteConnectionData = JsonDocument.Parse(remoteConnectionResponse.ContentStream).RootElement;
Console.WriteLine($"Connect using web URL {remoteConnectionData.GetProperty("webUrl")}.");
```
Expand All @@ -153,7 +154,7 @@ Console.WriteLine($"Completed dev box deletion.");
```C# Snippet:Azure_DevCenter_GetCatalogs_Scenario
string catalogName = null;

await foreach (BinaryData data in environmentsClient.GetCatalogsAsync(projectName))
await foreach (BinaryData data in environmentsClient.GetCatalogsAsync(projectName, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
catalogName = result.GetProperty("name").ToString();
Expand All @@ -179,7 +180,7 @@ Issue a request to get all environment types in a project.

```C# Snippet:Azure_DevCenter_GetEnvironmentTypes_Scenario
string environmentTypeName = null;
await foreach (BinaryData data in environmentsClient.GetEnvironmentTypesAsync(projectName))
await foreach (BinaryData data in environmentsClient.GetEnvironmentTypesAsync(projectName, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
environmentTypeName = result.GetProperty("name").ToString();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Create a `DevCenterClient` and issue a request to get all projects the signed-in

```C# Snippet:Azure_DevCenter_GetProjects_Scenario
string targetProjectName = null;
await foreach (BinaryData data in devCenterClient.GetProjectsAsync())
await foreach (BinaryData data in devCenterClient.GetProjectsAsync(null, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
targetProjectName = result.GetProperty("name").ToString();
Expand All @@ -21,7 +21,7 @@ Create a `DevBoxesClient` and issue a request to get all pools in a project.

```C# Snippet:Azure_DevCenter_GetPools_Scenario
string targetPoolName = null;
await foreach (BinaryData data in devBoxesClient.GetPoolsAsync(targetProjectName))
await foreach (BinaryData data in devBoxesClient.GetPoolsAsync(targetProjectName, null, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
targetPoolName = result.GetProperty("name").ToString();
Expand Down Expand Up @@ -58,7 +58,8 @@ Once your dev box is created, issue a request to get URLs for connecting to it v
Response remoteConnectionResponse = await devBoxesClient.GetRemoteConnectionAsync(
targetProjectName,
"me",
"MyDevBox");
"MyDevBox",
null);
JsonElement remoteConnectionData = JsonDocument.Parse(remoteConnectionResponse.ContentStream).RootElement;
Console.WriteLine($"Connect using web URL {remoteConnectionData.GetProperty("webUrl")}.");
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Create a `DevCenterClient` and issue a request to get all projects the signed-in

```C# Snippet:Azure_DevCenter_GetProjects_Scenario
string targetProjectName = null;
await foreach (BinaryData data in devCenterClient.GetProjectsAsync())
await foreach (BinaryData data in devCenterClient.GetProjectsAsync(null, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
targetProjectName = result.GetProperty("name").ToString();
Expand All @@ -22,7 +22,7 @@ Create an `EnvironmentsClient` and issue a request to get all catalogs in a proj
```C# Snippet:Azure_DevCenter_GetCatalogs_Scenario
string catalogName = null;

await foreach (BinaryData data in environmentsClient.GetCatalogsAsync(projectName))
await foreach (BinaryData data in environmentsClient.GetCatalogsAsync(projectName, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
catalogName = result.GetProperty("name").ToString();
Expand All @@ -46,7 +46,7 @@ Issue a request to get all environment types in a project.

```C# Snippet:Azure_DevCenter_GetEnvironmentTypes_Scenario
string environmentTypeName = null;
await foreach (BinaryData data in environmentsClient.GetEnvironmentTypesAsync(projectName))
await foreach (BinaryData data in environmentsClient.GetEnvironmentTypesAsync(projectName, null, null))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
environmentTypeName = result.GetProperty("name").ToString();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a83d185

Please sign in to comment.