Skip to content

Commit

Permalink
Backmerge/release/january 2025 2025 01 31 (#2160)
Browse files Browse the repository at this point in the history
Co-authored-by: Chenjie Shi <[email protected]>
Co-authored-by: Weidong Xu <[email protected]>
Co-authored-by: iscai-msft <[email protected]>
  • Loading branch information
4 people authored Jan 31, 2025
1 parent 32e0295 commit dea1bf0
Show file tree
Hide file tree
Showing 18 changed files with 2,281 additions and 691 deletions.
11 changes: 11 additions & 0 deletions packages/typespec-client-generator-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log - @azure-tools/typespec-client-generator-core

## 0.50.3

### Bug Fixes

- [#2027](https://github.com/Azure/typespec-azure/pull/2027) Change `@clientInitialization` decorator's `options` parameter to `ClientInitializationOptions` type. The options now could set how to initialize the client. Though the implementation could support backward compatibility, it's better to have all specs that use this decorator change from `@clientInitialization(CustomizedOption)` to `@clientInitialization({parameters: CustomizedOption})`. A new helper `getClientInitializationOptions` is added for getting the new `ClientInitializationOptions` info from the `@clientInitialization` decorator.
- [#2027](https://github.com/Azure/typespec-azure/pull/2027) Add new `children` property to `SdkClientType` to include all the sub client belong to that client.
- [#2027](https://github.com/Azure/typespec-azure/pull/2027) Add `clientInitialization` property to `SdkClientType`. Its type is `SdkClientInitializationType` which includes the initialization parameters and how to initialize the client.
- [#2027](https://github.com/Azure/typespec-azure/pull/2027) Deprecate `initialization` property of `SdkClientType`. Use `init.paramters` of `SdkClientType` instead.
- [#2027](https://github.com/Azure/typespec-azure/pull/2027) Deprecate `SdkClientAccessor` type. Use `parent` and `children` property from `SdkClientType` to find client hierarchy instead.


## 0.50.2

### Bug Fixes
Expand Down
18 changes: 9 additions & 9 deletions packages/typespec-client-generator-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ interface MyInterface {}

#### `@clientInitialization`

Client parameters you would like to add to the client. By default, we apply endpoint, credential, and api-version parameters. If you add clientInitialization, we will append those to the default list of parameters.
Customize the client initialization way.

```typespec
@Azure.ClientGenerator.Core.clientInitialization(options: Model, scope?: valueof string)
@Azure.ClientGenerator.Core.clientInitialization(options: Azure.ClientGenerator.Core.ClientInitializationOptions, scope?: valueof string)
```

##### Target
Expand All @@ -366,10 +366,10 @@ Client parameters you would like to add to the client. By default, we apply endp

##### Parameters

| Name | Type | Description |
| ------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| options | `Model` | |
| scope | `valueof string` | The language scope you want this decorator to apply to. If not specified, will apply to all language emitters.<br />You can use "!" to specify negation such as "!(java, python)" or "!java, !python". |
| Name | Type | Description |
| ------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| options | [`ClientInitializationOptions`](#clientinitializationoptions) | |
| scope | `valueof string` | The language scope you want this decorator to apply to. If not specified, will apply to all language emitters.<br />You can use "!" to specify negation such as "!(java, python)" or "!java, !python". |

##### Examples

Expand All @@ -386,9 +386,9 @@ model MyServiceClientOptions {
blobName: string;
}
@@clientInitialization(MyService, MyServiceClientOptions)
// The generated client will have `blobName` on it. We will also
// elevate the existing `blobName` parameter to the client level.
@@clientInitialization(MyService, {parameters: MyServiceClientOptions})
// The generated client will have `blobName` on its initialization method. We will also
// elevate the existing `blobName` parameter from method level to client level.
```

#### `@clientName`
Expand Down
Loading

0 comments on commit dea1bf0

Please sign in to comment.