Skip to content
Open
1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ words:
- SERVICERP
- seti
- stac
- strconv
- tcgc
- tsmv
- userrp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,27 @@ client.feed(Food(name="pork", "quantity="1"))
```

```csharp
// TODO
namespace PetStore
{
public partial class Food
{
public Food(string name, int quantity);
public string Name { get; }
public int Quantity { get; }
}

public partial class PetStoreClient
{
public PetStoreClient(Uri endpoint);
public PetStoreClient(Uri endpoint, PetStoreClientOptions options);
// protocol method
public virtual Response Feed(RequestContent content, RequestContext context = null);
public virtual Task<Response> FeedAsync(RequestContent content, RequestContext context = null);
// convenience method
public virtual Response Feed(Food food, CancellationToken cancellationToken = default);
public virtual Task<Response> FeedAsync(Food food, CancellationToken cancellationToken = default);
}
}
```

```typescript
Expand Down Expand Up @@ -189,7 +209,26 @@ namespace Customization;
```

```csharp
// TODO
// Food is generated in the PetStore.Models namespace.
namespace PetStore.Models
{
public partial class Food
{
public Food(string name, int quantity);
public string Name { get; }
public int Quantity { get; }
}
}

namespace PetStore
{
public partial class PetStoreClient
{
public PetStoreClient(Uri endpoint);
public virtual Response Feed(Food food, CancellationToken cancellationToken = default);
public virtual Task<Response> FeedAsync(Food food, CancellationToken cancellationToken = default);
}
}
```

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,25 @@ client2.pet()
```

```csharp
// TODO
namespace NewPetStore.Food
{
public partial class FoodClient
{
public FoodClient(Uri endpoint);
public virtual Response Feed(CancellationToken cancellationToken = default);
public virtual Task<Response> FeedAsync(CancellationToken cancellationToken = default);
}
}

namespace NewPetStore.PetAction
{
public partial class PetActionClient
{
public PetActionClient(Uri endpoint);
public virtual Response Pet(CancellationToken cancellationToken = default);
public virtual Task<Response> PetAsync(CancellationToken cancellationToken = default);
}
}
```

```typescript
Expand Down Expand Up @@ -1948,7 +1966,9 @@ With `@clientInitialization`, you can change the initialization way, by passing
@service
namespace Storage;

op download(@path blobName: string): void;
namespace Blob {
op download(@path blobName: string): void;
}
```

```typespec title="client.tsp"
Expand All @@ -1959,12 +1979,8 @@ using Azure.ClientGenerator.Core;

namespace Customizations;

model StorageClientOptions {
blobName: string;
}

@@clientInitialization(
Storage,
Storage.Blob,
{
initializedBy: InitializedBy.individually | InitializedBy.parent,
}
Expand All @@ -1980,19 +1996,25 @@ NOT_SUPPORTED
```

```typescript
export class StorageClient {
download(
blobName: string,
options: DownloadOptionalParams = { requestOptions: {} },
): Promise<void>;
}

const client = new StorageClient();
client.download("blobName");
// TODO
```

```java
Comment thread
weidongxu-microsoft marked this conversation as resolved.
// TODO
// Java requires `enable-subclient: true` option in "tspconfig.yaml"
Comment thread
tadelesh marked this conversation as resolved.

public final class StorageClientBuilder {
public StorageClient buildClient();
}

// via ClientBuilder
public final class BlobBuilder {
Comment thread
tadelesh marked this conversation as resolved.
public BlobClient buildClient();
}

// via parent Client
public final class StorageClient {
public BlobClient getBlobClient()
}
```

```go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,14 @@ public final class PetStoreNamespaceClient {
```

```go
// NOT_SUPPORTED
// Go generates the model and method as `outputModel` / `getModel` (unexported),
// so they are not part of the package's public API.
type outputModel struct {
// READ-ONLY
Name *string
}

func (client *PetStoreNamespaceClient) getModel(ctx context.Context, apiVersion string, name string, options *petStoreNamespaceClientgetModelOptions) (petStoreNamespaceClientgetModelResponse, error)
```

</ClientTabs>
Expand Down Expand Up @@ -340,7 +347,9 @@ public final class ImageGenerations {
```

```go
// NOT_SUPPORTED
// Go does not generate different code based on usage.
// However, the model may not be generated if it's never used.
// In that case, set a usage for the model.
```

</ClientTabs>
Expand Down Expand Up @@ -1606,7 +1615,24 @@ def get(self, *, etag: Optional[str] = None, match_condition: Optional[MatchCond
```

```csharp
# TODO
namespace TestService
{
public partial class Response
{
public string Name { get; }
}

public partial class TestServiceClient
{
public TestServiceClient(Uri endpoint);
// protocol method
public virtual Response Get(MatchConditions matchConditions, RequestContext context);
public virtual Task<Response> GetAsync(MatchConditions matchConditions, RequestContext context);
// convenience method
public virtual Response<Response> Get(MatchConditions matchConditions = default, CancellationToken cancellationToken = default);
public virtual Task<Response<Response>> GetAsync(MatchConditions matchConditions = default, CancellationToken cancellationToken = default);
}
}
```

```typescript
Expand Down Expand Up @@ -1747,7 +1773,12 @@ public final class ContosoProviderHubClient {
```

```go
// NOT_SUPPORTED
// subscriptionID is moved from the client to the operation level.
type ContosoProviderHubClient struct { ... }

func (c *ClientFactory) NewContosoProviderHubClient() *ContosoProviderHubClient

func (client *ContosoProviderHubClient) Get(ctx context.Context, subscriptionID string, extendedZoneName string, options *ContosoProviderHubClientGetOptions) (ContosoProviderHubClientGetResponse, error)
```

</ClientTabs>
Expand Down Expand Up @@ -1835,7 +1866,8 @@ public void getSecrets(int maxResults);
<ClientTabItem lang="go">

```go
// NOT_SUPPORTED
// maxResults is now required, exposed as a positional parameter.
func (client *MyServiceClient) GetSecrets(ctx context.Context, maxResults int32, options *MyServiceClientGetSecretsOptions) (MyServiceClientGetSecretsResponse, error)
```

</ClientTabItem>
Expand Down Expand Up @@ -1927,7 +1959,8 @@ public void getSecrets(int maxResults);
<ClientTabItem lang="go">

```go
// NOT_SUPPORTED
// maxResults is now required, exposed as a positional parameter.
func (client *MyServiceClient) GetSecrets(ctx context.Context, maxResults int32, options *MyServiceClientGetSecretsOptions) (MyServiceClientGetSecretsResponse, error)
```

</ClientTabItem>
Expand Down Expand Up @@ -2003,7 +2036,8 @@ public void getSecrets();
<ClientTabItem lang="go">

```go
// NOT_SUPPORTED
// maxResults parameter is removed.
func (client *MyServiceClient) GetSecrets(ctx context.Context, options *MyServiceClientGetSecretsOptions) (MyServiceClientGetSecretsResponse, error)
```

</ClientTabItem>
Expand Down Expand Up @@ -2142,7 +2176,8 @@ public void myOp(boolean c, String a, int b);
<ClientTabItem lang="go">

```go
// NOT_SUPPORTED
// Parameters are now in the order: c, a, b.
func (client *MyServiceClient) MyOp(ctx context.Context, c bool, a string, b int32, options *MyServiceClientMyOpOptions) (MyServiceClientMyOpResponse, error)
```

</ClientTabItem>
Expand Down Expand Up @@ -2270,7 +2305,8 @@ export async function exists(
```

```java
// NOT_SUPPORTED
public boolean exists(String name);
public Response<Boolean> existsWithResponse(String name, RequestOptions requestOptions);
```

```go
Expand Down
Loading