Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding arm extended location and re-organize common type definitions #736

Merged
merged 8 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/main-2024-3-24-14-31-54.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@azure-tools/typespec-azure-resource-manager"
---

Adding standard ExtendedLocation definition for ARM library
2 changes: 1 addition & 1 deletion core
Submodule core updated 49 files
+6 −0 .chronus/changes/azhang_fixTestUtil-2024-3-24-13-29-34.md
+16 −3 eng/emitters/pipelines/templates/jobs/test-job.yml
+25 −4 eng/emitters/pipelines/templates/stages/emitter-stages.yml
+4 −3 eng/emitters/pipelines/templates/steps/test-step.yml
+1 −1 packages/compiler/src/testing/test-utils.ts
+3 −0 packages/http-client-csharp/eng/pipeline/templates/ci-stages.yml
+22 −0 packages/http-client-csharp/eng/scripts/Check-GitChanges.ps1
+16 −0 packages/http-client-csharp/eng/scripts/Test-Packages.ps1
+92 −0 ...osoft.Generator.CSharp.ClientModel.TestProjects/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs
+0 −15 ...client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelCodeWriterExtensionMethods.cs
+6 −9 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ClientModelPlugin.cs
+4 −4 ...ator/Microsoft.Generator.CSharp.ClientModel/src/Expressions/SystemExtensibleSnippets.SystemModelSnippets.cs
+0 −39 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Output/ScmOutputLibrary.cs
+34 −65 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ScmTypeFactory.cs
+7 −0 ...tp-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Utilities/FormattableStringHelpers.cs
+79 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Utilities/StringExtensions.cs
+0 −15 ...ient-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Writers/ScmExpressionTypeProviderWriter.cs
+6 −6 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputClient.cs
+19 −19 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputOperation.cs
+66 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/OperationKinds.cs
+21 −0 ...client-csharp/generator/Microsoft.Generator.CSharp.Input/test/Microsoft.Generator.CSharp.Input.Tests.csproj
+30 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/test/OperationKindsTests.cs
+6 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.sln
+9 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CSharpGen.cs
+1 −1 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs
+2 −2 ...http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/ExtensibleSnippets.ModelSnippets.cs
+33 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethod.cs
+91 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/CSharpMethodCollection.cs
+0 −45 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Method.cs
+26 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Parameter.cs
+67 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/CSharpMethodKinds.cs
+39 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ClientTypeProvider.cs
+1 −1 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/EnumType.cs
+2 −2 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/ModelTypeProvider.cs
+44 −4 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/OutputLibrary.cs
+6 −6 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Models/Types/TypeProvider.cs
+14 −8 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/TypeFactory.cs
+4 −4 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs
+3 −12 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriterExtensionMethods.cs
+1 −1 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CSharpGenTests.cs
+90 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CSharpMethodCollectionTests.cs
+29 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CSharpMethodKindsTests.cs
+16 −34 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/CodeWriterExtensionTests.cs
+0 −7 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Directory.Build.props
+51 −0 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/OutputLibraryTests.cs
+17 −125 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/TypeFactoryTests.cs
+42 −0 ...s/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/ExpressionTypeProviderWriterTests.cs
+1 −1 ...p-client-csharp/generator/Microsoft.Generator.CSharp/test/mocks/Writers/CustomCodeWriterExtensionMethods.cs
+1 −4 packages/http-client-csharp/generator/Packages.Data.props
46 changes: 46 additions & 0 deletions docs/libraries/azure-resource-manager/reference/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,29 @@ model Azure.ResourceManager.ErrorResponse
| ------ | ------------------------------------------------------------------------------ | ----------------- |
| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | The error object. |

### `ExtendedLocationProperty` {#Azure.ResourceManager.ExtendedLocationProperty}

The standard evenlop definition of ExtendedLocation.

```typespec
model Azure.ResourceManager.ExtendedLocationProperty
```

#### Examples

```typespec
model Employee is TrackedResource<EmployeeProperties> {
...ResourceNameParameter<Employee>;
...ExtendedLocationProperty;
}
```

#### Properties

| Name | Type | Description |
| ---------------- | ---------------------------------------------------------------------------------------- | ----------- |
| extendedLocation | [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocation) | |

### `ExtensionResource` {#Azure.ResourceManager.ExtensionResource}

Concrete extension resource types can be created by aliasing this type using a specific property type.
Expand Down Expand Up @@ -1305,6 +1328,21 @@ model Azure.ResourceManager.Foundations.ErrorDetail
| details? | `ResourceManager.Foundations.ErrorDetail[]` | The error details. |
| additionalInfo? | `ResourceManager.Foundations.ErrorAdditionalInfo[]` | The error additional info. |

### `ExtendedLocation` {#Azure.ResourceManager.Foundations.ExtendedLocation}

The complex type of the extended location.

```typespec
model Azure.ResourceManager.Foundations.ExtendedLocation
```

#### Properties

| Name | Type | Description |
| ---- | ------------------------------------------------------------------------------------------------ | ---------------------------------- |
| name | `string` | The name of the extended location. |
| type | [`ExtendedLocationType`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocationType) | The type of the extended location. |

### `ExtensionBaseParameters` {#Azure.ResourceManager.Foundations.ExtensionBaseParameters}

The static parameters for an extension resource
Expand Down Expand Up @@ -1844,6 +1882,14 @@ The kind of entity that created the resource.
union Azure.ResourceManager.Foundations.createdByType
```

### `ExtendedLocationType` {#Azure.ResourceManager.Foundations.ExtendedLocationType}

The supported ExtendedLocation types.

```typespec
union Azure.ResourceManager.Foundations.ExtendedLocationType
```

### `ManagedServiceIdentityType` {#Azure.ResourceManager.Foundations.ManagedServiceIdentityType}

The kind of managed identity assigned to this resource.
Expand Down
2 changes: 2 additions & 0 deletions docs/libraries/azure-resource-manager/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`EncryptionConfiguration`](./data-types.md#Azure.ResourceManager.EncryptionConfiguration)
- [`EntityTag`](./data-types.md#Azure.ResourceManager.EntityTag)
- [`ErrorResponse`](./data-types.md#Azure.ResourceManager.ErrorResponse)
- [`ExtendedLocationProperty`](./data-types.md#Azure.ResourceManager.ExtendedLocationProperty)
- [`ExtensionResource`](./data-types.md#Azure.ResourceManager.ExtensionResource)
- [`KeysOf`](./data-types.md#Azure.ResourceManager.KeysOf)
- [`LocationParameter`](./data-types.md#Azure.ResourceManager.LocationParameter)
Expand Down Expand Up @@ -197,6 +198,7 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`DefaultBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.DefaultBaseParameters)
- [`ErrorAdditionalInfo`](./data-types.md#Azure.ResourceManager.Foundations.ErrorAdditionalInfo)
- [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail)
- [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocation)
- [`ExtensionBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionBaseParameters)
- [`ExtensionResourceBase`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionResourceBase)
- [`ExtensionScope`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionScope)
Expand Down
Loading
Loading