From be1e2c332a991ed935dcd51db40bdefc7f83d86e Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 7 May 2024 19:17:59 -0700 Subject: [PATCH] Bump versions for 042.0 (core 0.56.0) release (#794) --- .chronus/changes/604-2024-3-5-16-44-59.md | 7 - .../autorest-refactor-2024-3-30-11-31-47.md | 6 - .../autorest-refactor-2024-3-30-18-1-0.md | 8 - .../autorest-refactor-2024-3-30-18-1-01.md | 8 - .../autorest_update-2024-3-26-10-54-52.md | 7 - ...zhang_ArmNameOption1-2024-3-15-10-27-16.md | 7 - ...isioningStateToUnion-2024-2-26-12-58-44.md | 8 - .../azhang_armReorg-2024-3-29-17-13-46.md | 20 - ...g_fixManagedIdentity-2024-2-11-13-47-14.md | 7 - ...zhang_managedIdentity-2024-4-1-16-18-41.md | 64 -- ...ore-IntegerTypesRule-2024-3-10-16-52-31.md | 8 - ...rationRequestBodyRule-2024-3-29-20-4-13.md | 8 - ...-retry-after-changelog-2024-3-3-7-54-14.md | 6 - ...enableCommonTypesRule-2024-3-1-19-59-35.md | 8 - .../eslint-flat-config-2024-3-5-22-2-11.md | 11 - ...est-omit-version-enum-2024-4-3-14-49-10.md | 8 - .../fix-allow-scalars-2024-3-26-23-13-19.md | 8 - ...ot-including-examples-2024-4-3-10-29-15.md | 6 - .../fix-codefix-pattern-2024-3-19-16-11-27.md | 8 - ...fix-missing-body-root-2024-3-19-13-3-12.md | 6 - ...-crash-unreferencable-2024-3-18-16-38-1.md | 8 - ...x_default_api_version-2024-4-7-14-54-37.md | 7 - .chronus/changes/main-2024-3-24-14-31-54.md | 7 - ...rganize-azure-core-tsp-2024-4-3-15-6-37.md | 8 - ...addEnumDocExceptions-2024-3-19-22-29-42.md | 8 - .../tsp-unionDocs-2024-3-25-19-26-44.md | 8 - ...date-resolveRef-2024-2024-4-17-11-10-36.md | 8 - ...rade-deps-april-2024-2024-3-13-20-12-36.md | 11 - ...take-body-consitency-2024-3-16-19-18-52.md | 8 - ...take-body-consitency-2024-3-16-19-18-53.md | 9 - ...take-body-consitency-2024-3-16-20-19-22.md | 8 - core | 2 +- .../typespec-autorest-canonical/CHANGELOG.md | 16 + .../typespec-autorest-canonical/package.json | 2 +- packages/typespec-autorest/CHANGELOG.md | 20 + packages/typespec-autorest/package.json | 2 +- packages/typespec-azure-core/CHANGELOG.md | 20 + packages/typespec-azure-core/package.json | 2 +- .../typespec-azure-portal-core/CHANGELOG.md | 7 + .../typespec-azure-portal-core/package.json | 2 +- .../CHANGELOG.md | 99 +++ .../package.json | 2 +- .../CHANGELOG.md | 7 + .../package.json | 2 +- packages/website/playground-versions.json | 1 + .../reference/emitter.md | 6 + .../js-api/functions/sortOpenAPIDocument.md | 18 - .../reference/js-api/index.md | 4 - .../AutorestCanonicalEmitterOptions.md | 1 + ...ResolvedAutorestCanonicalEmitterOptions.md | 16 - .../reference/js-api/variables/$lib.md | 29 - .../js-api/variables/canonicalVersion.md | 8 - .../reference/js-api/variables/namespace.md | 8 - .../typespec-autorest/reference/emitter.md | 6 + .../js-api/functions/getOpenAPIForService.md | 19 + .../js-api/functions/sortOpenAPIDocument.md | 4 +- .../reference/js-api/index.md | 44 +- .../AutorestDocumentEmitterOptions.md | 17 + .../interfaces/AutorestEmitterContext.md | 14 + .../interfaces/AutorestEmitterOptions.md | 1 + .../OpenAPI2ApiKeySecurityScheme.md | 19 + ...enAPI2BasicAuthenticationSecurityScheme.md | 17 + .../interfaces/OpenAPI2BodyParameter.md | 23 + .../js-api/interfaces/OpenAPI2Document.md | 28 + .../js-api/interfaces/OpenAPI2Example.md | 14 + .../js-api/interfaces/OpenAPI2ExternalDocs.md | 11 + .../interfaces/OpenAPI2FormDataParameter.md | 30 + .../interfaces/OpenAPI2HeaderDefinition.md | 18 + .../interfaces/OpenAPI2HeaderParameter.md | 23 + .../js-api/interfaces/OpenAPI2Info.md | 17 + .../OpenAPI2OAuth2AccessCodeSecurityScheme.md | 21 + ...OpenAPI2OAuth2ApplicationSecurityScheme.md | 20 + .../OpenAPI2OAuth2ImplicitSecurityScheme.md | 20 + .../OpenAPI2OAuth2PasswordSecurityScheme.md | 20 + .../interfaces/OpenAPI2OAuthSecurityBase.md | 23 + .../interfaces/OpenAPI2ParameterBase.md | 15 + .../interfaces/OpenAPI2PathParameter.md | 25 + .../interfaces/OpenAPI2QueryParameter.md | 24 + .../js-api/interfaces/OpenAPI2Response.md | 20 + .../interfaces/OpenAPI2SecuritySchemeBase.md | 21 + .../js-api/interfaces/OpenAPI2Tag.md | 16 + .../js-api/interfaces/PrimitiveItems.md | 19 + .../reference/js-api/interfaces/Ref.md | 16 + .../ResolvedAutorestEmitterOptions.md | 19 - .../js-api/interfaces/XMSParameterizedHost.md | 12 + .../js-api/type-aliases/Extensions.md | 8 + .../js-api/type-aliases/HttpMethod.md | 16 + .../reference/js-api/type-aliases/JsonType.md | 14 + .../type-aliases/OpenAPI2OAuth2FlowType.md | 8 + .../js-api/type-aliases/OpenAPI2Operation.md | 27 + .../js-api/type-aliases/OpenAPI2Parameter.md | 13 + .../type-aliases/OpenAPI2ParameterType.md | 8 + .../js-api/type-aliases/OpenAPI2PathItem.md | 20 + .../js-api/type-aliases/OpenAPI2Responses.md | 19 + .../js-api/type-aliases/OpenAPI2Schema.md | 43 + .../type-aliases/OpenAPI2SchemaProperty.md | 8 + .../type-aliases/OpenAPI2SchemaRefProperty.md | 16 + .../OpenAPI2SecurityRequirement.md | 16 + .../type-aliases/OpenAPI2SecurityScheme.md | 20 + .../js-api/type-aliases/OpenAPI2StatusCode.md | 15 + .../reference/js-api/type-aliases/Refable.md | 14 + .../getstarted/azure-core/step04.md | 22 +- .../getstarted/createproject.md | 50 +- .../version-latest/getstarted/installation.md | 16 +- .../howtos/ARM/resource-type.md | 28 +- .../Azure Core/long-running-operations.md | 64 +- .../DataPlane Generation - DPG/06types.mdx | 772 ++++++++++++++++- .../08methodInputs.mdx | 775 ++++++++++++++++++ .../howtos/migrate-swagger/x-ms-examples.md | 4 +- .../libraries/azure-core/reference/linter.md | 1 + .../azure-core/rules/no-generic-numeric.md | 47 ++ .../reference/data-types.md | 511 +++++++----- .../reference/index.mdx | 36 +- .../reference/interfaces.md | 28 +- .../rules/put-operation-response-codes.md | 4 +- .../rules/resource-name-pattern.md | 6 +- .../js-api/functions/createDiagnostic.md | 7 +- .../js-api/functions/createSdkContext.md | 6 +- .../functions/getCrossLanguageDefinitionId.md | 7 +- .../js-api/functions/isSdkFloatKind.md | 18 + .../js-api/functions/isSdkIntKind.md | 18 + .../js-api/functions/reportDiagnostic.md | 7 +- .../reference/js-api/index.md | 2 + .../interfaces/SdkBasicServiceMethod.md | 1 + .../reference/js-api/interfaces/SdkContext.md | 12 +- .../js-api/interfaces/SdkEmitterOptions.md | 1 + .../interfaces/SdkInitializationType.md | 1 + .../interfaces/SdkLroPagingServiceMethod.md | 1 + .../js-api/interfaces/SdkLroServiceMethod.md | 1 + .../js-api/interfaces/SdkModelType.md | 1 + .../reference/js-api/interfaces/SdkPackage.md | 17 +- .../interfaces/SdkPagingServiceMethod.md | 1 + .../reference/js-api/variables/$lib.md | 10 + .../release-notes/release-2024-03-05.md | 2 +- .../release-notes/release-2024-04-02.md | 2 +- .../release-notes/release-2024-05-07.md | 145 ++++ 136 files changed, 3299 insertions(+), 769 deletions(-) delete mode 100644 .chronus/changes/604-2024-3-5-16-44-59.md delete mode 100644 .chronus/changes/autorest-refactor-2024-3-30-11-31-47.md delete mode 100644 .chronus/changes/autorest-refactor-2024-3-30-18-1-0.md delete mode 100644 .chronus/changes/autorest-refactor-2024-3-30-18-1-01.md delete mode 100644 .chronus/changes/autorest_update-2024-3-26-10-54-52.md delete mode 100644 .chronus/changes/azhang_ArmNameOption1-2024-3-15-10-27-16.md delete mode 100644 .chronus/changes/azhang_ProvisioningStateToUnion-2024-2-26-12-58-44.md delete mode 100644 .chronus/changes/azhang_armReorg-2024-3-29-17-13-46.md delete mode 100644 .chronus/changes/azhang_fixManagedIdentity-2024-2-11-13-47-14.md delete mode 100644 .chronus/changes/azhang_managedIdentity-2024-4-1-16-18-41.md delete mode 100644 .chronus/changes/core-IntegerTypesRule-2024-3-10-16-52-31.md delete mode 100644 .chronus/changes/core-fixRpcOperationRequestBodyRule-2024-3-29-20-4-13.md delete mode 100644 .chronus/changes/docs-retry-after-changelog-2024-3-3-7-54-14.md delete mode 100644 .chronus/changes/enableCommonTypesRule-2024-3-1-19-59-35.md delete mode 100644 .chronus/changes/eslint-flat-config-2024-3-5-22-2-11.md delete mode 100644 .chronus/changes/feature-autorest-omit-version-enum-2024-4-3-14-49-10.md delete mode 100644 .chronus/changes/fix-allow-scalars-2024-3-26-23-13-19.md delete mode 100644 .chronus/changes/fix-autorest-not-including-examples-2024-4-3-10-29-15.md delete mode 100644 .chronus/changes/fix-codefix-pattern-2024-3-19-16-11-27.md delete mode 100644 .chronus/changes/fix-missing-body-root-2024-3-19-13-3-12.md delete mode 100644 .chronus/changes/fix-trait-crash-unreferencable-2024-3-18-16-38-1.md delete mode 100644 .chronus/changes/fix_default_api_version-2024-4-7-14-54-37.md delete mode 100644 .chronus/changes/main-2024-3-24-14-31-54.md delete mode 100644 .chronus/changes/organize-azure-core-tsp-2024-4-3-15-6-37.md delete mode 100644 .chronus/changes/rules-addEnumDocExceptions-2024-3-19-22-29-42.md delete mode 100644 .chronus/changes/tsp-unionDocs-2024-3-25-19-26-44.md delete mode 100644 .chronus/changes/update-resolveRef-2024-2024-4-17-11-10-36.md delete mode 100644 .chronus/changes/upgrade-deps-april-2024-2024-3-13-20-12-36.md delete mode 100644 .chronus/changes/uptake-body-consitency-2024-3-16-19-18-52.md delete mode 100644 .chronus/changes/uptake-body-consitency-2024-3-16-19-18-53.md delete mode 100644 .chronus/changes/uptake-body-consitency-2024-3-16-20-19-22.md delete mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/functions/sortOpenAPIDocument.md delete mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/ResolvedAutorestCanonicalEmitterOptions.md delete mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/canonicalVersion.md delete mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/namespace.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/getOpenAPIForService.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestDocumentEmitterOptions.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterContext.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ApiKeySecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BasicAuthenticationSecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BodyParameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Document.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Example.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ExternalDocs.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2FormDataParameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderDefinition.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderParameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Info.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2AccessCodeSecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ApplicationSecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ImplicitSecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2PasswordSecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuthSecurityBase.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ParameterBase.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2PathParameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2QueryParameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Response.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2SecuritySchemeBase.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Tag.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/PrimitiveItems.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/Ref.md delete mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/ResolvedAutorestEmitterOptions.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/XMSParameterizedHost.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Extensions.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/HttpMethod.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/JsonType.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2OAuth2FlowType.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Operation.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Parameter.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2ParameterType.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2PathItem.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Responses.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Schema.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaProperty.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaRefProperty.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityRequirement.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityScheme.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2StatusCode.md create mode 100644 packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Refable.md create mode 100644 packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/08methodInputs.mdx create mode 100644 packages/website/versioned_docs/version-latest/libraries/azure-core/rules/no-generic-numeric.md create mode 100644 packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkFloatKind.md create mode 100644 packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkIntKind.md create mode 100644 packages/website/versioned_docs/version-latest/release-notes/release-2024-05-07.md diff --git a/.chronus/changes/604-2024-3-5-16-44-59.md b/.chronus/changes/604-2024-3-5-16-44-59.md deleted file mode 100644 index 98f6fac7be..0000000000 --- a/.chronus/changes/604-2024-3-5-16-44-59.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Specify the fully qualified name of `@OpenAPI.extension` decorator in `missing-x-ms-identifiers` linter warning. diff --git a/.chronus/changes/autorest-refactor-2024-3-30-11-31-47.md b/.chronus/changes/autorest-refactor-2024-3-30-11-31-47.md deleted file mode 100644 index b0d4b0d5ff..0000000000 --- a/.chronus/changes/autorest-refactor-2024-3-30-11-31-47.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - diff --git a/.chronus/changes/autorest-refactor-2024-3-30-18-1-0.md b/.chronus/changes/autorest-refactor-2024-3-30-18-1-0.md deleted file mode 100644 index 4318abf87e..0000000000 --- a/.chronus/changes/autorest-refactor-2024-3-30-18-1-0.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@azure-tools/typespec-autorest" ---- - -[API] Refactor to provide functions to get the OpenAPI programtically diff --git a/.chronus/changes/autorest-refactor-2024-3-30-18-1-01.md b/.chronus/changes/autorest-refactor-2024-3-30-18-1-01.md deleted file mode 100644 index 869e129190..0000000000 --- a/.chronus/changes/autorest-refactor-2024-3-30-18-1-01.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-autorest-canonical" ---- - -Refactor to make use ot autorest emitter logic to compute the types diff --git a/.chronus/changes/autorest_update-2024-3-26-10-54-52.md b/.chronus/changes/autorest_update-2024-3-26-10-54-52.md deleted file mode 100644 index e29ab28821..0000000000 --- a/.chronus/changes/autorest_update-2024-3-26-10-54-52.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@azure-tools/typespec-autorest" ---- - -prevent tcgc versioning projection \ No newline at end of file diff --git a/.chronus/changes/azhang_ArmNameOption1-2024-3-15-10-27-16.md b/.chronus/changes/azhang_ArmNameOption1-2024-3-15-10-27-16.md deleted file mode 100644 index abd43b06b7..0000000000 --- a/.chronus/changes/azhang_ArmNameOption1-2024-3-15-10-27-16.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Fixing ArmResource base model and add an easier way to define Resource Name parameter \ No newline at end of file diff --git a/.chronus/changes/azhang_ProvisioningStateToUnion-2024-2-26-12-58-44.md b/.chronus/changes/azhang_ProvisioningStateToUnion-2024-2-26-12-58-44.md deleted file mode 100644 index ada72db119..0000000000 --- a/.chronus/changes/azhang_ProvisioningStateToUnion-2024-2-26-12-58-44.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: breaking -packages: - - "@azure-tools/typespec-azure-core" - - "@azure-tools/typespec-azure-resource-manager" ---- - -Switching ProvisioningState from enum to Open union \ No newline at end of file diff --git a/.chronus/changes/azhang_armReorg-2024-3-29-17-13-46.md b/.chronus/changes/azhang_armReorg-2024-3-29-17-13-46.md deleted file mode 100644 index 62e4b30602..0000000000 --- a/.chronus/changes/azhang_armReorg-2024-3-29-17-13-46.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -changeKind: deprecation -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Renaming internal TypeSpec ARM foundation model names to be consistent with ARM common-type definitions. -However, these are `Azure.Resource.Manager.Foundations` models that would not normally be used directly in service specs. - -- Deprecate `Foundations.ArmResource`. `Foundations.Resource` should be used instead. - -- Deprecate `Foundations.ResourceSkuType`. `Foundations.Sku` should be used instead. - -- Deprecate `Foundations.ResourcePlanType`. `Foundations.Plan` should be used instead. - -- Deprecate `Foundations.TrackedResourceBase`. `Foundations.TrackedResource` should be used instead. - -- Deprecate `Foundations.ProxyResourceBase`. `Foundations.ProxyResource` should be used instead. - -- Deprecate `Foundations.ExtensionResourceBase`. `Foundations.ExtensionResource` should be used instead. diff --git a/.chronus/changes/azhang_fixManagedIdentity-2024-2-11-13-47-14.md b/.chronus/changes/azhang_fixManagedIdentity-2024-2-11-13-47-14.md deleted file mode 100644 index 52d52c3981..0000000000 --- a/.chronus/changes/azhang_fixManagedIdentity-2024-2-11-13-47-14.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Updated `ManagedIndentity` and `CustomerManagedKey` TypeSpec model definition to be consistent with Swagger commont-types \ No newline at end of file diff --git a/.chronus/changes/azhang_managedIdentity-2024-4-1-16-18-41.md b/.chronus/changes/azhang_managedIdentity-2024-4-1-16-18-41.md deleted file mode 100644 index 0d482d5a29..0000000000 --- a/.chronus/changes/azhang_managedIdentity-2024-4-1-16-18-41.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -changeKind: deprecation -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Standardizing mix-in model names with consistent `Property` suffix. - -- Deprecate `ManagedServiceIdentity`. `ManagedServiceIdentityProperty` should be used instead. - - Example: - ```diff - -...ManagedServiceIdentity; - +...ManagedServiceIdentityProperty; - ``` - -- Deprecate `ManagedSystemAssignedIdentity`. `ManagedSystemAssignedIdentityProperty` should be used instead. - - Example: - ```diff - -...ManagedSystemAssignedIdentity; - +...ManagedSystemAssignedIdentityProperty; - ``` - -- Deprecate `EntityTag`. `EntityTagProperty` should be used instead. - - Example: - ```diff - -...EntityTag; - +...EntityTagProperty; - ``` - -- Deprecate `ResourceKind`. `ResourceKindProperty` should be used instead. - - Example: - ```diff - -...ResourceKind; - +...ResourceKindProperty; - ``` - -- Deprecate `ResourcePlan`. `ResourcePlanProperty` should be used instead. - - Example: - ```diff - -...ResourcePlan; - +...ResourcePlanProperty; - ``` - -- Deprecate `ResourceSku`. `ResourceSkuProperty` should be used instead. - - Example: - ```diff - -...ResourceSku; - +...ResourceSkuProperty; - ``` - -- Deprecate `ManagedBy`. `ManagedByProperty` should be used instead. - - Example: - ```diff - -...ManagedBy; - +...ManagedByProperty; - ``` - diff --git a/.chronus/changes/core-IntegerTypesRule-2024-3-10-16-52-31.md b/.chronus/changes/core-IntegerTypesRule-2024-3-10-16-52-31.md deleted file mode 100644 index 6eb0c606c5..0000000000 --- a/.chronus/changes/core-IntegerTypesRule-2024-3-10-16-52-31.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" ---- - -Add `no-generic-numeric` rule to disable LintDiff `IntegerTypeMustHaveFormat` diff --git a/.chronus/changes/core-fixRpcOperationRequestBodyRule-2024-3-29-20-4-13.md b/.chronus/changes/core-fixRpcOperationRequestBodyRule-2024-3-29-20-4-13.md deleted file mode 100644 index 9ce7853596..0000000000 --- a/.chronus/changes/core-fixRpcOperationRequestBodyRule-2024-3-29-20-4-13.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" ---- - -Fix `rpc-operation-request-body` rule not actually checking for a body parameter. diff --git a/.chronus/changes/docs-retry-after-changelog-2024-3-3-7-54-14.md b/.chronus/changes/docs-retry-after-changelog-2024-3-3-7-54-14.md deleted file mode 100644 index b0d4b0d5ff..0000000000 --- a/.chronus/changes/docs-retry-after-changelog-2024-3-3-7-54-14.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - diff --git a/.chronus/changes/enableCommonTypesRule-2024-3-1-19-59-35.md b/.chronus/changes/enableCommonTypesRule-2024-3-1-19-59-35.md deleted file mode 100644 index 9e5b9d9e06..0000000000 --- a/.chronus/changes/enableCommonTypesRule-2024-3-1-19-59-35.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Enable `arm-common-types-version` rule by default. diff --git a/.chronus/changes/eslint-flat-config-2024-3-5-22-2-11.md b/.chronus/changes/eslint-flat-config-2024-3-5-22-2-11.md deleted file mode 100644 index 9d32308fc3..0000000000 --- a/.chronus/changes/eslint-flat-config-2024-3-5-22-2-11.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-autorest-canonical" - - "@azure-tools/typespec-autorest" - - "@azure-tools/typespec-azure-core" - - "@azure-tools/typespec-azure-portal-core" - - "@azure-tools/typespec-azure-resource-manager" ---- - -Migrate to eslint flat config \ No newline at end of file diff --git a/.chronus/changes/feature-autorest-omit-version-enum-2024-4-3-14-49-10.md b/.chronus/changes/feature-autorest-omit-version-enum-2024-4-3-14-49-10.md deleted file mode 100644 index c234dac15b..0000000000 --- a/.chronus/changes/feature-autorest-omit-version-enum-2024-4-3-14-49-10.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: breaking -packages: - - "@azure-tools/typespec-autorest" ---- - -Version enum is now omitted by default. Use `version-enum-strategy: include` to revert behavior. diff --git a/.chronus/changes/fix-allow-scalars-2024-3-26-23-13-19.md b/.chronus/changes/fix-allow-scalars-2024-3-26-23-13-19.md deleted file mode 100644 index d963bf1ba4..0000000000 --- a/.chronus/changes/fix-allow-scalars-2024-3-26-23-13-19.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Allow `@pattern` to be provided on a scalar diff --git a/.chronus/changes/fix-autorest-not-including-examples-2024-4-3-10-29-15.md b/.chronus/changes/fix-autorest-not-including-examples-2024-4-3-10-29-15.md deleted file mode 100644 index beca6404cf..0000000000 --- a/.chronus/changes/fix-autorest-not-including-examples-2024-4-3-10-29-15.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-autorest" ---- - diff --git a/.chronus/changes/fix-codefix-pattern-2024-3-19-16-11-27.md b/.chronus/changes/fix-codefix-pattern-2024-3-19-16-11-27.md deleted file mode 100644 index 59fc969b95..0000000000 --- a/.chronus/changes/fix-codefix-pattern-2024-3-19-16-11-27.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Fix `arm-resource-name-pattern` rule codefix producing invalid syntax diff --git a/.chronus/changes/fix-missing-body-root-2024-3-19-13-3-12.md b/.chronus/changes/fix-missing-body-root-2024-3-19-13-3-12.md deleted file mode 100644 index b0d4b0d5ff..0000000000 --- a/.chronus/changes/fix-missing-body-root-2024-3-19-13-3-12.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - diff --git a/.chronus/changes/fix-trait-crash-unreferencable-2024-3-18-16-38-1.md b/.chronus/changes/fix-trait-crash-unreferencable-2024-3-18-16-38-1.md deleted file mode 100644 index fcf9e2ec32..0000000000 --- a/.chronus/changes/fix-trait-crash-unreferencable-2024-3-18-16-38-1.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" ---- - -Fix crash when `Traits` builders gets passed non model diff --git a/.chronus/changes/fix_default_api_version-2024-4-7-14-54-37.md b/.chronus/changes/fix_default_api_version-2024-4-7-14-54-37.md deleted file mode 100644 index ec68dfbe0b..0000000000 --- a/.chronus/changes/fix_default_api_version-2024-4-7-14-54-37.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@azure-tools/typespec-client-generator-core" ---- - -fix wrong default version for interface from extends \ No newline at end of file diff --git a/.chronus/changes/main-2024-3-24-14-31-54.md b/.chronus/changes/main-2024-3-24-14-31-54.md deleted file mode 100644 index c62e2f2e00..0000000000 --- a/.chronus/changes/main-2024-3-24-14-31-54.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@azure-tools/typespec-azure-resource-manager" ---- - -Adding standard ExtendedLocation definition for ARM library \ No newline at end of file diff --git a/.chronus/changes/organize-azure-core-tsp-2024-4-3-15-6-37.md b/.chronus/changes/organize-azure-core-tsp-2024-4-3-15-6-37.md deleted file mode 100644 index 990e494017..0000000000 --- a/.chronus/changes/organize-azure-core-tsp-2024-4-3-15-6-37.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: internal -packages: - - "@azure-tools/typespec-azure-core" ---- - -Move deprecated operations to separate file and flatten decorators file diff --git a/.chronus/changes/rules-addEnumDocExceptions-2024-3-19-22-29-42.md b/.chronus/changes/rules-addEnumDocExceptions-2024-3-19-22-29-42.md deleted file mode 100644 index 68c7a2a43c..0000000000 --- a/.chronus/changes/rules-addEnumDocExceptions-2024-3-19-22-29-42.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" ---- - -Exempt versioning enums and discriminator enum/unions from `documentation-required` rule. diff --git a/.chronus/changes/tsp-unionDocs-2024-3-25-19-26-44.md b/.chronus/changes/tsp-unionDocs-2024-3-25-19-26-44.md deleted file mode 100644 index b4cf302b93..0000000000 --- a/.chronus/changes/tsp-unionDocs-2024-3-25-19-26-44.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" ---- - -Require documentation on most unions. diff --git a/.chronus/changes/update-resolveRef-2024-2024-4-17-11-10-36.md b/.chronus/changes/update-resolveRef-2024-2024-4-17-11-10-36.md deleted file mode 100644 index 17e208fecd..0000000000 --- a/.chronus/changes/update-resolveRef-2024-2024-4-17-11-10-36.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@azure-tools/typespec-autorest-canonical" ---- - -Add resolveRef logic for the typespec-autorest-canonical emitter diff --git a/.chronus/changes/upgrade-deps-april-2024-2024-3-13-20-12-36.md b/.chronus/changes/upgrade-deps-april-2024-2024-3-13-20-12-36.md deleted file mode 100644 index 434a338a6c..0000000000 --- a/.chronus/changes/upgrade-deps-april-2024-2024-3-13-20-12-36.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -changeKind: dependencies -packages: - - "@azure-tools/typespec-autorest-canonical" - - "@azure-tools/typespec-autorest" - - "@azure-tools/typespec-azure-core" - - "@azure-tools/typespec-azure-portal-core" - - "@azure-tools/typespec-azure-resource-manager" ---- - -Upgrade dependencies \ No newline at end of file diff --git a/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-52.md b/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-52.md deleted file mode 100644 index af68c7673a..0000000000 --- a/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-52.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-autorest" ---- - -Add support for new `@body` `@bodyRoot` and `@bodyIgnore` decorators diff --git a/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-53.md b/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-53.md deleted file mode 100644 index 40e2bcc6d3..0000000000 --- a/.chronus/changes/uptake-body-consitency-2024-3-16-19-18-53.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-azure-core" - - "@azure-tools/typespec-azure-resource-manager" ---- - -Update to support new meaning of `@body` diff --git a/.chronus/changes/uptake-body-consitency-2024-3-16-20-19-22.md b/.chronus/changes/uptake-body-consitency-2024-3-16-20-19-22.md deleted file mode 100644 index a4b9be13b1..0000000000 --- a/.chronus/changes/uptake-body-consitency-2024-3-16-20-19-22.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@azure-tools/typespec-autorest-canonical" ---- - -Add support for new `@body`, `@bodyRoot` and `@bodyIgnore` diff --git a/core b/core index 6d0e2ac50e..dec504364c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 6d0e2ac50e2cddedb8286539f3238e5232ba9fa3 +Subproject commit dec504364c90ff0769e2733326681e717c06f589 diff --git a/packages/typespec-autorest-canonical/CHANGELOG.md b/packages/typespec-autorest-canonical/CHANGELOG.md index f893679b45..ef0c9fcb96 100644 --- a/packages/typespec-autorest-canonical/CHANGELOG.md +++ b/packages/typespec-autorest-canonical/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog - @azure-tools/typespec-autorest-canonical +## 0.3.0 + +### Bug Fixes + +- [#765](https://github.com/Azure/typespec-azure/pull/765) Refactor to make use ot autorest emitter logic to compute the types +- [#293](https://github.com/Azure/typespec-azure/pull/293) Add support for new `@body`, `@bodyRoot` and `@bodyIgnore` + +### Bump dependencies + +- [#663](https://github.com/Azure/typespec-azure/pull/663) Upgrade dependencies + +### Features + +- [#671](https://github.com/Azure/typespec-azure/pull/671) Add resolveRef logic for the typespec-autorest-canonical emitter + + ## 0.2.1 ### Bug Fixes diff --git a/packages/typespec-autorest-canonical/package.json b/packages/typespec-autorest-canonical/package.json index c925161329..355f9296c4 100644 --- a/packages/typespec-autorest-canonical/package.json +++ b/packages/typespec-autorest-canonical/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-autorest-canonical", - "version": "0.2.1", + "version": "0.3.0", "author": "Microsoft Corporation", "description": "TypeSpec library for emitting canonical swagger", "homepage": "https://azure.github.io/typespec-azure", diff --git a/packages/typespec-autorest/CHANGELOG.md b/packages/typespec-autorest/CHANGELOG.md index 5939d0e213..84f1285496 100644 --- a/packages/typespec-autorest/CHANGELOG.md +++ b/packages/typespec-autorest/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log - @azure-tools/typespec-autorest +## 0.42.0 + +### Bug Fixes + +- [#745](https://github.com/Azure/typespec-azure/pull/745) prevent tcgc versioning projection +- [#293](https://github.com/Azure/typespec-azure/pull/293) Add support for new `@body` `@bodyRoot` and `@bodyIgnore` decorators + +### Bump dependencies + +- [#663](https://github.com/Azure/typespec-azure/pull/663) Upgrade dependencies + +### Features + +- [#765](https://github.com/Azure/typespec-azure/pull/765) [API] Refactor to provide functions to get the OpenAPI programtically + +### Breaking Changes + +- [#774](https://github.com/Azure/typespec-azure/pull/774) Version enum is now omitted by default. Use `version-enum-strategy: include` to revert behavior. + + ## 0.41.1 ### Bug Fixes diff --git a/packages/typespec-autorest/package.json b/packages/typespec-autorest/package.json index b048bb58e4..e745b3a0a5 100644 --- a/packages/typespec-autorest/package.json +++ b/packages/typespec-autorest/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-autorest", - "version": "0.41.1", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec library for emitting openapi from the TypeSpec REST protocol binding", "homepage": "https://azure.github.io/typespec-azure", diff --git a/packages/typespec-azure-core/CHANGELOG.md b/packages/typespec-azure-core/CHANGELOG.md index 06b5d71ba2..16279fa286 100644 --- a/packages/typespec-azure-core/CHANGELOG.md +++ b/packages/typespec-azure-core/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log - @azure-tools/typespec-azure-core +## 0.42.0 + +### Bug Fixes + +- [#619](https://github.com/Azure/typespec-azure/pull/619) Add `no-generic-numeric` rule to disable LintDiff `IntegerTypeMustHaveFormat` +- [#760](https://github.com/Azure/typespec-azure/pull/760) Fix `rpc-operation-request-body` rule not actually checking for a body parameter. +- [#694](https://github.com/Azure/typespec-azure/pull/694) Fix crash when `Traits` builders gets passed non model +- [#710](https://github.com/Azure/typespec-azure/pull/710) Exempt versioning enums and discriminator enum/unions from `documentation-required` rule. +- [#740](https://github.com/Azure/typespec-azure/pull/740) Require documentation on most unions. +- [#293](https://github.com/Azure/typespec-azure/pull/293) Update to support new meaning of `@body` + +### Bump dependencies + +- [#663](https://github.com/Azure/typespec-azure/pull/663) Upgrade dependencies + +### Breaking Changes + +- [#521](https://github.com/Azure/typespec-azure/pull/521) Switching ProvisioningState from enum to Open union + + ## 0.41.0 ### Bug Fixes diff --git a/packages/typespec-azure-core/package.json b/packages/typespec-azure-core/package.json index ffadc5d13a..5a514e2f11 100644 --- a/packages/typespec-azure-core/package.json +++ b/packages/typespec-azure-core/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-azure-core", - "version": "0.41.0", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec Azure Core library", "homepage": "https://azure.github.io/typespec-azure", diff --git a/packages/typespec-azure-portal-core/CHANGELOG.md b/packages/typespec-azure-portal-core/CHANGELOG.md index 44f222c7b0..231a746e44 100644 --- a/packages/typespec-azure-portal-core/CHANGELOG.md +++ b/packages/typespec-azure-portal-core/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog - @azure-tools/typespec-azure-portal-core +## 0.42.0 + +### Bump dependencies + +- [#663](https://github.com/Azure/typespec-azure/pull/663) Upgrade dependencies + + ## 0.41.0 ### Bump dependencies diff --git a/packages/typespec-azure-portal-core/package.json b/packages/typespec-azure-portal-core/package.json index 9702f1d47b..45ade47f57 100644 --- a/packages/typespec-azure-portal-core/package.json +++ b/packages/typespec-azure-portal-core/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-azure-portal-core", - "version": "0.41.0", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec Azure Portal Core library", "license": "MIT", diff --git a/packages/typespec-azure-resource-manager/CHANGELOG.md b/packages/typespec-azure-resource-manager/CHANGELOG.md index 6dc82153aa..8dab2d2950 100644 --- a/packages/typespec-azure-resource-manager/CHANGELOG.md +++ b/packages/typespec-azure-resource-manager/CHANGELOG.md @@ -1,5 +1,104 @@ # Change Log - @azure-tools/typespec-azure-resource-manager +## 0.42.0 + +### Bug Fixes + +- [#605](https://github.com/Azure/typespec-azure/pull/605) Specify the fully qualified name of `@OpenAPI.extension` decorator in `missing-x-ms-identifiers` linter warning. +- [#400](https://github.com/Azure/typespec-azure/pull/400) Updated `ManagedIndentity` and `CustomerManagedKey` TypeSpec model definition to be consistent with Swagger commont-types +- [#567](https://github.com/Azure/typespec-azure/pull/567) Enable `arm-common-types-version` rule by default. +- [#751](https://github.com/Azure/typespec-azure/pull/751) Allow `@pattern` to be provided on a scalar +- [#702](https://github.com/Azure/typespec-azure/pull/702) Fix `arm-resource-name-pattern` rule codefix producing invalid syntax +- [#293](https://github.com/Azure/typespec-azure/pull/293) Update to support new meaning of `@body` + +### Bump dependencies + +- [#663](https://github.com/Azure/typespec-azure/pull/663) Upgrade dependencies + +### Features + +- [#661](https://github.com/Azure/typespec-azure/pull/661) Fixing ArmResource base model and add an easier way to define Resource Name parameter +- [#736](https://github.com/Azure/typespec-azure/pull/736) Adding standard ExtendedLocation definition for ARM library + +### Deprecations + +- [#762](https://github.com/Azure/typespec-azure/pull/762) Renaming internal TypeSpec ARM foundation model names to be consistent with ARM common-type definitions. +However, these are `Azure.Resource.Manager.Foundations` models that would not normally be used directly in service specs. + +- Deprecate `Foundations.ArmResource`. `Foundations.Resource` should be used instead. + +- Deprecate `Foundations.ResourceSkuType`. `Foundations.Sku` should be used instead. + +- Deprecate `Foundations.ResourcePlanType`. `Foundations.Plan` should be used instead. + +- Deprecate `Foundations.TrackedResourceBase`. `Foundations.TrackedResource` should be used instead. + +- Deprecate `Foundations.ProxyResourceBase`. `Foundations.ProxyResource` should be used instead. + +- Deprecate `Foundations.ExtensionResourceBase`. `Foundations.ExtensionResource` should be used instead. +- [#768](https://github.com/Azure/typespec-azure/pull/768) Standardizing mix-in model names with consistent `Property` suffix. + +- Deprecate `ManagedServiceIdentity`. `ManagedServiceIdentityProperty` should be used instead. + + Example: + ```diff + -...ManagedServiceIdentity; + +...ManagedServiceIdentityProperty; + ``` + +- Deprecate `ManagedSystemAssignedIdentity`. `ManagedSystemAssignedIdentityProperty` should be used instead. + + Example: + ```diff + -...ManagedSystemAssignedIdentity; + +...ManagedSystemAssignedIdentityProperty; + ``` + +- Deprecate `EntityTag`. `EntityTagProperty` should be used instead. + + Example: + ```diff + -...EntityTag; + +...EntityTagProperty; + ``` + +- Deprecate `ResourceKind`. `ResourceKindProperty` should be used instead. + + Example: + ```diff + -...ResourceKind; + +...ResourceKindProperty; + ``` + +- Deprecate `ResourcePlan`. `ResourcePlanProperty` should be used instead. + + Example: + ```diff + -...ResourcePlan; + +...ResourcePlanProperty; + ``` + +- Deprecate `ResourceSku`. `ResourceSkuProperty` should be used instead. + + Example: + ```diff + -...ResourceSku; + +...ResourceSkuProperty; + ``` + +- Deprecate `ManagedBy`. `ManagedByProperty` should be used instead. + + Example: + ```diff + -...ManagedBy; + +...ManagedByProperty; + ``` + +### Breaking Changes + +- [#521](https://github.com/Azure/typespec-azure/pull/521) Switching ProvisioningState from enum to Open union + + ## 0.41.0 ### Bug Fixes diff --git a/packages/typespec-azure-resource-manager/package.json b/packages/typespec-azure-resource-manager/package.json index 00274a59d9..6e447789fa 100644 --- a/packages/typespec-azure-resource-manager/package.json +++ b/packages/typespec-azure-resource-manager/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-azure-resource-manager", - "version": "0.41.0", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec Azure Resource Manager library", "homepage": "https://azure.github.io/typespec-azure", diff --git a/packages/typespec-client-generator-core/CHANGELOG.md b/packages/typespec-client-generator-core/CHANGELOG.md index 0457eb7fbc..07fd1dcf12 100644 --- a/packages/typespec-client-generator-core/CHANGELOG.md +++ b/packages/typespec-client-generator-core/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @azure-tools/typespec-client-generator-core +## 0.42.0 + +### Bug Fixes + +- [#788](https://github.com/Azure/typespec-azure/pull/788) fix wrong default version for interface from extends + + ## 0.41.9 ### Bug Fixes diff --git a/packages/typespec-client-generator-core/package.json b/packages/typespec-client-generator-core/package.json index b2e35c12f8..31da6da77e 100644 --- a/packages/typespec-client-generator-core/package.json +++ b/packages/typespec-client-generator-core/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-client-generator-core", - "version": "0.41.9", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec Data Plane Generation library", "homepage": "https://azure.github.io/typespec-azure", diff --git a/packages/website/playground-versions.json b/packages/website/playground-versions.json index 9bd513c602..8e6c545af5 100644 --- a/packages/website/playground-versions.json +++ b/packages/website/playground-versions.json @@ -1,4 +1,5 @@ [ + "0.42.x", "0.41.x", "0.40.x", "0.39.x", diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/emitter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/emitter.md index 11cd57e081..4613b5348f 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/emitter.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/emitter.md @@ -48,6 +48,12 @@ Example: Multiple services **Type:** `string` +### `arm-types-dir` + +**Type:** `string` + +Path to the common-types.json file folder. Default: '${project-root}/../../common-types/resource-management' + ### `new-line` **Type:** `"crlf" | "lf"` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/functions/sortOpenAPIDocument.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/functions/sortOpenAPIDocument.md deleted file mode 100644 index 2c097c1fe6..0000000000 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/functions/sortOpenAPIDocument.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -jsApi: true -title: "[F] sortOpenAPIDocument" - ---- -```ts -sortOpenAPIDocument(doc): OpenAPI2Document -``` - -## Parameters - -| Parameter | Type | -| :------ | :------ | -| `doc` | `OpenAPI2Document` | - -## Returns - -`OpenAPI2Document` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/index.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/index.md index c1af15bbb0..d316055f98 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/index.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/index.md @@ -6,15 +6,11 @@ title: "[P] JS API" ## Interfaces - [AutorestCanonicalEmitterOptions](interfaces/AutorestCanonicalEmitterOptions.md) -- [ResolvedAutorestCanonicalEmitterOptions](interfaces/ResolvedAutorestCanonicalEmitterOptions.md) ## Variables - [$lib](variables/$lib.md) -- [canonicalVersion](variables/canonicalVersion.md) -- [namespace](variables/namespace.md) ## Functions - [$onEmit](functions/$onEmit.md) -- [sortOpenAPIDocument](functions/sortOpenAPIDocument.md) diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/AutorestCanonicalEmitterOptions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/AutorestCanonicalEmitterOptions.md index b2daed32da..a47d01a129 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/AutorestCanonicalEmitterOptions.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/AutorestCanonicalEmitterOptions.md @@ -7,6 +7,7 @@ title: "[I] AutorestCanonicalEmitterOptions" | Property | Type | Description | | :------ | :------ | :------ | +| `arm-types-dir?` | `string` | Path to the common-types.json file folder.

**Default**
` "${project-root}/../../common-types/resource-management" ` | | `azure-resource-provider-folder?` | `string` | - | | `include-x-typespec-name?` | `"never"` \| `"inline-only"` | If the generated openapi types should have the `x-typespec-name` extension set with the name of the TypeSpec type that created it.
This extension is meant for debugging and should not be depended on.

**Default**
` "never" ` | | `new-line?` | `"lf"` \| `"crlf"` | Set the newline character for emitting files.

**Default**
` lf ` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/ResolvedAutorestCanonicalEmitterOptions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/ResolvedAutorestCanonicalEmitterOptions.md deleted file mode 100644 index 4e676944c3..0000000000 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/interfaces/ResolvedAutorestCanonicalEmitterOptions.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -jsApi: true -title: "[I] ResolvedAutorestCanonicalEmitterOptions" - ---- -## Properties - -| Property | Type | Description | -| :------ | :------ | :------ | -| `armTypesDir` | `string` | Arm types dir | -| `azureResourceProviderFolder?` | `string` | - | -| `includeXTypeSpecName` | `"never"` \| `"inline-only"` | If the x-typespec-name extension should be included | -| `newLine?` | `"lf"` \| `"crlf"` | Set the newline character for emitting files.

**Default**
` lf ` | -| `omitUnreachableTypes?` | `boolean` | Omit unreachable types.
By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted. | -| `outputDir` | `string` | - | -| `outputFile` | `string` | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/$lib.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/$lib.md index 673b1317d1..eff3d049b1 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/$lib.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/$lib.md @@ -11,34 +11,5 @@ const $lib: TypeSpecLibrary; | Member | Type | Value | | :------ | :------ | :------ | -| `duplicate-body-types` | `Object` | - | -| `duplicate-body-types.default` | `"Request has multiple body types"` | "Request has multiple body types" | -| `inline-cycle` | `Object` | - | -| `inline-cycle.default` | `CallableMessage`<[`"type"`]\> | - | -| `invalid-default` | `Object` | - | -| `invalid-default.default` | `CallableMessage`<[`"type"`]\> | - | -| `invalid-format` | `Object` | - | -| `invalid-format.default` | `CallableMessage`<[`"schema"`, `"format"`]\> | - | -| `invalid-multi-collection-format` | `Object` | - | -| `invalid-multi-collection-format.default` | `"The 'multi' should be applied to parameter in 'query', 'header' or 'formData'."` | "The 'multi' should be applied to parameter in 'query', 'header' or 'formData'." | -| `invalid-schema` | `Object` | - | -| `invalid-schema.default` | `CallableMessage`<[`"type"`]\> | - | -| `nonspecific-scalar` | `Object` | - | -| `nonspecific-scalar.default` | `CallableMessage`<[`"type"`, `"chosenType"`]\> | - | -| `union-null` | `Object` | - | -| `union-null.default` | `"Cannot have a union containing only null types."` | "Cannot have a union containing only null types." | -| `union-unsupported` | `Object` | - | -| `union-unsupported.default` | `"Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type."` | "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type." | -| `union-unsupported.empty` | `"Empty unions are not supported for OpenAPI v2 - enums must have at least one value."` | "Empty unions are not supported for OpenAPI v2 - enums must have at least one value." | -| `unsupported-auth` | `Object` | - | -| `unsupported-auth.default` | `CallableMessage`<[`"authType"`]\> | - | -| `unsupported-http-auth-scheme` | `Object` | - | -| `unsupported-http-auth-scheme.default` | `CallableMessage`<[`"scheme"`]\> | - | -| `unsupported-multipart-type` | `Object` | - | -| `unsupported-multipart-type.default` | `CallableMessage`<[`"part"`]\> | - | -| `unsupported-param-type` | `Object` | - | -| `unsupported-param-type.default` | `CallableMessage`<[`"part"`]\> | - | -| `unsupported-status-code-range` | `Object` | - | -| `unsupported-status-code-range.default` | `CallableMessage`<[`"start"`, `"end"`]\> | - | | `unsupported-versioning-decorator` | `Object` | - | | `unsupported-versioning-decorator.default` | `CallableMessage`<[`"decorator"`]\> | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/canonicalVersion.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/canonicalVersion.md deleted file mode 100644 index 35c153e8bd..0000000000 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/canonicalVersion.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -jsApi: true -title: "[V] canonicalVersion" - ---- -```ts -const canonicalVersion: "canonical" = "canonical"; -``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/namespace.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/namespace.md deleted file mode 100644 index 5dd87a865b..0000000000 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest-canonical/reference/js-api/variables/namespace.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -jsApi: true -title: "[V] namespace" - ---- -```ts -const namespace: "AutorestCanonical" = "AutorestCanonical"; -``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/emitter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/emitter.md index d7075fe3dd..13979134cd 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/emitter.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/emitter.md @@ -101,6 +101,12 @@ Set the newline character for emitting files. Omit unreachable types. By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted. +### `version-enum-strategy` + +**Type:** `string` + +Decide how to deal with the Version enum when when `omit-unreachable-types` is not set. Default to 'omit' + ### `include-x-typespec-name` **Type:** `"inline-only" | "never"` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/getOpenAPIForService.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/getOpenAPIForService.md new file mode 100644 index 0000000000..559216a459 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/getOpenAPIForService.md @@ -0,0 +1,19 @@ +--- +jsApi: true +title: "[F] getOpenAPIForService" + +--- +```ts +getOpenAPIForService(context, options): Promise +``` + +## Parameters + +| Parameter | Type | +| :------ | :------ | +| `context` | [`AutorestEmitterContext`](../interfaces/AutorestEmitterContext.md) | +| `options` | [`AutorestDocumentEmitterOptions`](../interfaces/AutorestDocumentEmitterOptions.md) | + +## Returns + +`Promise`<`AutorestEmitterResult`\> diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/sortOpenAPIDocument.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/sortOpenAPIDocument.md index 2c097c1fe6..ce6b41932c 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/sortOpenAPIDocument.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/functions/sortOpenAPIDocument.md @@ -11,8 +11,8 @@ sortOpenAPIDocument(doc): OpenAPI2Document | Parameter | Type | | :------ | :------ | -| `doc` | `OpenAPI2Document` | +| `doc` | [`OpenAPI2Document`](../interfaces/OpenAPI2Document.md) | ## Returns -`OpenAPI2Document` +[`OpenAPI2Document`](../interfaces/OpenAPI2Document.md) diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/index.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/index.md index 4a068f84e6..b4dcd34dea 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/index.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/index.md @@ -5,14 +5,55 @@ title: "[P] JS API" --- ## Interfaces +- [AutorestDocumentEmitterOptions](interfaces/AutorestDocumentEmitterOptions.md) +- [AutorestEmitterContext](interfaces/AutorestEmitterContext.md) - [AutorestEmitterOptions](interfaces/AutorestEmitterOptions.md) - [Example](interfaces/Example.md) +- [OpenAPI2ApiKeySecurityScheme](interfaces/OpenAPI2ApiKeySecurityScheme.md) +- [OpenAPI2BasicAuthenticationSecurityScheme](interfaces/OpenAPI2BasicAuthenticationSecurityScheme.md) +- [OpenAPI2BodyParameter](interfaces/OpenAPI2BodyParameter.md) +- [OpenAPI2Document](interfaces/OpenAPI2Document.md) +- [OpenAPI2Example](interfaces/OpenAPI2Example.md) +- [OpenAPI2ExternalDocs](interfaces/OpenAPI2ExternalDocs.md) +- [OpenAPI2FormDataParameter](interfaces/OpenAPI2FormDataParameter.md) +- [OpenAPI2HeaderDefinition](interfaces/OpenAPI2HeaderDefinition.md) +- [OpenAPI2HeaderParameter](interfaces/OpenAPI2HeaderParameter.md) +- [OpenAPI2Info](interfaces/OpenAPI2Info.md) +- [OpenAPI2OAuth2AccessCodeSecurityScheme](interfaces/OpenAPI2OAuth2AccessCodeSecurityScheme.md) +- [OpenAPI2OAuth2ApplicationSecurityScheme](interfaces/OpenAPI2OAuth2ApplicationSecurityScheme.md) +- [OpenAPI2OAuth2ImplicitSecurityScheme](interfaces/OpenAPI2OAuth2ImplicitSecurityScheme.md) +- [OpenAPI2OAuth2PasswordSecurityScheme](interfaces/OpenAPI2OAuth2PasswordSecurityScheme.md) +- [OpenAPI2OAuthSecurityBase](interfaces/OpenAPI2OAuthSecurityBase.md) +- [OpenAPI2ParameterBase](interfaces/OpenAPI2ParameterBase.md) +- [OpenAPI2PathParameter](interfaces/OpenAPI2PathParameter.md) +- [OpenAPI2QueryParameter](interfaces/OpenAPI2QueryParameter.md) +- [OpenAPI2Response](interfaces/OpenAPI2Response.md) +- [OpenAPI2SecuritySchemeBase](interfaces/OpenAPI2SecuritySchemeBase.md) +- [OpenAPI2Tag](interfaces/OpenAPI2Tag.md) +- [PrimitiveItems](interfaces/PrimitiveItems.md) +- [Ref](interfaces/Ref.md) - [RefProducerParams](interfaces/RefProducerParams.md) -- [ResolvedAutorestEmitterOptions](interfaces/ResolvedAutorestEmitterOptions.md) +- [XMSParameterizedHost](interfaces/XMSParameterizedHost.md) ## Type Aliases +- [Extensions](type-aliases/Extensions.md) +- [HttpMethod](type-aliases/HttpMethod.md) +- [JsonType](type-aliases/JsonType.md) +- [OpenAPI2OAuth2FlowType](type-aliases/OpenAPI2OAuth2FlowType.md) +- [OpenAPI2Operation](type-aliases/OpenAPI2Operation.md) +- [OpenAPI2Parameter](type-aliases/OpenAPI2Parameter.md) +- [OpenAPI2ParameterType](type-aliases/OpenAPI2ParameterType.md) +- [OpenAPI2PathItem](type-aliases/OpenAPI2PathItem.md) +- [OpenAPI2Responses](type-aliases/OpenAPI2Responses.md) +- [OpenAPI2Schema](type-aliases/OpenAPI2Schema.md) +- [OpenAPI2SchemaProperty](type-aliases/OpenAPI2SchemaProperty.md) +- [OpenAPI2SchemaRefProperty](type-aliases/OpenAPI2SchemaRefProperty.md) +- [OpenAPI2SecurityRequirement](type-aliases/OpenAPI2SecurityRequirement.md) +- [OpenAPI2SecurityScheme](type-aliases/OpenAPI2SecurityScheme.md) +- [OpenAPI2StatusCode](type-aliases/OpenAPI2StatusCode.md) - [RefProducer](type-aliases/RefProducer.md) +- [Refable](type-aliases/Refable.md) ## Variables @@ -25,6 +66,7 @@ title: "[P] JS API" - [$onEmit](functions/$onEmit.md) - [$useRef](functions/$useRef.md) - [getExamples](functions/getExamples.md) +- [getOpenAPIForService](functions/getOpenAPIForService.md) - [getRef](functions/getRef.md) - [setRefProducer](functions/setRefProducer.md) - [sortOpenAPIDocument](functions/sortOpenAPIDocument.md) diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestDocumentEmitterOptions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestDocumentEmitterOptions.md new file mode 100644 index 0000000000..4f8b8037f1 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestDocumentEmitterOptions.md @@ -0,0 +1,17 @@ +--- +jsApi: true +title: "[I] AutorestDocumentEmitterOptions" + +--- +Options to configure the behavior of the Autorest document emitter. + +## Properties + +| Property | Modifier | Type | Description | +| :------ | :------ | :------ | :------ | +| `armTypesDir` | `readonly` | `string` | Arm types dir | +| `examplesDirectory?` | `readonly` | `string` | - | +| `includeXTypeSpecName` | `readonly` | `"never"` \| `"inline-only"` | If the x-typespec-name extension should be included | +| `omitUnreachableTypes?` | `readonly` | `boolean` | Omit unreachable types.
By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted. | +| `useReadOnlyStatusSchema?` | `readonly` | `boolean` | readOnly property schema behavior | +| `versionEnumStrategy?` | `readonly` | `"include"` \| `"omit"` | Decide how to deal with the version enum when `omitUnreachableTypes` is not set.

**Default**
` "omit" ` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterContext.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterContext.md new file mode 100644 index 0000000000..966ffdd9ab --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterContext.md @@ -0,0 +1,14 @@ +--- +jsApi: true +title: "[I] AutorestEmitterContext" + +--- +## Properties + +| Property | Modifier | Type | +| :------ | :------ | :------ | +| `outputFile` | `readonly` | `string` | +| `program` | `readonly` | `Program` | +| `service` | `readonly` | `Service` | +| `tcgcSdkContext` | `readonly` | `SdkContext`<`Record`<`string`, `any`\>, `SdkHttpOperation`\> | +| `version?` | `readonly` | `string` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterOptions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterOptions.md index 22c2af0315..56a8484184 100644 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterOptions.md +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/AutorestEmitterOptions.md @@ -17,3 +17,4 @@ title: "[I] AutorestEmitterOptions" | `output-file?` | `string` | Name of the output file.
Output file will interpolate the following values:
- service-name: Name of the service if multiple
- version: Version of the service if multiple
- azure-resource-provider-folder: Value of the azure-resource-provider-folder option
- version-status: Only enabled if azure-resource-provider-folder is set. `preview` if version contains preview, stable otherwise.

**Default**
`{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json`

**Example**
` Single service no versioning - `openapi.yaml` `

**Example**
` Multiple services no versioning - `openapi.Org1.Service1.yaml` - `openapi.Org1.Service2.yaml` `

**Example**
` Single service with versioning - `openapi.v1.yaml` - `openapi.v2.yaml` `

**Example**
` Multiple service with versioning - `openapi.Org1.Service1.v1.yaml` - `openapi.Org1.Service1.v2.yaml` - `openapi.Org1.Service2.v1.0.yaml` - `openapi.Org1.Service2.v1.1.yaml` `

**Example**
` azureResourceProviderFolder is provided - `arm-folder/AzureService/preview/2020-01-01.yaml` - `arm-folder/AzureService/preview/2020-01-01.yaml` ` | | `use-read-only-status-schema?` | `boolean` | Determines whether to transmit the 'readOnly' property to lro status schemas.

**Default**
` false ` | | `version?` | `string` | - | +| `version-enum-strategy?` | `"include"` \| `"omit"` | Decide how to deal with the Version enum when when `omit-unreachable-types` is not set.

**Default**
` "omit" ` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ApiKeySecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ApiKeySecurityScheme.md new file mode 100644 index 0000000000..523699b05f --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ApiKeySecurityScheme.md @@ -0,0 +1,19 @@ +--- +jsApi: true +title: "[I] OpenAPI2ApiKeySecurityScheme" + +--- +ApiKey Security Scheme + +## Extends + +- [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | +| `in` | `"header"` \| `"query"` | The location of the API key. Valid values are "query" or "header". | - | - | +| `name` | `string` | The name of the header or query parameter to be used. | - | - | +| `type` | `"apiKey"` | ApiKey | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BasicAuthenticationSecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BasicAuthenticationSecurityScheme.md new file mode 100644 index 0000000000..c59a65f977 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BasicAuthenticationSecurityScheme.md @@ -0,0 +1,17 @@ +--- +jsApi: true +title: "[I] OpenAPI2BasicAuthenticationSecurityScheme" + +--- +Basic Auth Security Scheme + +## Extends + +- [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | +| `type` | `"basic"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BodyParameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BodyParameter.md new file mode 100644 index 0000000000..20b0df3de6 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2BodyParameter.md @@ -0,0 +1,23 @@ +--- +jsApi: true +title: "[I] OpenAPI2BodyParameter" + +--- +## Extends + +- [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `allowEmptyValue?` | `boolean` | - | - | +| `description?` | `string` | - | - | +| `example?` | `unknown` | - | - | +| `in` | `"body"` | - | - | +| `name` | `string` | - | - | +| `required?` | `boolean` | - | - | +| `schema` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md) | - | - | +| `x-ms-client-flatten?` | `boolean` | - | - | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Document.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Document.md new file mode 100644 index 0000000000..dd1fdbe6bd --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Document.md @@ -0,0 +1,28 @@ +--- +jsApi: true +title: "[I] OpenAPI2Document" + +--- +## Extends + +- [`Extensions`](../type-aliases/Extensions.md) + +## Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `consumes?` | `string`[] | A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls | +| `definitions?` | `Record`<`string`, [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md)\> | Data types that can be consumed and produced by operations | +| `externalDocs?` | [`OpenAPI2ExternalDocs`](OpenAPI2ExternalDocs.md) | Additional external documentation. | +| `host?` | `string` | The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port.
If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating. | +| `info` | [`OpenAPI2Info`](OpenAPI2Info.md) | Provides metadata about the API. The metadata can be used by the clients if needed. | +| `parameters?` | `Record`<`string`, [`OpenAPI2Parameter`](../type-aliases/OpenAPI2Parameter.md)\> | parameters that can be used across operations | +| `paths` | `Record`<`string`, [`OpenAPI2PathItem`](../type-aliases/OpenAPI2PathItem.md)\> | The available paths and operations for the API | +| `produces?` | `string`[] | A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls | +| `schemes?` | `string`[] | The transfer protocol of the API. Values MUST be from the list: "http", "https", "ws", "wss". | +| `security?` | [`OpenAPI2SecurityRequirement`](../type-aliases/OpenAPI2SecurityRequirement.md)[] | A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition | +| `securityDefinitions?` | `Record`<`string`, [`OpenAPI2SecurityScheme`](../type-aliases/OpenAPI2SecurityScheme.md)\> | Security scheme definitions that can be used across the specification | +| `swagger` | `"2.0"` | - | +| `tags?` | [`OpenAPI2Tag`](OpenAPI2Tag.md)[] | A list of tags used by the specification with additional metadata.
The order of the tags can be used to reflect on their order by the parsing tools.
Not all tags that are used by the Operation Object must be declared.
The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. | +| `x-ms-parameterized-host?` | [`XMSParameterizedHost`](XMSParameterizedHost.md) | When used, replaces the standard OpenAPI "host" attribute with a host that contains variables to be replaced as part of method execution or client construction, very similar to how path parameters work. | +| `x-ms-paths?` | `Record`<`string`, [`OpenAPI2PathItem`](../type-aliases/OpenAPI2PathItem.md)\> | Additional paths and operations that cannot be used in `paths` as the url is not unique.
This can be used to provide operation overload using a query param.

**Example**
` "/foo?type=abc" returning FooA and "/foo?type=xyz" returning FooB are not allowed in `paths` as there is query params. ` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Example.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Example.md new file mode 100644 index 0000000000..3740d99712 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Example.md @@ -0,0 +1,14 @@ +--- +jsApi: true +title: "[I] OpenAPI2Example" + +--- +Allows sharing examples for operation responses. + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject + +## Indexable + + \[`mineType`: `string`\]: `unknown` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ExternalDocs.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ExternalDocs.md new file mode 100644 index 0000000000..9c2a39285c --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ExternalDocs.md @@ -0,0 +1,11 @@ +--- +jsApi: true +title: "[I] OpenAPI2ExternalDocs" + +--- +## Properties + +| Property | Type | +| :------ | :------ | +| `description?` | `string` | +| `url` | `string` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2FormDataParameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2FormDataParameter.md new file mode 100644 index 0000000000..9ef8935743 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2FormDataParameter.md @@ -0,0 +1,30 @@ +--- +jsApi: true +title: "[I] OpenAPI2FormDataParameter" + +--- +## Extends + +- [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `allOf?` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md)[] | - | - | +| `allowEmptyValue?` | `boolean` | - | - | +| `collectionFormat?` | \| `"csv"` \| `"multi"` \| `"ssv"` \| `"tsv"` \| `"pipes"` | - | - | +| `default?` | `unknown` | - | - | +| `description?` | `string` | - | - | +| `enum?` | `string`[] | - | - | +| `example?` | `unknown` | - | - | +| `format?` | `string` | - | - | +| `in` | `"formData"` | - | - | +| `items?` | [`PrimitiveItems`](PrimitiveItems.md) | - | - | +| `name` | `string` | - | - | +| `required?` | `boolean` | - | - | +| `schema?` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md) | - | - | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"file"` \| `"integer"` \| `"array"` | - | - | +| `x-ms-client-flatten?` | `boolean` | - | - | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderDefinition.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderDefinition.md new file mode 100644 index 0000000000..a0d48f730b --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderDefinition.md @@ -0,0 +1,18 @@ +--- +jsApi: true +title: "[I] OpenAPI2HeaderDefinition" + +--- +## Extended by + +- [`OpenAPI2HeaderParameter`](OpenAPI2HeaderParameter.md) + +## Properties + +| Property | Type | +| :------ | :------ | +| `collectionFormat?` | `"csv"` \| `"ssv"` \| `"tsv"` \| `"pipes"` | +| `description?` | `string` | +| `format?` | `string` | +| `items?` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md) | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"integer"` \| `"array"` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderParameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderParameter.md new file mode 100644 index 0000000000..91776de566 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2HeaderParameter.md @@ -0,0 +1,23 @@ +--- +jsApi: true +title: "[I] OpenAPI2HeaderParameter" + +--- +## Extends + +- [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).[`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `collectionFormat?` | `"csv"` \| `"ssv"` \| `"tsv"` \| `"pipes"` | - | [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).`collectionFormat` | +| `description?` | `string` | - | [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).`description` | +| `format?` | `string` | - | [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).`format` | +| `in` | `"header"` | - | - | +| `items?` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md) | - | [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).`items` | +| `name` | `string` | - | - | +| `required?` | `boolean` | - | - | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"integer"` \| `"array"` | - | [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md).`type` | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Info.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Info.md new file mode 100644 index 0000000000..7967d6b4a3 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Info.md @@ -0,0 +1,17 @@ +--- +jsApi: true +title: "[I] OpenAPI2Info" + +--- +## Extends + +- [`Extensions`](../type-aliases/Extensions.md) + +## Properties + +| Property | Type | +| :------ | :------ | +| `description?` | `string` | +| `termsOfService?` | `string` | +| `title` | `string` | +| `version` | `string` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2AccessCodeSecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2AccessCodeSecurityScheme.md new file mode 100644 index 0000000000..460fe14e79 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2AccessCodeSecurityScheme.md @@ -0,0 +1,21 @@ +--- +jsApi: true +title: "[I] OpenAPI2OAuth2AccessCodeSecurityScheme" + +--- +OAuth2 Security Code Security Scheme + +## Extends + +- [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `authorizationUrl` | `string` | The authorization URL to be used for this flow. This MUST be in the form of a URL. | - | - | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | +| `flow` | `"accessCode"` | The flow used by the OAuth2 security scheme | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | +| `scopes` | `Record`<`string`, `string`\> | The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | +| `tokenUrl` | `string` | The token URL to be used for this flow. This MUST be in the form of a URL. | - | - | +| `type` | `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ApplicationSecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ApplicationSecurityScheme.md new file mode 100644 index 0000000000..4630816f70 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ApplicationSecurityScheme.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[I] OpenAPI2OAuth2ApplicationSecurityScheme" + +--- +OAuth2 Application Security Scheme + +## Extends + +- [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | +| `flow` | `"application"` | The flow used by the OAuth2 security scheme | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | +| `scopes` | `Record`<`string`, `string`\> | The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | +| `tokenUrl` | `string` | The token URL to be used for this flow. This MUST be in the form of a URL. | - | - | +| `type` | `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ImplicitSecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ImplicitSecurityScheme.md new file mode 100644 index 0000000000..c4eb5083ee --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2ImplicitSecurityScheme.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[I] OpenAPI2OAuth2ImplicitSecurityScheme" + +--- +OAuth2 Implicit Security Scheme + +## Extends + +- [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `authorizationUrl` | `string` | The authorization URL to be used for this flow. This MUST be in the form of a URL. | - | - | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | +| `flow` | `"implicit"` | The flow used by the OAuth2 security scheme | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | +| `scopes` | `Record`<`string`, `string`\> | The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | +| `type` | `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2PasswordSecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2PasswordSecurityScheme.md new file mode 100644 index 0000000000..9582b7360b --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuth2PasswordSecurityScheme.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[I] OpenAPI2OAuth2PasswordSecurityScheme" + +--- +OAuth2 Password Security Scheme + +## Extends + +- [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`description` | +| `flow` | `"password"` | The flow used by the OAuth2 security scheme | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`flow` | +| `scopes` | `Record`<`string`, `string`\> | The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`scopes` | +| `tokenUrl` | `string` | The token URL to be used for this flow. This MUST be in the form of a URL. | - | - | +| `type` | `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | [`OpenAPI2OAuthSecurityBase`](OpenAPI2OAuthSecurityBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuthSecurityBase.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuthSecurityBase.md new file mode 100644 index 0000000000..6059bee3d3 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2OAuthSecurityBase.md @@ -0,0 +1,23 @@ +--- +jsApi: true +title: "[I] OpenAPI2OAuthSecurityBase" + +--- +Allows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code). + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-scheme-object + +## Extends + +- [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md) + +## Properties + +| Property | Type | Description | Overrides | Inherited from | +| :------ | :------ | :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`description` | +| `flow` | [`OpenAPI2OAuth2FlowType`](../type-aliases/OpenAPI2OAuth2FlowType.md) | The flow used by the OAuth2 security scheme | - | - | +| `scopes` | `Record`<`string`, `string`\> | The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. | - | - | +| `type` | `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | [`OpenAPI2SecuritySchemeBase`](OpenAPI2SecuritySchemeBase.md).`type` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ParameterBase.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ParameterBase.md new file mode 100644 index 0000000000..bdfcd9a1aa --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2ParameterBase.md @@ -0,0 +1,15 @@ +--- +jsApi: true +title: "[I] OpenAPI2ParameterBase" + +--- +## Extends + +- [`Extensions`](../type-aliases/Extensions.md) + +## Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | +| `x-ms-parameter-location?` | `string` | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2PathParameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2PathParameter.md new file mode 100644 index 0000000000..130f4195e4 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2PathParameter.md @@ -0,0 +1,25 @@ +--- +jsApi: true +title: "[I] OpenAPI2PathParameter" + +--- +## Extends + +- [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `allowEmptyValue?` | `boolean` | - | - | +| `collectionFormat?` | `"csv"` \| `"ssv"` \| `"tsv"` \| `"pipes"` | - | - | +| `description?` | `string` | - | - | +| `enum?` | `string`[] | - | - | +| `format?` | `string` | - | - | +| `in` | `"path"` | - | - | +| `name` | `string` | - | - | +| `required?` | `boolean` | - | - | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"integer"` \| `"array"` | - | - | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | +| `x-ms-skip-url-encoding?` | `boolean` | - | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2QueryParameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2QueryParameter.md new file mode 100644 index 0000000000..f12f8d4c38 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2QueryParameter.md @@ -0,0 +1,24 @@ +--- +jsApi: true +title: "[I] OpenAPI2QueryParameter" + +--- +## Extends + +- [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `allowEmptyValue?` | `boolean` | - | - | +| `collectionFormat?` | \| `"csv"` \| `"multi"` \| `"ssv"` \| `"tsv"` \| `"pipes"` | - | - | +| `description?` | `string` | - | - | +| `enum?` | `string`[] | - | - | +| `format?` | `string` | - | - | +| `in` | `"query"` | - | - | +| `name` | `string` | - | - | +| `required?` | `boolean` | - | - | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"integer"` \| `"array"` | - | - | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Response.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Response.md new file mode 100644 index 0000000000..69e2af1bac --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Response.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[I] OpenAPI2Response" + +--- +Describes a single response from an API Operation. + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#response-object + +## Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `description` | `string` | A short description of the response. Commonmark syntax can be used for rich text representation | +| `examples?` | `Record`<`string`, [`OpenAPI2Example`](OpenAPI2Example.md)\> | An example of the response message. | +| `headers?` | `Record`<`string`, [`OpenAPI2HeaderDefinition`](OpenAPI2HeaderDefinition.md)\> | A list of headers that are sent with the response. | +| `schema?` | [`OpenAPI2Schema`](../type-aliases/OpenAPI2Schema.md) | A definition of the response structure. It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the Schema Object, its root type value may also be "file". This SHOULD be accompanied by a relevant produces mime-type. | +| `x-ms-error-response?` | `boolean` | Indicates whether the response status code should be treated as an error response. | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2SecuritySchemeBase.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2SecuritySchemeBase.md new file mode 100644 index 0000000000..2e5c38765a --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2SecuritySchemeBase.md @@ -0,0 +1,21 @@ +--- +jsApi: true +title: "[I] OpenAPI2SecuritySchemeBase" + +--- +Allows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code). + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-scheme-object + +## Extends + +- [`Extensions`](../type-aliases/Extensions.md) + +## Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `description?` | `string` | A short description for security scheme. | +| `type` | `"basic"` \| `"apiKey"` \| `"oauth2"` | The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Tag.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Tag.md new file mode 100644 index 0000000000..7e34cc2b08 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/OpenAPI2Tag.md @@ -0,0 +1,16 @@ +--- +jsApi: true +title: "[I] OpenAPI2Tag" + +--- +## Extends + +- [`Extensions`](../type-aliases/Extensions.md) + +## Properties + +| Property | Type | +| :------ | :------ | +| `description?` | `string` | +| `externalDocs?` | [`OpenAPI2ExternalDocs`](OpenAPI2ExternalDocs.md) | +| `name` | `string` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/PrimitiveItems.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/PrimitiveItems.md new file mode 100644 index 0000000000..b8703e4585 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/PrimitiveItems.md @@ -0,0 +1,19 @@ +--- +jsApi: true +title: "[I] PrimitiveItems" + +--- +## Extends + +- [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md) + +## Properties + +| Property | Type | Description | Inherited from | +| :------ | :------ | :------ | :------ | +| `default?` | `unknown` | - | - | +| `format?` | `string` | - | - | +| `items?` | [`PrimitiveItems`](PrimitiveItems.md) | - | - | +| `type` | \| `"string"` \| `"number"` \| `"boolean"` \| `"file"` \| `"integer"` \| `"array"` | - | - | +| `x-ms-client-name?` | `string` | Provide a different name to be used in the client. | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-client-name` | +| `x-ms-parameter-location?` | `string` | - | [`OpenAPI2ParameterBase`](OpenAPI2ParameterBase.md).`x-ms-parameter-location` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/Ref.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/Ref.md new file mode 100644 index 0000000000..16a2c78b5f --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/Ref.md @@ -0,0 +1,16 @@ +--- +jsApi: true +title: "[I] Ref" + +--- +## Type parameters + +| Type parameter | +| :------ | +| `T` | + +## Properties + +| Property | Type | +| :------ | :------ | +| `$ref` | `string` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/ResolvedAutorestEmitterOptions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/ResolvedAutorestEmitterOptions.md deleted file mode 100644 index 458ba00015..0000000000 --- a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/ResolvedAutorestEmitterOptions.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -jsApi: true -title: "[I] ResolvedAutorestEmitterOptions" - ---- -## Properties - -| Property | Type | Description | -| :------ | :------ | :------ | -| `armTypesDir` | `string` | Arm types dir | -| `azureResourceProviderFolder?` | `string` | - | -| `examplesDirectory?` | `string` | - | -| `includeXTypeSpecName` | `"never"` \| `"inline-only"` | If the x-typespec-name extension should be included | -| `newLine?` | `"lf"` \| `"crlf"` | Set the newline character for emitting files.

**Default**
` lf ` | -| `omitUnreachableTypes?` | `boolean` | Omit unreachable types.
By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted. | -| `outputDir` | `string` | - | -| `outputFile` | `string` | - | -| `useReadOnlyStatusSchema?` | `boolean` | readOnly property schema behavior | -| `version?` | `string` | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/XMSParameterizedHost.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/XMSParameterizedHost.md new file mode 100644 index 0000000000..ea2c9a2d02 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/interfaces/XMSParameterizedHost.md @@ -0,0 +1,12 @@ +--- +jsApi: true +title: "[I] XMSParameterizedHost" + +--- +## Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `hostTemplate` | `string` | Specifies the parameterized template for the host. | +| `parameters?` | [`OpenAPI2Parameter`](../type-aliases/OpenAPI2Parameter.md)[] | The list of parameters that are used within the hostTemplate.
This can include both reference parameters as well as explicit parameters. Note that "in" is required and must be set to "path".
The reference parameters will be treated as global parameters and will end up as property of the client. | +| `useSchemePrefix?` | `boolean` | Specifies whether to prepend the default scheme a.k.a protocol to the base uri of client.

**Default**
` true ` | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Extensions.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Extensions.md new file mode 100644 index 0000000000..1438e101bf --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Extensions.md @@ -0,0 +1,8 @@ +--- +jsApi: true +title: "[T] Extensions" + +--- +```ts +type Extensions: { [key in ExtensionKey]?: unknown }; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/HttpMethod.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/HttpMethod.md new file mode 100644 index 0000000000..5a9e21760c --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/HttpMethod.md @@ -0,0 +1,16 @@ +--- +jsApi: true +title: "[T] HttpMethod" + +--- +```ts +type HttpMethod: + | "get" + | "put" + | "post" + | "delete" + | "options" + | "head" + | "patch" + | "trace"; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/JsonType.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/JsonType.md new file mode 100644 index 0000000000..3e7cec9738 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/JsonType.md @@ -0,0 +1,14 @@ +--- +jsApi: true +title: "[T] JsonType" + +--- +```ts +type JsonType: + | "array" + | "boolean" + | "integer" + | "number" + | "object" + | "string"; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2OAuth2FlowType.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2OAuth2FlowType.md new file mode 100644 index 0000000000..48c9cf19d1 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2OAuth2FlowType.md @@ -0,0 +1,8 @@ +--- +jsApi: true +title: "[T] OpenAPI2OAuth2FlowType" + +--- +```ts +type OpenAPI2OAuth2FlowType: "implicit" | "password" | "application" | "accessCode"; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Operation.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Operation.md new file mode 100644 index 0000000000..a2ab01782e --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Operation.md @@ -0,0 +1,27 @@ +--- +jsApi: true +title: "[T] OpenAPI2Operation" + +--- +```ts +type OpenAPI2Operation: Extensions & Object; +``` + +## Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `consumes` | `string`[] | A list of MIME types the operation can consume. This overrides the consumes definition at the Swagger Object.
An empty value MAY be used to clear the global definition. Value MUST be as described under Mime Types. | +| `deprecated` | `boolean` | Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is false. | +| `description` | `string` | A verbose explanation of the operation behavior. Commonmark syntax can be used for rich text representation. | +| `externalDocs` | [`OpenAPI2ExternalDocs`](../interfaces/OpenAPI2ExternalDocs.md) | Additional external documentation. | +| `operationId` | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions. | +| `parameters` | [`Refable`](Refable.md)<[`OpenAPI2Parameter`](OpenAPI2Parameter.md)\>[] | A list of parameters that are applicable for this operation.
If a parameter is already defined at the Path Item, the new definition will override it, but can never remove it.
The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. | +| `produces` | `string`[] | A list of MIME types the operation can produce. This overrides the produces definition at the Swagger Object.
An empty value MAY be used to clear the global definition. Value MUST be as described under Mime Types. | +| `responses` | [`OpenAPI2Responses`](OpenAPI2Responses.md) | - | +| `schemes` | `string`[] | The transfer protocol for the operation. Values MUST be from the list: "http", "https", "ws", "wss". The value overrides the Swagger Object schemes definition. | +| `security` | [`OpenAPI2SecurityScheme`](OpenAPI2SecurityScheme.md)[] | declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used. | +| `summary` | `string` | A short summary of what the operation does. | +| `tags` | `string`[] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. | +| `x-ms-examples` | `Record`<`string`, [`Ref`](../interfaces/Ref.md)<`unknown`\>\> | - | +| `x-ms-long-running-operation` | `boolean` | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Parameter.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Parameter.md new file mode 100644 index 0000000000..061df39671 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Parameter.md @@ -0,0 +1,13 @@ +--- +jsApi: true +title: "[T] OpenAPI2Parameter" + +--- +```ts +type OpenAPI2Parameter: + | OpenAPI2BodyParameter + | OpenAPI2HeaderParameter + | OpenAPI2FormDataParameter + | OpenAPI2QueryParameter + | OpenAPI2PathParameter; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2ParameterType.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2ParameterType.md new file mode 100644 index 0000000000..c2102f9b94 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2ParameterType.md @@ -0,0 +1,8 @@ +--- +jsApi: true +title: "[T] OpenAPI2ParameterType" + +--- +```ts +type OpenAPI2ParameterType: OpenAPI2Parameter["in"]; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2PathItem.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2PathItem.md new file mode 100644 index 0000000000..39bf1e43ff --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2PathItem.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[T] OpenAPI2PathItem" + +--- +```ts +type OpenAPI2PathItem: { [method in HttpMethod]?: OpenAPI2Operation } & Object & Extensions; +``` + +Describes the operations available on a single path. A Path Item may be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#pathItemObject + +## Type declaration + +| Member | Type | +| :------ | :------ | +| `parameters` | [`OpenAPI2Parameter`](OpenAPI2Parameter.md)[] | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Responses.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Responses.md new file mode 100644 index 0000000000..e71ca5e6c9 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Responses.md @@ -0,0 +1,19 @@ +--- +jsApi: true +title: "[T] OpenAPI2Responses" + +--- +```ts +type OpenAPI2Responses: Object & Extensions; +``` + +An object to hold responses to be reused across operations. Response definitions can be referenced to the ones defined here. +This does not define global operation responses. + +Keys are the name for the response that it defines. + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#responses-definitions-object + +## Type declaration diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Schema.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Schema.md new file mode 100644 index 0000000000..81bbea2d55 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2Schema.md @@ -0,0 +1,43 @@ +--- +jsApi: true +title: "[T] OpenAPI2Schema" + +--- +```ts +type OpenAPI2Schema: Extensions & Object; +``` + +## Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `additionalProperties` | `boolean` \| [`Refable`](Refable.md)<[`OpenAPI2Schema`](OpenAPI2Schema.md)\> | indicates that additional unlisted properties can exist in this schema | +| `allOf` | [`Refable`](Refable.md)<[`OpenAPI2Schema`](OpenAPI2Schema.md)\>[] | Swagger allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model composition.
allOf takes in an array of object definitions that are validated independently but together compose a single object.
While composition offers model extensibility, it does not imply a hierarchy between the models.
To support polymorphism, Swagger adds the support of the discriminator field.
When used, the discriminator will be the name of the property used to decide which schema definition is used to validate the structure of the model.
As such, the discriminator field MUST be a required field. The value of the chosen property has to be the friendly name given to the model under the
definitions property. As such, inline schema definitions, which do not have a given id, cannot be used in polymorphism. | +| `default` | `string` \| `boolean` \| `number` \| `Record`<`string`, `unknown`\> | Declares the value of the property that the server will use if none is provided,
for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request.

**Note**
"default" has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter. | +| `description` | `string` | This attribute is a string that provides a full description of the schema | +| `discriminator` | `string` | Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema.
The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema
or any schema that inherits it. | +| `enum` | (`string` \| `number` \| `boolean`)[] | Restrict a value to a fixed set of values. It must be an array with at least one element, where each element is unique. | +| `exclusiveMaximum` | `boolean` | indicates that the maximum is exclusive of the number given | +| `exclusiveMinimum` | `boolean` | indicates that the minimum is exclusive of the number given | +| `format` | `string` | The extending format for the previously mentioned type. | +| `items` | [`Refable`](Refable.md)<[`OpenAPI2Schema`](OpenAPI2Schema.md)\> | Describes the type of items in the array. | +| `maxItems` | `number` | An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. | +| `maxLength` | `number` | A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. | +| `maxProperties` | `number` | An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. | +| `maximum` | `number` | the maximum value for the property

if "exclusiveMaximum" is not present, or has boolean value false, then the instance is valid if it is lower than, or equal to, the value of "maximum";

if "exclusiveMaximum" has boolean value true, the instance is valid if it is strictly lower than the value of "maximum". | +| `minItems` | `number` | An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword. | +| `minLength` | `number` | A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. | +| `minProperties` | `number` | An object instance is valid against "minProperties" if its number of properties is greater than, or equal to, the value of this keyword. | +| `minimum` | `number` | the minimum value for the property

if "exclusiveMinimum" is not present, or has boolean value false, then the instance is valid if it is greater than, or equal to, the value of "minimum";

if "exclusiveMinimum" has boolean value true, the instance is valid if it is strictly greater than the value of "minimum". | +| `pattern` | `string` | A string instance is considered valid if the regular expression matches the instance successfully. | +| `properties` | `Record`<`string`, [`OpenAPI2SchemaProperty`](OpenAPI2SchemaProperty.md)\> | This attribute is an object with property definitions that define the
valid values of instance object property values. When the instance
value is an object, the property values of the instance object MUST
conform to the property definitions in this object. In this object,
each property definition's value MUST be a schema, and the property's
name MUST be the name of the instance property that it defines. The
instance property value MUST be valid according to the schema from
the property definition. Properties are considered unordered, the
order of the instance properties MAY be in any order. | +| `readOnly` | `boolean` | Relevant only for Schema "properties" definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT
be sent as part of the request. Properties marked as readOnly being true SHOULD NOT be in the required list of the defined schema. Default value is false. | +| `required` | `string`[] | A list of property names that are required to be sent from the client to the server. | +| `title` | `string` | This attribute is a string that provides a short description of the schema. | +| `type` | [`JsonType`](JsonType.md) | The JSON type for the schema | +| `uniqueItems` | `boolean` | if this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique. | +| `x-ms-enum` | `Object` | - | +| `x-ms-enum.modelAsString` | `boolean` | If the enum should be extensible. | +| `x-ms-enum.name` | `string` | Name of the enum. | +| `x-ms-enum.values` | `Object`[] | Provide alternative name and description for enum values. | +| `x-ms-mutability` | `string`[] | - | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaProperty.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaProperty.md new file mode 100644 index 0000000000..60eb834355 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaProperty.md @@ -0,0 +1,8 @@ +--- +jsApi: true +title: "[T] OpenAPI2SchemaProperty" + +--- +```ts +type OpenAPI2SchemaProperty: OpenAPI2SchemaRefProperty | OpenAPI2Schema; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaRefProperty.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaRefProperty.md new file mode 100644 index 0000000000..01dd1eb8ea --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SchemaRefProperty.md @@ -0,0 +1,16 @@ +--- +jsApi: true +title: "[T] OpenAPI2SchemaRefProperty" + +--- +```ts +type OpenAPI2SchemaRefProperty: Ref & Pick & Object; +``` + +Autorest allows a few properties to be next to $ref of a property. + +## Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `x-ms-client-name` | `string` | Provide a different name to be used in the client. | diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityRequirement.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityRequirement.md new file mode 100644 index 0000000000..62bbded080 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityRequirement.md @@ -0,0 +1,16 @@ +--- +jsApi: true +title: "[T] OpenAPI2SecurityRequirement" + +--- +```ts +type OpenAPI2SecurityRequirement: Record; +``` + +Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes). + +The name used for each property MUST correspond to a security scheme declared in the Security Definitions. + +## See + +/https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-requirement-object diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityScheme.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityScheme.md new file mode 100644 index 0000000000..be86a0691e --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2SecurityScheme.md @@ -0,0 +1,20 @@ +--- +jsApi: true +title: "[T] OpenAPI2SecurityScheme" + +--- +```ts +type OpenAPI2SecurityScheme: + | OpenAPI2BasicAuthenticationSecurityScheme + | OpenAPI2OAuth2AccessCodeSecurityScheme + | OpenAPI2OAuth2ApplicationSecurityScheme + | OpenAPI2OAuth2ImplicitSecurityScheme + | OpenAPI2OAuth2PasswordSecurityScheme + | OpenAPI2ApiKeySecurityScheme; +``` + +Allows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code). + +## See + +https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#security-scheme-object diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2StatusCode.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2StatusCode.md new file mode 100644 index 0000000000..38f707388f --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/OpenAPI2StatusCode.md @@ -0,0 +1,15 @@ +--- +jsApi: true +title: "[T] OpenAPI2StatusCode" + +--- +```ts +type OpenAPI2StatusCode: + | string + | "default" + | "1XX" + | "2XX" + | "3XX" + | "4XX" + | "5XX"; +``` diff --git a/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Refable.md b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Refable.md new file mode 100644 index 0000000000..72ca8677b4 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/emitters/typespec-autorest/reference/js-api/type-aliases/Refable.md @@ -0,0 +1,14 @@ +--- +jsApi: true +title: "[T] Refable" + +--- +```ts +type Refable: Ref | T; +``` + +## Type parameters + +| Type parameter | +| :------ | +| `T` | diff --git a/packages/website/versioned_docs/version-latest/getstarted/azure-core/step04.md b/packages/website/versioned_docs/version-latest/getstarted/azure-core/step04.md index 1aab64233e..c8f8ff626d 100644 --- a/packages/website/versioned_docs/version-latest/getstarted/azure-core/step04.md +++ b/packages/website/versioned_docs/version-latest/getstarted/azure-core/step04.md @@ -1,8 +1,12 @@ # 4. Defining your first resource -Now we're ready to describe our first resource type. A "resource" is a model type that represents a fundamental type in the domain model of your service. +In the context of your service, a "resource" is a fundamental entity that your service manages. For our `WidgetService`, the most basic entity we need is a `Widget`. -For our `WidgetService`, the most obvious model type that we will need is called `Widget`. We can create it by creating a `model` that is annotated with the `@resource` decorator. Add the following lines after the top-level `namespace` declaration: +To create a `Widget`, we need to define a `model` and annotate it with the `@resource` decorator. + +## Code implementation + +After the top-level `namespace` declaration, add the following lines: ```typespec @doc("A widget.") @@ -18,11 +22,13 @@ model Widget { } ``` -There are a few important things to point out here: +## Code explanation + +Here are some important points about the code: -- The `Widget` model has a `@resource` decorator with a parameter of `"widgets"`. This string is the "collection name" of the resource and affects where the resource appears in the service URI layout. -- The `name` property has a `@key` decorator with a parameter of `"widgetName"`. This string customizes the name of the path parameter (and the parameter name itself) in operations that use this resource type. There _must_ be one property with a `@key` decorator on all resource types! -- The `@visibility("read")` decorator on the `name` property says that the `name` property should only appear in operation responses but not in operations that allow you to change properties of the `Widget` resource. -- We use `@doc` decorators on the model type and all properties to describe. Documentation strings are enforced by linting rule when authoring specs with `Azure.Core`! +- The `Widget` model has a `@resource` decorator with a parameter of `"widgets"`. This string is the "collection name" of the resource and it determines where the resource appears in the service URI layout. +- The `name` property has a `@key` decorator with a parameter of `"widgetName"`. This string customizes the name of the path parameter (and the parameter name itself) in operations that use this resource type. Note that there _must_ be one property with a `@key` decorator on all resource types! +- The `@visibility("read")` decorator on the `name` property indicates that the `name` property should only appear in operation responses, not in operations that allow you to change properties of the `Widget` resource. +- We use `@doc` decorators on the model type and all properties for description. Documentation strings are enforced by linting rule when authoring specs with `Azure.Core`! -Great, now we have a resource type! Now, how do we define operations for this resource? +Now that we have a resource type, the next step is to define operations for this resource. diff --git a/packages/website/versioned_docs/version-latest/getstarted/createproject.md b/packages/website/versioned_docs/version-latest/getstarted/createproject.md index 899ae5509e..4d49398765 100644 --- a/packages/website/versioned_docs/version-latest/getstarted/createproject.md +++ b/packages/website/versioned_docs/version-latest/getstarted/createproject.md @@ -1,43 +1,43 @@ -# Creating a new project +# Creating a project -If you installed TypeSpec on your local machine, here is how you can create a new TypeSpec project: +If you've installed TypeSpec on your local machine, you can create a new TypeSpec project by following these steps: -First, open your command prompt (PowerShell, cmd.exe, bash, etc), create an empty folder for your new project, and cd into it. If creating a new service in the [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) repository, create the new service folder following our [directory structure guidelines](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/typespec-structure-guidelines.md). - -Now create a new Azure service specification using the tsp init command: +1. **Open your command prompt** (PowerShell, cmd.exe, bash, etc.), create an empty folder for your new project, and `cd` into it. +2. If creating a new service in the [Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) repository, create the new service folder following our [directory structure guidelines](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/typespec-structure-guidelines.md). +3. To create a new Azure service specification, use the `tsp init` command: ```bash tsp init https://aka.ms/typespec/azure-init - ``` -You will be prompted with a few questions: +You will be prompted with a few questions regarding the service template, project name, and library updates. -- The service template: choose between "Azure Data Plane Service", "Azure Resource Manager Service" -- The project name: Enter a name to be used as the project folder name or press enter to use the same name as the folder you created -- Update the libraries: Press Enter to continue with the selected packages +### Understanding Project Templates -The prompts will look something like this: +When initializing a new project, you'll encounter four templates: -```bash -TypeSpec compiler v0.34.0 +| Template Name | Description | +| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **(rest-api-spec repo) Azure Data Plane Service Project** | This template is configured for projects within the `azure-rest-api-specs` repository, with settings that comply with the repo's requirements, such as file paths and linting rules. | +| **(rest-api-spec repo) Azure Resource Manager Service Project** | Similar to the above, but tailored for Azure Resource Manager services within the `azure-rest-api-specs` repository. | +| **(standalone) Azure Data Plane Service Project** | This template is configured for local use or in a personal repo, allowing for API development without the specific directory structure of the `azure-rest-api-specs` repo. | +| **(standalone) Azure Resource Manager Service Project** | Similar to the above but designed for Azure Resource Manager services, configured for local use or in a personal repo. | -√ Please select a template » Azure Data Plane Service -√ Project name ... myService -√ Update the libraries? » @typespec/rest, @typespec/versioning, @azure-tools/typespec-autorest, @azure-tools/typespec-azure-core -TypeSpec init completed. -``` +### Target Users -You can run `tsp install` now to install dependencies. -Once your project files have been created, execute the following command to install the TypeSpec compiler and libraries: +- **Rest-API-Spec Repo Projects**: Ideal for those contributing directly to the Azure REST API specifications, ensuring production-quality SDK generation. +- **Standalone Projects**: Suited for API-first development, allowing users to generate OpenAPI specs, service code, and clients without conforming to the specs repo's structure. -```bash -tsp install -``` +### Install the dependencies + +Now that the new project has been created, you can install the dependencies by running the following command: + +- `npm ci` - If in the `azure-rest-api-specs` repo. +- `tsp install` - If a standalone project -You can now open the file `main.tsp` to follow along with the rest of the tutorial! +After setting up your project, run `tsp install` to install dependencies. You can then open the file `main.tsp` to continue with the tutorial. Choose the tutorial that matches your chosen project template: | Azure Service Type | Tutorial | Produces | | ------------------------ | --------------------------------------------- | -------------------------- | -| Azure Data-Plane Service | [Azure-Core tutorial](azure-core/step02) | OpenApi 2.0 (Swagger) spec | +| Azure Data-Plane Service | [Azure-Core tutorial](azure-core/step01) | OpenApi 2.0 (Swagger) spec | | Azure Management Service | [ARM tutorial](azure-resource-manager/step00) | OpenApi 2.0 (Swagger) spec | diff --git a/packages/website/versioned_docs/version-latest/getstarted/installation.md b/packages/website/versioned_docs/version-latest/getstarted/installation.md index 511f13ec8b..4b1867df35 100644 --- a/packages/website/versioned_docs/version-latest/getstarted/installation.md +++ b/packages/website/versioned_docs/version-latest/getstarted/installation.md @@ -7,16 +7,14 @@ You can try TypeSpec on the web without installing anything. - [TypeSpec playground](https://aka.ms/trytypespec) - [TypeSpec playground for Azure services](https://azure.github.io/typespec-azure/playground) -### Installing TypeSpec core toolset +## Installing TypeSpec core toolset -See https://typespec.io/docs +See https://typespec.io/docs to install the base requirements for working with TypeSpec: -## Installing TypeSpec Azure toolsets +- NodeJS +- Typespec CLI +- VSCode or VS extension -To work on Azure with TypeSpec, you should pre-install `@azure-tools/typespec-azure-core` to define Azure resources, and `@azure-tools/typespec-autorest` to export in Swagger. In other words: +## Create an Azure TypeSpec project -```bash -npm install @typespec/rest @typespec/openapi3 @azure-tools/typespec-azure-core @azure-tools/typespec-autorest -``` - -> If you plan to use the output openapi with autorest or any of the azure sdk tooling _you should use typespec-autorest_, the openapi3 emitter is not going to have any of the ms extensions (pageable, lro, client name, etc.) and so it will be losing information. +[See next doc](./createproject.md) diff --git a/packages/website/versioned_docs/version-latest/howtos/ARM/resource-type.md b/packages/website/versioned_docs/version-latest/howtos/ARM/resource-type.md index d80ee2a22c..05c5228a21 100644 --- a/packages/website/versioned_docs/version-latest/howtos/ARM/resource-type.md +++ b/packages/website/versioned_docs/version-latest/howtos/ARM/resource-type.md @@ -225,11 +225,29 @@ model EmployeeResource is TrackedResource { name: string; } -enum EmployeeProvisioningState { - Creating, - GeneratingId, - ...ResourceProvisioningState, - Deleting, +union EmployeeProvisioningState { + string, + + /** The resource create request has been accepted */ + Accepted: "Accepted", + + /** The resource is being provisioned */ + Provisioning: "Provisioning", + + /** The resource is updating */ + Updating: "Updating", + + /** Resource has been created. */ + Succeeded: "Succeeded", + + /** Resource creation failed. */ + Failed: "Failed", + + /** Resource creation was canceled. */ + Canceled: "Canceled", + + /** The resource is being deleted */ + Deleting: "Deleting", } @minValue(50) diff --git a/packages/website/versioned_docs/version-latest/howtos/Azure Core/long-running-operations.md b/packages/website/versioned_docs/version-latest/howtos/Azure Core/long-running-operations.md index a8a557b47e..ef00a55de4 100644 --- a/packages/website/versioned_docs/version-latest/howtos/Azure Core/long-running-operations.md +++ b/packages/website/versioned_docs/version-latest/howtos/Azure Core/long-running-operations.md @@ -110,12 +110,12 @@ A StatusMonitor provides information that drives client polling until an operati | Decorator | Value | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `@lroStatus` | A decorator marking the field of the StatusMonitor that contains status information. This field should use an `enum` type to specify terminal status values. | +| `@lroStatus` | A decorator marking the field of the StatusMonitor that contains status information. This field should use a `union` type to specify terminal status values. | | `@lroResult` | A decorator marking the property of the Status monitor that contains the result of the operation, when the operation completes successfully. By default, any field named 'result' in a StatusMonitor is assumed to contain the result of a successful operation. | | `@lroErrorResult` | A decorator marking the property of the Status monitor that contains errors when the operation is unsuccessful. By default, any field named 'error' in a StatusMonitor is assumed to contain the result of a successful operation. | -| `@lroSucceeded` | If a status monitor uses a value other than `Succeeded` to indicate operation termination with success, then the enum value corresponding to successful completion should be decorated with this decorator. | -| `@lroCanceled` | If a status monitor uses a value other than `Canceled` to indicate that the operation was cancelled, then the enum value corresponding to cancellation should be decorated with this decorator. | -| `@lroFailed` | If a status monitor uses a value other than `Failed` to indicate operation termination with failure, then the enum value corresponding to operation failure should be decorated with this decorator. | +| `@lroSucceeded` | If a status monitor uses a value other than `Succeeded` to indicate operation termination with success, then the variant corresponding to successful completion should be decorated with this decorator. | +| `@lroCanceled` | If a status monitor uses a value other than `Canceled` to indicate that the operation was cancelled, then the variant corresponding to cancellation should be decorated with this decorator. | +| `@lroFailed` | If a status monitor uses a value other than `Failed` to indicate operation termination with failure, then the variant corresponding to operation failure should be decorated with this decorator. | | `@pollingOperationParameter` | Indicates which request parameters or response properties of an operation can be used to call the operation that retrieves lro status (Status Monitor). Each application of the decorator may reference or name the corresponding parameter in the `getStatus` operation. | ### Examples of common (non-standard) Lro Patterns @@ -133,17 +133,19 @@ In this example, the Status Monitor terminal properties for "Succeeded", "Failed ```tsp @lroStatus -enum OperationStatus { - Running, +union OperationStatus { + Running: "Running", @lroSucceeded - Completed, + Completed: "Completed", @lroCanceled - Aborted, + Aborted: "Aborted", @lroFailed - Faulted, + Faulted: "Faulted", + + string, } model StatusMonitor { @@ -249,11 +251,12 @@ In this example, the operation returns a `location` header with a link to the St ```tsp @lroStatus -enum OperationStatus { - Running, - Succeeded, - Canceled, - Failed, +union OperationStatus { + Running: "Running", + Succeeded: "Succeeded", + Canceled: "Canceled", + Failed: "Failed", + string, } model StatusMonitor { @@ -316,11 +319,12 @@ In this example, the operation returns a `Azure-AsyncOperation` header with a li ```tsp @lroStatus -enum OperationStatus { - Running, - Succeeded, - Canceled, - Failed, +union OperationStatus { + Running: "Running", + Succeeded: "Succeeded", + Canceled: "Canceled", + Failed: "Failed", + string, } model StatusMonitor { @@ -384,11 +388,12 @@ In this example, the operation returns a link to the Status Monitor (in `Azure-A ```tsp @lroStatus -enum OperationStatus { - Running, - Succeeded, - Canceled, - Failed, +union OperationStatus { + Running: "Running", + Succeeded: "Succeeded", + Canceled: "Canceled", + Failed: "Failed", + string, } model StatusMonitor { @@ -464,11 +469,12 @@ In this example, the operation does not return a link, instead, the request para ```tsp @lroStatus -enum OperationStatus { - Running, - Succeeded, - Canceled, - Failed, +union OperationStatus { + Running: "Running", + Succeeded: "Succeeded", + Canceled: "Canceled", + Failed: "Failed", + string, } model StatusMonitor { diff --git a/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/06types.mdx b/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/06types.mdx index 93b2f173cc..dfeb622952 100644 --- a/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/06types.mdx +++ b/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/06types.mdx @@ -5,6 +5,746 @@ import TabItem from "@theme/TabItem"; This page documents what type definitions in TypeSpec are generated as in emitted libraries +## Models + +### Flattening + +> **NOTE:** Flattening is NOT a recommended pattern, and you shouldn't use it unless told by SDK architects. + + + + +```typespec +model Properties { + name: string; +} + +model Foo { + @flattenProperty + prop: Properties; +} +``` + + + + +```json +{ + "kind": "model", + "name": "Foo", + "properties": [ + { + "kind": "property", + "name": "prop", + "serializedName": "prop", + "flatten": true, + "optional": false, + "nullable": false, + "type": { + "kind": "model", + "name": "Properties", + "properties": [ + { + "kind": "property", + "name": "name", + "serializedName": "name", + "flatten": false, + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + } + ] + } + } + ] +} +``` + + + + +Python will do dynamic flattening, exposing the non-flattening syntax, and dynamically accepting the flattened access. + +```python +class Properties(_model_base.Model): + name: str = rest_field() + """Required.""" + +class Foo(_model_base.Model): + properties: "_models.Properties" = rest_field() + """Required.""" + + __flattened_items = ["properties"] + +print(f.properties.name) # Non-flattened access is preferred experience +print(f.name) # Flattened access is dynamically supported, but not documented + +``` + + + + +```csharp +// Please note that this feature is not supported right now, and the model will be generated un-flattened. +// Please comment and follow work status on: https://github.com/Azure/autorest.csharp/issues/4040 +``` + + + + +```typescript +// Please note that this feature is not supported right now, and the model will be generated un-flattened. +// Please comment and follow work status on: https://github.com/Azure/autorest.typescript/issues/2164 +``` + + + + +In Java, `@flattenProperty` have no effect on data-plane libraries. + +```java +@Fluent +public final class Properties { + public Properties(); + public String getName(); + public Properties setName(String name); +} +``` + + + + +### Models with additional properties + +#### Additional properties of any type + + + + +Recommend usage: + +```typespec +model Animal { + name: string; + kind: string; + ...Record; +} +``` + +Other usages: + +```typespec +model Animal extends Record { + name: string; + kind: string; +} +``` + +```typespec +model Animal is Record { + name: string; + kind: string; +} +``` + + + + +```json +{ + "kind": "model", + "name": "Animal", + "properties": [ + { + "kind": "property", + "name": "name", + "serializedName": "name", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + }, + { + "kind": "property", + "name": "kind", + "serializedName": "kind", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + } + ], + "additionalProperties": { + "kind": "any" + }, + "additionalPropertiesNullable": false +} +``` + + + + +Python DPG model is original designed to support adding any additional properties. + +```python +from .. import _model_base +from .._model_base import rest_field + +class Animal(_model_base.Model): + + name: str = rest_field() + kind: str = rest_field() + +animal = Animal(name="Tom", kind="Cat") +animal["friend"] = "Jerry" +animal["age"] = 5 +``` + + + + +```csharp +public partial class Animal : IJsonModel { + public Animal(string name, string kind); + + public string Name { get; } + public string Kind { get; } + + public IDictionary AdditionalProperties { get; } +} +``` + + + + +```ts +// RLC input +export interface Animal extends Record { + name: string; + kind: string; +} + +// RLC output +export interface AnimalOutput extends Record { + name: string; + kind: string; +} + +// Modular for both legacy and non legacy +export interface Animal extends Record { + name: string; + kind: string; +} +``` + + + + +```java +@Fluent +public final class Animal implements JsonSerializable { + public Animal(String name, String kind); + public String getName(); + public String getKind(); + public Map getAdditionalProperties(); + public Animal setAdditionalProperties(Map additionalProperties); +} +``` + + + + +#### Additional properties of specific type + + + + +```typespec +model AnimalProperty { + category: string; + value: unknown; +} + +model Animal { + name: string; + kind: string; + ...Record; +} +``` + + + + +```json +{ + "kind": "model", + "name": "Animal", + "properties": [ + { + "kind": "property", + "name": "name", + "serializedName": "name", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + }, + { + "kind": "property", + "name": "kind", + "serializedName": "kind", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + } + ], + "additionalProperties": { + "kind": "model", + "name": "AnimalProperty", + "properties": [ + { + "kind": "property", + "name": "category", + "serializedName": "category", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + }, + { + "kind": "property", + "name": "value", + "serializedName": "value", + "optional": false, + "nullable": false, + "type": { + "kind": "any" + } + } + ], + "additionalProperties": undefined, + "additionalPropertiesNullable": undefined + }, + "additionalPropertiesNullable": false +} +``` + + + + +Python DPG model is original designed to support adding any additional properties. + +```python +from typing import Any +from .. import _model_base +from .._model_base import rest_field + +class Animal(_model_base.Model): + + name: str = rest_field() + kind: str = rest_field() + +class AnimalProperty(_model_base.Model): + + category: str = rest_field() + value: Any = rest_field() + +animal = Animal(name="Tom", kind="Cat") +animal["friend"] = AnimalProperty(category="relationship", value="Jerry") +animal["age"] = AnimalProperty(category="attribute", value=5) +``` + + + + +Due to currently there is no way to know whether a Json could be correctly mapped into the specified type in `.Net`, we currently generate any non-primitive value type in additional properties property as `BinaryData`. + +For typespec: + +```typespec +model Animal { + name: string; + kind: string; + ...Record; +} +``` + +The `C#` generated code is the same as if the type is `unknown`: + +```csharp +public partial class Animal : IJsonModel +{ + public Animal(string name, string kind); + + public string Name { get; } + public string Kind { get; } + + public IDictionary AdditionalProperties { get; } +} +``` + +For typespec with additional properties of primitive types: + +```typespec +model Animal { + name: string; + kind: string; + ...Record; +} +``` + +The `C#` generated code still has the specified type in `AdditionalProperties` property: + +```csharp +public partial class Animal : IJsonModel +{ + public Animal(string name, string kind); + + public string Name { get; } + public string Kind { get; } + + public IDictionary AdditionalProperties { get; } +} +``` + + + + +```ts +// RLC input +export interface AnimalProperty { + category: string; + value: unknown; +} +export interface Animal extends Record { + name: string; + kind: string; +} + +// RLC output +export interface AnimalProperty { + category: string; + value: any; +} +export interface Animal extends Record { + name: string; + kind: string; +} + +// Modular for legacy clients +export interface AnimalProperty { + category: string; + value: any; +} +export interface Animal extends Record { + name: string; + kind: string; +} + +// Modular for non-legacy clients +export interface AnimalProperty { + category: string; + value: any; +} +export interface Animal { + name: string; + kind: string; + additionalProperties: Record; +} +``` + + + + +```java +@Fluent +public final class Animal implements JsonSerializable { + public Animal(String name, String kind); + public String getName(); + public String getKind(); + public Map getAdditionalProperties(); + public Animal setAdditionalProperties(Map additionalProperties); +} + +``` + + + + +#### Additional properties of union type + + + + +```typespec +model Animal { + name: string; + kind: string; + ...Record; +} +``` + +```typespec +model Animal { + name: string; + kind: string; + ...Record; + ...Record; +} +``` + + + + +```json +{ + "kind": "model", + "name": "Animal", + "properties": [ + { + "kind": "property", + "name": "name", + "serializedName": "name", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + }, + { + "kind": "property", + "name": "kind", + "serializedName": "kind", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + } + ], + "additionalProperties": { + "kind": "union", + "name": "AnimalAdditionalProperty", + "generatedName": true, + "values": [ + { + "kind": "string", + "encode": "string" + }, + { + "kind": "int32" + } + ] + }, + "additionalPropertiesNullable": false +} +``` + + + + +Python DPG model is original designed to support adding any additional properties. + +```python +from .. import _model_base +from .._model_base import rest_field + +class Animal(_model_base.Model): + + name: str = rest_field() + kind: str = rest_field() + +animal = Animal(name="Tom", kind="Cat") +animal["friend"] = "Jerry" +animal["age"] = 5 +``` + + + + +```csharp +public partial class Animal : IJsonModel +{ + public Animal(string name, string kind); + + public string Name { get; } + public string Kind { get; } + + public IDictionary AdditionalProperties { get; } +} +``` + + + + +```ts +// RLC input and output +export interface Animal extends Record { + name: string; + kind: string; +} + +// Modular for legacy and non-legacy clients +export interface Animal extends Record { + name: string; + kind: string; +} +``` + + + + +```java +@Fluent +public final class Animal implements JsonSerializable { + public Animal(String name, String kind); + public String getName(); + public String getKind(); + public Map getAdditionalProperties(); + public Animal setAdditionalProperties(Map additionalProperties); +} +``` + + + + +#### Additional properties of nullable type + + + + +```typespec +model Animal { + name: string; + kind: string; + ...Record; +} +``` + + + + +```json +{ + "kind": "model", + "name": "Animal", + "properties": [ + { + "kind": "property", + "name": "name", + "serializedName": "name", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + }, + { + "kind": "property", + "name": "kind", + "serializedName": "kind", + "optional": false, + "nullable": false, + "type": { + "kind": "string", + "encode": "string" + } + } + ], + "additionalProperties": { + "kind": "string" + }, + "additionalPropertiesNullable": true +} +``` + + + + +Python DPG model is original designed to support adding any additional properties. + +```python +from .. import _model_base +from .._model_base import rest_field + +class Animal(_model_base.Model): + + name: str = rest_field() + kind: str = rest_field() + +animal = Animal(name="Tom", kind="Cat") +animal["friend"] = "Jerry" +animal["alert"] = None +``` + + + + +```csharp +public partial class Animal : IJsonModel +{ + public Animal(string name, string kind); + + public string Name { get; } + public string Kind { get; } + + public IDictionary AdditionalProperties { get; } +} +``` + + + + +```ts +// RLC input and output +export interface Animal extends Record { + name: string; + kind: string; +} + +// Modular for legacy and non-legacy clients +export interface Animal extends Record { + name: string; + kind: string; +} +``` + + + + + +```java +@Fluent +public final class Animal implements JsonSerializable { + public Animal(String name, String kind); + public String getName(); + public String getKind(); + public Map getAdditionalProperties(); + public Animal setAdditionalProperties(Map additionalProperties); +} + +``` + + + + ## Unions ### Union of literals with same type @@ -320,8 +1060,7 @@ model Widget { -Python generates a union of literals again. Since we always generate our typing as open, this will -look the same as our previous example where we generate an open union of strings. +Python generates a union of literals again. ```python from typing import Literal, Union @@ -390,7 +1129,7 @@ For union of other union or enum. TCGC will do the flatten according to the flag With `flatten-union-as-enum` flagged `true`: -````json +```json { "kind": "enum", "name": "ProvisioningState", @@ -421,8 +1160,9 @@ With `flatten-union-as-enum` flagged `true`: } ], "isFixed": false, - "isUnionAsEnum": true, + "isUnionAsEnum": true } +``` With `flatten-union-as-enum` flagged `false`: @@ -471,7 +1211,7 @@ With `flatten-union-as-enum` flagged `false`: } ] } -```` +``` @@ -483,7 +1223,7 @@ from enum import Enum from corehttp.utils import CaseInsensitiveEnumMeta class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - IN_PROGRESS = "inProgress" + INPROGRESS = "InProgress" SUCCEEDED = "Succeeded" FAILED = "Failed" CANCELED = "Canceled" @@ -498,7 +1238,7 @@ public readonly partial struct ProvisioningState : IEquatable private const string SucceededValue = "Succeeded"; private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; - private const string InProgressValue = "inProgress"; + private const string InProgressValue = "InProgress"; public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); @@ -513,7 +1253,7 @@ public readonly partial struct ProvisioningState : IEquatable ```typescript export type ResourceProvisioningState = "Succeeded" | "Failed" | "Canceled"; // NOTE: extensible enum design may change in JS -export type ProvisioningState = string | "inProgress" | ResourceProvisioningState; +export type ProvisioningState = string | "InProgress" | ResourceProvisioningState; ``` @@ -521,7 +1261,7 @@ export type ProvisioningState = string | "inProgress" | ResourceProvisioningStat ```java public final class ProvisioningState extends ExpandableStringEnum { - public static final ProvisioningState IN_PROGRESS = fromString("inProgress"); + public static final ProvisioningState INPROGRESS = fromString("InProgress"); public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); public static final ProvisioningState FAILED = fromString("Failed"); public static final ProvisioningState CANCELED = fromString("Canceled"); @@ -559,7 +1299,7 @@ For union of other union or enum. TCGC will do the flatten according to the flag With `flatten-union-as-enum` flagged `true`: -````json +```json { "kind": "enum", "name": "Orientation", @@ -590,8 +1330,9 @@ With `flatten-union-as-enum` flagged `true`: } ], "isFixed": true, - "isUnionAsEnum": true, + "isUnionAsEnum": true } +``` With `flatten-union-as-enum` flagged `false`: @@ -647,7 +1388,7 @@ With `flatten-union-as-enum` flagged `false`: } ] } -```` +``` @@ -727,7 +1468,7 @@ For union of other union or enum. TCGC will do the flatten according to the flag With `flatten-union-as-enum` flagged `true`: -````json +```json { "kind": "enum", "name": "WidgetOrientations", @@ -758,8 +1499,9 @@ With `flatten-union-as-enum` flagged `true`: } ], "isFixed": true, - "isUnionAsEnum": true, + "isUnionAsEnum": true } +``` With `flatten-union-as-enum` flagged `false`: @@ -815,7 +1557,7 @@ With `flatten-union-as-enum` flagged `false`: } ] } -```` +``` diff --git a/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/08methodInputs.mdx b/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/08methodInputs.mdx new file mode 100644 index 0000000000..72489f1649 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/howtos/DataPlane Generation - DPG/08methodInputs.mdx @@ -0,0 +1,775 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Method Inputs + +This doc details what method input signatures language emitters will output. + +## Basic + +### HTTP Get + + + + +```typespec +@get +op get(): User; +``` + + + + + +```python +def get() -> User: + ... +``` + + + + +```csharp +//protocol method +public virtual async Task GetUserAsync(RequestContext context){} +public virtual Response GetUser(RequestContext context){} +//convenience method +public virtual async Task> GetUser(CancellationToken cancellationToken = default) +public virtual Response GetUser(CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +// RLC +export interface GetUser200Response extends HttpResponse { + status: "200"; + body: User; +} + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/analyze' has methods for the following verbs: post */ + (path: "/users"): { + get( + options: RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function get(): Promise; + +// Modular classical client layer +export class DemoServiceClient { + get(options: GetUserOptionalParams): Promise; +} +``` + + + + +```java +public User get(); +``` + + + + +```go + +``` + + + + +### HTTP Post + + + + +```typespec +@post +op post(@body body: User): void; +``` + + + + + +For model inputs, Python automatically generates an overload that allows SDK users to input through a file stream. + +```python +@overload +def post(body: User, **kwargs: Any) -> None: + ... + +@overload +def post(body: JSON, **kwargs: Any) -> None: + ... + +@overload +def post(body: IO[bytes], **kwargs: Any) -> None: + ... + +def post(body: [User, JSON, IO[bytes]], **kwargs: Any) -> None: + ... +``` + + + + +```csharp +//protocol method +public virtual async Task PostAsync(RequestContent content, RequestContext context = null) +public virtual Response Post(RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task PostAsync(User user, CancellationToken cancellationToken = default) +public virtual Response Post(User user, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/users"): { + post( + options: { + body: User; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function post(body: User, options: PostOptionalParams): Promise; + +// Modular classical client layer +export class DemoServiceClient { + post(body: User, options: PostOptionalParams): Promise; +} +``` + + + + +```java +public void post(User user); +``` + + + + +```go + +``` + + + + +## Spread + +Please use the _spread_ feature with caution. + +- The anonymous model to be spread into operation should have less than 6 settable properties. See [simple methods](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-parameters). +- The anonymous model should be stable across api-versions. Adding an optional property across api-versions could result in one additional method overload in SDK client. +- The anonymous model should not be used in [JSON Merge Patch](https://datatracker.ietf.org/doc/html/rfc7386). + +### Alias + + + + +```typespec +alias User = { + firstName: string; + lastName: string; +}; + +@post +op upload(...User): void; +``` + + + + + +For Python, we will also generate the overloads described in the Http Post section, but omitting for brevity + +```python +def upload(first_name: str, last_name: str) -> None: + ... +``` + + + + +```csharp +//protocol method +public virtual async Task UploadAsync(RequestContent content, RequestContext context = null) +public virtual Response Upload(RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task UploadAsync(string firstName, string lastName, CancellationToken cancellationToken = default) +public virtual Response Upload(string firstName, string lastName, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/users"): { + post( + options: { + body: { + firstName: string; + lastName: string; + }; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function upload( + firstName: string, + lastName: string, + options: UploadOptionalParams +): Promise; + +// Modular classical client layer +export class DemoServiceClient { + upload(firstName: string, lastName: string, options: UploadOptionalParams): Promise; +} +``` + + + + +```java +public void upload(String firstName, String lastName); +``` + + + + +```go + +``` + + + + +### Alias with HTTP Parameters + + + + +```typespec +alias User = { + @path id: string; + firstName: string; + lastName: string; +}; + +op upload(...User): void; +``` + + + + + +```python +def upload(id: str, first_name: str, last_name: str) -> None: + ... +``` + + + + +```csharp +//protocol method +public virtual async Task UploadAsync(string id, RequestContent content, RequestContext context = null) +public virtual Response Upload(string id, RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task UploadAsync(string id, string firstName, string lastName, CancellationToken cancellationToken = default) +public virtual Response Upload(string id, string firstName, string lastName, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + ( + path: "/users/{id}", + id + ): { + post( + options: { + body: { + firstName: string; + lastName: string; + }; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function upload( + id: string, + firstName: string, + lastName: string, + options: UploadOptionalParams +): Promise; + +// Modular classical client layer +export class DemoServiceClient { + upload( + id: string, + firstName: string, + lastName: string, + options: UploadOptionalParams + ): Promise; +} +``` + + + + +```java +public void upload(String id, String firstName, String lastName); +``` + + + + +```go + +``` + + + + +### Named model + + + + +```typespec +model User { + firstName: string; + lastName: string; +} + +op upload(...User): void; +``` + + + + +For Python, we will also generate the overloads described in the Http Post section, but omitting for brevity + +```python +def upload(self, user: [User, JSON, IO[bytes]], *, content_type: str = "application/json") -> None: + ... +``` + + + + +```csharp +public partial class User +{ + public User(string firstName, string lastName){} + public string FirstName { get; } + public string LastName { get; } +} +//protocol method +public virtual async Task UploadAsync(RequestContent content, RequestContext context = null) +public virtual Response Upload(RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task UploadAsync(User user, CancellationToken cancellationToken = default) +public virtual Response Upload(User user, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/users"): { + post( + options: { + body: User; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function upload(body: User, options: UploadOptionalParams): Promise; + +// Modular classical client layer +export class DemoServiceClient { + upload(body: User, options: UploadOptionalParams): Promise; +} +``` + + + + +```java +// Model class +@Immutable +public final class User implements JsonSerializable { + public User(String firstName, String lastName); + public String getFirstName(); + public String getLastName(); +} + +// Client API +public void upload(User user); +``` + + + + +```go + +``` + + + + +### Model with `@body` Property + + + + +```typespec +model User { + firstName: string; + lastName: string; +} + +model UserRequest { + @body user: User; +} + +op upload(...UserRequest): void; +``` + + + + + +For Python, we will also generate the overloads described in the Http Post section, but omitting for brevity + +```python +def upload(body: [User, JSON, IO[bytes]], **kwargs: Any) -> None: + ... +``` + + + + + +```csharp +public partial class User +{ + public User(string firstName, string lastName){} + public string FirstName { get; } + public string LastName { get; } +} +//protocol method +public virtual async Task UploadAsync(RequestContent content, RequestContext context = null) +public virtual Response Upload(RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task UploadAsync(User user, CancellationToken cancellationToken = default) +public virtual Response Upload(User user, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/users"): { + post( + options: { + body: User; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Api Layer +export async function upload(user: User, options: UploadOptionalParams): Promise; + +// Modular classical client layer +export class DemoServiceClient { + upload(user: User, options: UploadOptionalParams): Promise; +} +``` + + + + +```java +// Model class +@Immutable +public final class User implements JsonSerializable { + public User(String firstName, String lastName); + public String getFirstName(); + public String getLastName(); +} + +// Client API +public void upload(User user); +``` + + + + +```go + +``` + + + + +### Model with Decorated Properties + + + + +```typespec +model BlobProperties { + @path + name: string; + + @header testHeader: string; +} + +@route("blob_properties/{name}") +op getBlobProperties(...BlobProperties): void; +``` + + + + +For Python, we will also generate the overloads described in the Http Post section, but omitting for brevity + +```python + +def get_blob_properties(name: str, *, test_header: string, **kwargs: Any) -> None: + ... +``` + + + + +```csharp +//protocol method +public virtual async Task GetBlobPropertiesAsync(string name, string testHeader, RequestContext context = null) +public virtual Response GetBlobProperties(string name, string testHeader, RequestContext context = null) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/blob_properties/{name}", name): { + post( + options: { + headers: { + "test-header": string; + } & RawHttpHeaders + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular Options +export interface GetBlobPropertiesOptionalParams extends OperationOptions { + requestOptions: { + headers: { + test-header: string + } & RawHttpHeadersInput + } +} + +// Modular api layer +export async function getBlobProperties(name: string, options: GetBlobPropertiesOptionalParams): Promise; + +// Modular classical client layer +export class DemoServiceClient { + getBlobProperties(name: string, options: GetBlobPropertiesOptionalParams): Promise +} +``` + + + + +```java +public void getBlobProperties(String name, String testHeader); +``` + + + + +```go + +``` + + + + +### Model with Decorated and non-Decorated Properties + + + + +```typespec +model Schema { + @header contentType: "application/json"; + schema: bytes; +} + +@post +op register(...Schema): void; +``` + + + + +For Python, we will also generate the overloads described in the Http Post section, but omitting for brevity + +```python +class Schema: + schema: bytes + +def register(body: [Schema, JSON, IO[bytes]], **kwargs: Any) -> None: + ... +``` + + + + +```csharp +public partial class Schema +{ + public Schema(BinaryData schemaProperty){} + public BinaryData SchemaProperty { get; } +} +//protocol method +public virtual async Task RegisterAsync(RequestContent content, RequestContext context = null) +public virtual Response Register(RequestContent content, RequestContext context = null) +//convenience method +public virtual async Task RegisterAsync(Schema schema, CancellationToken cancellationToken = default) +public virtual Response Register(Schema schema, CancellationToken cancellationToken = default) +``` + + + + +```typescript +// from user experience perspective + +export type DemoServiceContext = Client & { + path: { + /** Resource for '/completions' has methods for the following verbs: post */ + (path: "/schemaRegister"): { + post( + options: { + headers: { + "content-type": "application/json"; + } & RawHttpHeaders; + body: { + schema: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; + }; + } & RequestParameters + ): StreamableMethod; + }; + }; +}; + +// Modular model +export interface Schema { + schema: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; +} + +// Modular api layer +export async function register( + body: Schema, + options: GetBlobPropertiesOptionalParams +): Promise; + +// Modular classical client layer +export class DemoServiceClient { + getBlobProperties(body: Schema, options: GetBlobPropertiesOptionalParams): Promise; +} +``` + + + + +```java +// Model class +@Immutable +public final class Schema implements JsonSerializable { + public Schema(byte[] schema); + public byte[] getSchema(); +} + +// Client API +public void register(Schema schema); +``` + + + + +```go + +``` + + + diff --git a/packages/website/versioned_docs/version-latest/howtos/migrate-swagger/x-ms-examples.md b/packages/website/versioned_docs/version-latest/howtos/migrate-swagger/x-ms-examples.md index 8b43a7ad84..70ec8ee552 100644 --- a/packages/website/versioned_docs/version-latest/howtos/migrate-swagger/x-ms-examples.md +++ b/packages/website/versioned_docs/version-latest/howtos/migrate-swagger/x-ms-examples.md @@ -5,7 +5,7 @@ title: x-ms-examples The `x-ms-examples` is automatically populated in the generated OpenAPI 2.0 when using the `typespec-autorest` emitter. The examples must be placed in the `examples-directory` (default to `{project-root}/examples`) and have the `operationdId` property. -:::warn +:::warning Do not use `@extension("x-ms-examples", "")`. ::: @@ -50,6 +50,6 @@ Note, latest OAV tool should automatically generate the following. However, if y - include `title` field and make sure it is descriptive and unique for each operation. - include `operationId`. This is used to match with declared operations in TypeSpec and correctly output in swagger. -:::warn +:::warning The examples are now in the examples directory relative to the output openapi.json. You must now copy them to the examples directory in the project root. The typespec-autorest emitter will then copy them back to the correct location when generating the OpenAPI 2.0. ::: diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-core/reference/linter.md b/packages/website/versioned_docs/version-latest/libraries/azure-core/reference/linter.md index ed61acf75c..65ab133690 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-core/reference/linter.md +++ b/packages/website/versioned_docs/version-latest/libraries/azure-core/reference/linter.md @@ -42,6 +42,7 @@ Available ruleSets: | `@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops` | The @route decorator should not be used on standard resource operation signatures. | | `@azure-tools/typespec-azure-core/no-fixed-enum-discriminator` | Discriminator shouldn't be a fixed enum. | | [`@azure-tools/typespec-azure-core/non-breaking-versioning`](/libraries/azure-core/rules/non-breaking-versioning.md) | Check that only backward compatible versioning change are done to a service. | +| [`@azure-tools/typespec-azure-core/no-generic-numeric`](/libraries/azure-core/rules/no-generic-numeric.md) | Don't use generic types. Use more specific types instead. | | `@azure-tools/typespec-azure-core/no-nullable` | Use `?` for optional properties. | | `@azure-tools/typespec-azure-core/no-offsetdatetime` | Prefer using `utcDateTime` when representing a datetime unless an offset is necessary. | | `@azure-tools/typespec-azure-core/no-response-body` | Ensure that the body is set correctly for the response type. | diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-core/rules/no-generic-numeric.md b/packages/website/versioned_docs/version-latest/libraries/azure-core/rules/no-generic-numeric.md new file mode 100644 index 0000000000..0aac813129 --- /dev/null +++ b/packages/website/versioned_docs/version-latest/libraries/azure-core/rules/no-generic-numeric.md @@ -0,0 +1,47 @@ +--- +title: "no-generic-numeric" +--- + +```text title="Full name" +@azure-tools/typespec-azure-core/no-generic-numeric +``` + +Azure services should use numeric types that specify the bit-width instead of generic types. + +#### ❌ Incorrect + +```tsp +model Widget { + id: integer; + cost: float; +} +``` + +#### ✅ Correct + +```tsp +model Widget { + id: safeint; + cost: float32; +} +``` + +This includes extending generic numeric types. + +#### ❌ Incorrect + +```tsp +model GenericInteger extends integer; + +model Widget { + id: GenericInteger; +} +``` + +#### ✅ Correct + +```tsp +model Widget { + id: safeint; +} +``` diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/data-types.md b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/data-types.md index cf07b414f3..4ff9d9907b 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/data-types.md +++ b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/data-types.md @@ -122,10 +122,10 @@ model Azure.ResourceManager.ArmCreatedResponse #### Properties -| Name | Type | Description | -| ---------- | -------------- | --------------------------------------------------- | -| statusCode | `201` | The status code. | -| body | `ResponseBody` | The body type of the operation request or response. | +| Name | Type | Description | +| ---------- | -------------- | ---------------- | +| statusCode | `201` | The status code. | +| body | `ResponseBody` | | ### `ArmDeleteAcceptedLroResponse` {#Azure.ResourceManager.ArmDeleteAcceptedLroResponse} @@ -308,10 +308,10 @@ model Azure.ResourceManager.ArmResourceCreatedSyncResponse #### Properties -| Name | Type | Description | -| ---------- | ---------- | --------------------------------------------------- | -| body | `Resource` | The body type of the operation request or response. | -| statusCode | `201` | The status code. | +| Name | Type | Description | +| ---------- | ---------- | ---------------- | +| statusCode | `201` | The status code. | +| body | `Resource` | | ### `ArmResourceExistsResponse` {#Azure.ResourceManager.ArmResourceExistsResponse} @@ -372,10 +372,10 @@ model Azure.ResourceManager.ArmResponse #### Properties -| Name | Type | Description | -| ---------- | -------------- | --------------------------------------------------- | -| statusCode | `200` | The status code. | -| body | `ResponseBody` | The body type of the operation request or response. | +| Name | Type | Description | +| ---------- | -------------- | ---------------- | +| statusCode | `200` | The status code. | +| body | `ResponseBody` | | ### `CustomerManagedKeyEncryption` {#Azure.ResourceManager.CustomerManagedKeyEncryption} @@ -387,12 +387,12 @@ model Azure.ResourceManager.CustomerManagedKeyEncryption #### Properties -| Name | Type | Description | -| ------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| keyEncryptionIdentity? | [`KeyEncryptionIdentity`](./data-types.md#Azure.ResourceManager.KeyEncryptionIdentity) | The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. | -| userAssignedIdentityResourceId? | `Core.armResourceIdentifier` | User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. | -| federatedClientId? | `Core.uuid` | application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 | -| delegatedIdentityClientId? | `Core.uuid` | delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. | +| Name | Type | Description | +| ------------------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| keyEncryptionKeyIdentity? | [`KeyEncryptionKeyIdentity`](./data-types.md#Azure.ResourceManager.KeyEncryptionKeyIdentity) | The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. | +| userAssignedIdentityResourceId? | `Core.armResourceIdentifier` | User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. | +| federatedClientId? | `Core.uuid` | application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 | +| delegatedIdentityClientId? | `Core.uuid` | delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. | ### `DefaultProvisioningStateProperty` {#Azure.ResourceManager.DefaultProvisioningStateProperty} @@ -456,12 +456,12 @@ model Azure.ResourceManager.EncryptionConfiguration | customerManagedKeyEncryption? | [`CustomerManagedKeyEncryption`](./data-types.md#Azure.ResourceManager.CustomerManagedKeyEncryption) | All customer-managed key encryption properties for the resource. | | keyEncryptionKeyUrl? | `string` | key encryption key Url, versioned or unversioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. | -### `EntityTag` {#Azure.ResourceManager.EntityTag} +### `EntityTagProperty` {#Azure.ResourceManager.EntityTagProperty} Model used only to spread in the standard `eTag` envelope property for a resource ```typespec -model Azure.ResourceManager.EntityTag +model Azure.ResourceManager.EntityTagProperty ``` #### Examples @@ -469,7 +469,7 @@ model Azure.ResourceManager.EntityTag ```typespec model Foo is TrackedResource { // Only have standard Succeeded, Failed, Cancelled states - ...EntityTag; + ...EntityTagProperty; } ``` @@ -493,6 +493,30 @@ model Azure.ResourceManager.ErrorResponse | ------ | ------------------------------------------------------------------------------ | ----------------- | | error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | The error object. | +### `ExtendedLocationProperty` {#Azure.ResourceManager.ExtendedLocationProperty} + +Model representing the standard `extendedLocation` envelope property for a resource. +Spread this model into a Resource Model, if the resource supports extended locations + +```typespec +model Azure.ResourceManager.ExtendedLocationProperty +``` + +#### Examples + +```typespec +model Employee is TrackedResource { + ...ResourceNameParameter; + ...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. @@ -562,12 +586,13 @@ model Azure.ResourceManager.LocationResourceParameter | -------- | -------- | ------------------ | | location | `string` | The location name. | -### `ManagedBy` {#Azure.ResourceManager.ManagedBy} +### `ManagedByProperty` {#Azure.ResourceManager.ManagedByProperty} -Model used only to spread in the standard `managedBy` envelope property for a resource +Model representing the standard `managedBy` envelope property for a resource. +Spread this model into a resource model if the resource is managed by another entity. ```typespec -model Azure.ResourceManager.ManagedBy +model Azure.ResourceManager.ManagedByProperty ``` #### Examples @@ -575,7 +600,7 @@ model Azure.ResourceManager.ManagedBy ```typespec model Foo is TrackedResource { // Only have standard Succeeded, Failed, Cancelled states - ...ManagedBy; + ...ManagedByProperty; } ``` @@ -585,34 +610,54 @@ model Foo is TrackedResource { | ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | managedBy? | `string` | The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. | -### `ManagedServiceIdentity` {#Azure.ResourceManager.ManagedServiceIdentity} +### `ManagedServiceIdentityProperty` {#Azure.ResourceManager.ManagedServiceIdentityProperty} -Standard Azure Resource Manager definition of ManagedServiceIdentity +Model representing the standard `ManagedServiceIdentity` envelope property for a resource. +Spread this model into a resource model if the resource supports both system-assigned and user-assigned managed identities. ```typespec -model Azure.ResourceManager.ManagedServiceIdentity +model Azure.ResourceManager.ManagedServiceIdentityProperty +``` + +#### Examples + +```typespec +model Foo is TrackedResource { + ...ResourceNameParameter; + ...ManagedServiceIdentityProperty; +} ``` #### Properties -| Name | Type | Description | -| --------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | -| identity? | [`ManagedIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedIdentityProperties) | The managed service identities assigned to this resource. | +| Name | Type | Description | +| --------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | +| identity? | [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentity) | The managed service identities assigned to this resource. | -### `ManagedSystemAssignedIdentity` {#Azure.ResourceManager.ManagedSystemAssignedIdentity} +### `ManagedSystemAssignedIdentityProperty` {#Azure.ResourceManager.ManagedSystemAssignedIdentityProperty} -Standard Azure Resource Manager definition of ManagedServiceIdentity for services -that only support system-defined identities +Model representing the standard `SystemAssignedServiceIdentity` envelope property for a resource. +Spread this model into a resource model if the resource supports system-assigned managed identities +but does not support user-assigned managed identities. ```typespec -model Azure.ResourceManager.ManagedSystemAssignedIdentity +model Azure.ResourceManager.ManagedSystemAssignedIdentityProperty +``` + +#### Examples + +```typespec +model Foo is TrackedResource { + ...ResourceNameParameter; + ...ManagedSystemAssignedIdentityProperty; +} ``` #### Properties -| Name | Type | Description | -| --------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | -| identity? | [`ManagedSystemIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedSystemIdentityProperties) | The managed service identities assigned to this resource. | +| Name | Type | Description | +| --------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | +| identity? | [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity) | The managed service identities assigned to this resource. | ### `ParentKeysOf` {#Azure.ResourceManager.ParentKeysOf} @@ -878,16 +923,17 @@ model Azure.ResourceManager.ResourceInstanceParameters #### Properties -| Name | Type | Description | -| -------- | -------------------------------- | ---------------------------------------- | -| provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | +| Name | Type | Description | +| -------- | -------------------------------- | ----------- | +| provider | `"Microsoft.ThisWillBeReplaced"` | | -### `ResourceKind` {#Azure.ResourceManager.ResourceKind} +### `ResourceKindProperty` {#Azure.ResourceManager.ResourceKindProperty} -Model used only to spread in the standard `kind` envelope property for a resource +Model representing the standard `kind` envelope property for a resource. +Spread this model into a resource model if the resource support ARM `kind`. ```typespec -model Azure.ResourceManager.ResourceKind +model Azure.ResourceManager.ResourceKindProperty ``` #### Examples @@ -895,7 +941,7 @@ model Azure.ResourceManager.ResourceKind ```typespec model Foo is TrackedResource { // Only have standard Succeeded, Failed, Cancelled states - ...ResourceKind; + ...ResourceKindProperty; } ``` @@ -926,6 +972,31 @@ model Azure.ResourceManager.ResourceListResult | value | `Array` | The {name} items on this page | | nextLink? | `TypeSpec.Rest.ResourceLocation` | The link to the next page of items | +### `ResourceNameParameter` {#Azure.ResourceManager.ResourceNameParameter} + +Spread this model into ARM resource models to specify resource name parameter for its operations. If `Resource` parameter +is specified, the resource name will be properly camel cased and pluralized for `@key` and `@segment` +automatically. You can also apply explicit override with `KeyName` and `SegmentName` template parameters. + +```typespec +model Azure.ResourceManager.ResourceNameParameter +``` + +#### Template Parameters + +| Name | Description | +| ----------- | ----------------------------------------------------------------- | +| Resource | The ARM resource this name parameter is applying to. | +| KeyName | Override default key name of the resource. | +| SegmentName | Override default segment name of the resource. | +| NamePattern | The RegEx pattern of the name. Default is `^[a-zA-Z0-9-]{3,24}$`. | + +#### Properties + +| Name | Type | Description | +| ---- | -------- | ----------- | +| name | `string` | | + ### `ResourceParentParameters` {#Azure.ResourceManager.ResourceParentParameters} The dynamic parameters of a list call for a resource instance - pass in the proper base type to indicate @@ -944,16 +1015,17 @@ model Azure.ResourceManager.ResourceParentParameters #### Properties -| Name | Type | Description | -| -------- | -------------------------------- | ---------------------------------------- | -| provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | +| Name | Type | Description | +| -------- | -------------------------------- | ----------- | +| provider | `"Microsoft.ThisWillBeReplaced"` | | -### `ResourcePlan` {#Azure.ResourceManager.ResourcePlan} +### `ResourcePlanProperty` {#Azure.ResourceManager.ResourcePlanProperty} -Model used only to spread in the standard `plan` envelope property for a resource +Model representing the standard `plan` envelope property for a resource. +Spread this model into a resource Model if the resource supports ARM `plan`. ```typespec -model Azure.ResourceManager.ResourcePlan +model Azure.ResourceManager.ResourcePlanProperty ``` #### Examples @@ -961,22 +1033,23 @@ model Azure.ResourceManager.ResourcePlan ```typespec model Foo is TrackedResource { // Only have standard Succeeded, Failed, Cancelled states - ...ResourcePlan; + ...ResourcePlanProperty; } ``` #### Properties -| Name | Type | Description | -| ----- | ---------------------------------------------------------------------------------------- | ----------------------------- | -| plan? | [`ResourcePlanType`](./data-types.md#Azure.ResourceManager.Foundations.ResourcePlanType) | Details of the resource plan. | +| Name | Type | Description | +| ----- | ---------------------------------------------------------------- | ----------------------------- | +| plan? | [`Plan`](./data-types.md#Azure.ResourceManager.Foundations.Plan) | Details of the resource plan. | -### `ResourceSku` {#Azure.ResourceManager.ResourceSku} +### `ResourceSkuProperty` {#Azure.ResourceManager.ResourceSkuProperty} -Model used only to spread in the standard `sku` envelope property for a resource +Model representing the standard `sku` envelope property for a resource. +Spread this model into a resource model if the resource supports standard ARM `sku`. ```typespec -model Azure.ResourceManager.ResourceSku +model Azure.ResourceManager.ResourceSkuProperty ``` #### Examples @@ -984,15 +1057,15 @@ model Azure.ResourceManager.ResourceSku ```typespec model Foo is TrackedResource { // Only have standard Succeeded, Failed, Cancelled states - ...ResourceSku; + ...ResourceSkuProperty; } ``` #### Properties -| Name | Type | Description | -| ---- | -------------------------------------------------------------------------------------- | ------------------------------------------------------- | -| sku? | [`ResourceSkuType`](./data-types.md#Azure.ResourceManager.Foundations.ResourceSkuType) | The SKU (Stock Keeping Unit) assigned to this resource. | +| Name | Type | Description | +| ---- | -------------------------------------------------------------- | ------------------------------------------------------- | +| sku? | [`Sku`](./data-types.md#Azure.ResourceManager.Foundations.Sku) | The SKU (Stock Keeping Unit) assigned to this resource. | ### `ResourceUriParameter` {#Azure.ResourceManager.ResourceUriParameter} @@ -1074,20 +1147,28 @@ model Azure.ResourceManager.TrackedResource | ----------- | ------------ | ----------- | | properties? | `Properties` | | +### `Versions` {#Azure.ResourceManager.Versions} + +Supported versions of Azure.ResourceManager building blocks. + +```typespec +enum Azure.ResourceManager.Versions +``` + ### `InfrastructureEncryption` {#Azure.ResourceManager.InfrastructureEncryption} (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. ```typespec -enum Azure.ResourceManager.InfrastructureEncryption +union Azure.ResourceManager.InfrastructureEncryption ``` -### `KeyEncryptionIdentity` {#Azure.ResourceManager.KeyEncryptionIdentity} +### `KeyEncryptionKeyIdentity` {#Azure.ResourceManager.KeyEncryptionKeyIdentity} The type of identity to use. ```typespec -enum Azure.ResourceManager.KeyEncryptionIdentity +union Azure.ResourceManager.KeyEncryptionKeyIdentity ``` ### `PrivateEndpointConnectionProvisioningState` {#Azure.ResourceManager.PrivateEndpointConnectionProvisioningState} @@ -1095,7 +1176,7 @@ enum Azure.ResourceManager.KeyEncryptionIdentity The provisioning state of the connection ```typespec -enum Azure.ResourceManager.PrivateEndpointConnectionProvisioningState +union Azure.ResourceManager.PrivateEndpointConnectionProvisioningState ``` ### `PrivateEndpointServiceConnectionStatus` {#Azure.ResourceManager.PrivateEndpointServiceConnectionStatus} @@ -1103,38 +1184,30 @@ enum Azure.ResourceManager.PrivateEndpointConnectionProvisioningState The private endpoint connection status ```typespec -enum Azure.ResourceManager.PrivateEndpointServiceConnectionStatus +union Azure.ResourceManager.PrivateEndpointServiceConnectionStatus ``` ### `ResourceProvisioningState` {#Azure.ResourceManager.ResourceProvisioningState} -Standard terminal provisioning state of resource type. You can spread into your +Standard terminal provisioning state of resource type. You can include in your custom provision state to avoid duplication and ensure consistency ```typespec -enum Azure.ResourceManager.ResourceProvisioningState +union Azure.ResourceManager.ResourceProvisioningState ``` #### Examples ```typespec -enum FooProvisioningState { - ...ResourceProvisioningState, // include standard provisioning states - starting, - started, - stopping, - stopped, +union FooProvisioningState { + ResourceProvisioningState, // include standard provisioning states + starting: "starting", + started: "started", + stopping: "stopping", + stopped: "stopped", } ``` -### `Versions` {#Azure.ResourceManager.Versions} - -Supported versions of Azure.ResourceManager building blocks. - -```typespec -enum Azure.ResourceManager.Versions -``` - ## Azure.ResourceManager.CommonTypes ### `Versions` {#Azure.ResourceManager.CommonTypes.Versions} @@ -1147,49 +1220,35 @@ enum Azure.ResourceManager.CommonTypes.Versions ## Azure.ResourceManager.Foundations -### `ArmResource` {#Azure.ResourceManager.Foundations.ArmResource} - -Base model that defines common properties for all Azure Resource Manager resources. - -```typespec -model Azure.ResourceManager.Foundations.ArmResource -``` - -#### Properties - -| Name | Type | Description | -| ----------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | `string` | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} | -| type | `string` | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | -| systemData? | [`SystemData`](./data-types.md#Azure.ResourceManager.Foundations.SystemData) | Azure Resource Manager metadata containing createdBy and modifiedBy information. | +### `ArmTagsProperty` {#Azure.ResourceManager.Foundations.ArmTagsProperty} -### `ArmResourceBase` {#Azure.ResourceManager.Foundations.ArmResourceBase} +Standard type definition for Azure Resource Manager Tags property. -Base class used for type definitions +It is included in the TrackedResource template definition. ```typespec -model Azure.ResourceManager.Foundations.ArmResourceBase +model Azure.ResourceManager.Foundations.ArmTagsProperty ``` #### Properties -None +| Name | Type | Description | +| ----- | ---------------- | -------------- | +| tags? | `Record` | Resource tags. | -### `ArmTagsProperty` {#Azure.ResourceManager.Foundations.ArmTagsProperty} +### `AzureEntityResource` {#Azure.ResourceManager.Foundations.AzureEntityResource} -Standard type definition for Azure Resource Manager Tags property. - -It is included in the TrackedResource template definition. +The resource model definition for an Azure Resource Manager resource with an etag. ```typespec -model Azure.ResourceManager.Foundations.ArmTagsProperty +model Azure.ResourceManager.Foundations.AzureEntityResource ``` #### Properties -| Name | Type | Description | -| ----- | ---------------- | -------------- | -| tags? | `Record` | Resource tags. | +| Name | Type | Description | +| ---- | -------- | -------------- | +| etag | `string` | Resource Etag. | ### `CheckNameAvailabilityRequest` {#Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest} @@ -1279,6 +1338,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 @@ -1294,12 +1368,12 @@ model Azure.ResourceManager.Foundations.ExtensionBaseParameters | apiVersion | `string` | The API version to use for this operation. | | resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | -### `ExtensionResourceBase` {#Azure.ResourceManager.Foundations.ExtensionResourceBase} +### `ExtensionResource` {#Azure.ResourceManager.Foundations.ExtensionResource} The base extension resource. ```typespec -model Azure.ResourceManager.Foundations.ExtensionResourceBase +model Azure.ResourceManager.Foundations.ExtensionResource ``` #### Properties @@ -1367,38 +1441,22 @@ model Azure.ResourceManager.Foundations.LocationScope | location | `string` | The location name. | | provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | -### `ManagedIdentityProperties` {#Azure.ResourceManager.Foundations.ManagedIdentityProperties} +### `ManagedServiceIdentity` {#Azure.ResourceManager.Foundations.ManagedServiceIdentity} The properties of the managed service identities assigned to this resource. ```typespec -model Azure.ResourceManager.Foundations.ManagedIdentityProperties +model Azure.ResourceManager.Foundations.ManagedServiceIdentity ``` #### Properties -| Name | Type | Description | -| ----------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------- | -| tenantId? | `string` | The Active Directory tenant id of the principal. | -| principalId? | `string` | The active directory identifier of this principal. | -| type | [`ManagedIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.ManagedIdentityType) | The type of managed identity assigned to this resource. | -| userAssignedIdentities? | `Record` | The identities assigned to this resource by the user. | - -### `ManagedSystemIdentityProperties` {#Azure.ResourceManager.Foundations.ManagedSystemIdentityProperties} - -The properties of the service-assigned identity associated with this resource. - -```typespec -model Azure.ResourceManager.Foundations.ManagedSystemIdentityProperties -``` - -#### Properties - -| Name | Type | Description | -| ------------ | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | -| tenantId? | `string` | The Active Directory tenant id of the principal. | -| principalId? | `string` | The active directory identifier of this principal. | -| type | [`ManagedSystemIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.ManagedSystemIdentityType) | The type of managed identity assigned to this resource. | +| Name | Type | Description | +| ----------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | +| tenantId? | `string` | The Active Directory tenant id of the principal. | +| principalId? | `string` | The active directory identifier of this principal. | +| type | [`ManagedServiceIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentityType) | The type of managed identity assigned to this resource. | +| userAssignedIdentities? | [`UserAssignedIdentities`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentities) | The identities assigned to this resource by the user. | ### `Operation` {#Azure.ResourceManager.Foundations.Operation} @@ -1416,7 +1474,7 @@ model Azure.ResourceManager.Foundations.Operation | isDataAction? | `boolean` | Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. | | display? | [`OperationDisplay`](./data-types.md#Azure.ResourceManager.Foundations.OperationDisplay) | Localized display information for this particular operation. | | origin? | [`Origin`](./data-types.md#Azure.ResourceManager.Foundations.Origin) | The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" | -| actionType? | [`ActionType`](./data-types.md#Azure.ResourceManager.Foundations.ActionType) | Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. | +| actionType? | [`ActionType`](./data-types.md#Azure.ResourceManager.Foundations.ActionType) | Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. | ### `OperationDisplay` {#Azure.ResourceManager.Foundations.OperationDisplay} @@ -1485,12 +1543,30 @@ model Azure.ResourceManager.Foundations.OperationStatusResult | operations | `ResourceManager.Foundations.OperationStatusResult[]` | The operations list. | | error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | If present, details of the operation error. | -### `ProxyResourceBase` {#Azure.ResourceManager.Foundations.ProxyResourceBase} +### `Plan` {#Azure.ResourceManager.Foundations.Plan} + +Details of the resource plan. + +```typespec +model Azure.ResourceManager.Foundations.Plan +``` + +#### Properties + +| Name | Type | Description | +| -------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | A user defined name of the 3rd Party Artifact that is being procured. | +| publisher | `string` | The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic | +| product | `string` | The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. | +| promotionCode? | `string` | A publisher provided promotion code as provisioned in Data Market for the said product/artifact. | +| version? | `string` | The version of the desired product/artifact. | + +### `ProxyResource` {#Azure.ResourceManager.Foundations.ProxyResource} The base proxy resource. ```typespec -model Azure.ResourceManager.Foundations.ProxyResourceBase +model Azure.ResourceManager.Foundations.ProxyResource ``` #### Properties @@ -1518,6 +1594,23 @@ model Azure.ResourceManager.Foundations.ProxyResourceUpdateModel` | | +### `Resource` {#Azure.ResourceManager.Foundations.Resource} + +Base model that defines common properties for all Azure Resource Manager resources. + +```typespec +model Azure.ResourceManager.Foundations.Resource +``` + +#### Properties + +| Name | Type | Description | +| ----------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id? | `string` | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} | +| name? | `string` | The name of the resource | +| type? | `string` | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | +| systemData? | [`SystemData`](./data-types.md#Azure.ResourceManager.Foundations.SystemData) | Azure Resource Manager metadata containing createdBy and modifiedBy information. | + ### `ResourceGroupBaseParameters` {#Azure.ResourceManager.Foundations.ResourceGroupBaseParameters} The static parameters for a resource-group based resource @@ -1559,42 +1652,6 @@ model Azure.ResourceManager.Foundations.ResourceGroupScope | resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | | provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | -### `ResourcePlanType` {#Azure.ResourceManager.Foundations.ResourcePlanType} - -Details of the resource plan. - -```typespec -model Azure.ResourceManager.Foundations.ResourcePlanType -``` - -#### Properties - -| Name | Type | Description | -| -------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | `string` | A user defined name of the 3rd Party Artifact that is being procured. | -| publisher | `string` | The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic | -| product | `string` | The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. | -| promotionCode? | `string` | A publisher provided promotion code as provisioned in Data Market for the said product/artifact. | -| version? | `string` | The version of the desired product/artifact. | - -### `ResourceSkuType` {#Azure.ResourceManager.Foundations.ResourceSkuType} - -The SKU (Stock Keeping Unit) assigned to this resource. - -```typespec -model Azure.ResourceManager.Foundations.ResourceSkuType -``` - -#### Properties - -| Name | Type | Description | -| --------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | `string` | The name of the SKU, usually a combination of letters and numbers, for example, 'P3' | -| tier? | [`SkuTier`](./data-types.md#Azure.ResourceManager.Foundations.SkuTier) | This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. | -| size? | `string` | The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. | -| family? | `string` | If the service has different generations of hardware, for the same SKU, then that can be captured here. | -| capacity? | `int32` | If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. | - ### `ResourceUpdateModel` {#Azure.ResourceManager.Foundations.ResourceUpdateModel} Defines a model type used to create named resource update models @@ -1637,6 +1694,24 @@ model Azure.ResourceManager.Foundations.ResourceUpdateModelProperties | subscriptionId | `string` | The ID of the target subscription. | | provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | +### `SystemAssignedServiceIdentity` {#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity} + +The properties of the service-assigned identity associated with this resource. + +```typespec +model Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity +``` + +#### Properties + +| Name | Type | Description | +| ------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | +| tenantId? | `string` | The Active Directory tenant id of the principal. | +| principalId? | `string` | The active directory identifier of this principal. | +| type | [`SystemAssignedServiceIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType) | The type of managed identity assigned to this resource. | + ### `SystemData` {#Azure.ResourceManager.Foundations.SystemData} Metadata pertaining to creation and last modification of the resource. @@ -1748,12 +1839,12 @@ model Azure.ResourceManager.Foundations.TenantScope | apiVersion | `string` | The API version to use for this operation. | | provider | `"Microsoft.ThisWillBeReplaced"` | The provider namespace for the resource. | -### `TrackedResourceBase` {#Azure.ResourceManager.Foundations.TrackedResourceBase} +### `TrackedResource` {#Azure.ResourceManager.Foundations.TrackedResource} The base tracked resource. ```typespec -model Azure.ResourceManager.Foundations.TrackedResourceBase +model Azure.ResourceManager.Foundations.TrackedResource ``` #### Properties @@ -1763,6 +1854,20 @@ model Azure.ResourceManager.Foundations.TrackedResourceBase | location | `string` | The geo-location where the resource lives | | tags? | `Record` | Resource tags. | +### `UserAssignedIdentities` {#Azure.ResourceManager.Foundations.UserAssignedIdentities} + +The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + +```typespec +model Azure.ResourceManager.Foundations.UserAssignedIdentities +``` + +#### Properties + +| Name | Type | Description | +| ---- | ------------------------------------------------------------------------------------------------ | --------------------- | +| | [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentity) | Additional properties | + ### `UserAssignedIdentity` {#Azure.ResourceManager.Foundations.UserAssignedIdentity} A managed identity assigned by the user. @@ -1778,12 +1883,28 @@ model Azure.ResourceManager.Foundations.UserAssignedIdentity | clientId? | `string` | The active directory client identifier for this principal. | | principalId? | `string` | The active directory identifier for this principal. | +### `ResourceHome` {#Azure.ResourceManager.Foundations.ResourceHome} + +An internal enum to indicate the resource support for various path types + +```typespec +enum Azure.ResourceManager.Foundations.ResourceHome +``` + +### `SkuTier` {#Azure.ResourceManager.Foundations.SkuTier} + +Available service tiers for the SKU. + +```typespec +enum Azure.ResourceManager.Foundations.SkuTier +``` + ### `ActionType` {#Azure.ResourceManager.Foundations.ActionType} -Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ```typespec -enum Azure.ResourceManager.Foundations.ActionType +union Azure.ResourceManager.Foundations.ActionType ``` ### `CheckNameAvailabilityReason` {#Azure.ResourceManager.Foundations.CheckNameAvailabilityReason} @@ -1791,7 +1912,7 @@ enum Azure.ResourceManager.Foundations.ActionType Possible reasons for a name not being available. ```typespec -enum Azure.ResourceManager.Foundations.CheckNameAvailabilityReason +union Azure.ResourceManager.Foundations.CheckNameAvailabilityReason ``` ### `createdByType` {#Azure.ResourceManager.Foundations.createdByType} @@ -1799,23 +1920,23 @@ enum Azure.ResourceManager.Foundations.CheckNameAvailabilityReason The kind of entity that created the resource. ```typespec -enum Azure.ResourceManager.Foundations.createdByType +union Azure.ResourceManager.Foundations.createdByType ``` -### `ManagedIdentityType` {#Azure.ResourceManager.Foundations.ManagedIdentityType} +### `ExtendedLocationType` {#Azure.ResourceManager.Foundations.ExtendedLocationType} -The kind of managed identity assigned to this resource. +The supported ExtendedLocation types. ```typespec -enum Azure.ResourceManager.Foundations.ManagedIdentityType +union Azure.ResourceManager.Foundations.ExtendedLocationType ``` -### `ManagedSystemIdentityType` {#Azure.ResourceManager.Foundations.ManagedSystemIdentityType} +### `ManagedServiceIdentityType` {#Azure.ResourceManager.Foundations.ManagedServiceIdentityType} -The kind of managemed identity assigned to this resource. +The kind of managed identity assigned to this resource. ```typespec -enum Azure.ResourceManager.Foundations.ManagedSystemIdentityType +union Azure.ResourceManager.Foundations.ManagedServiceIdentityType ``` ### `Origin` {#Azure.ResourceManager.Foundations.Origin} @@ -1823,21 +1944,13 @@ enum Azure.ResourceManager.Foundations.ManagedSystemIdentityType The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" ```typespec -enum Azure.ResourceManager.Foundations.Origin -``` - -### `ResourceHome` {#Azure.ResourceManager.Foundations.ResourceHome} - -An internal enum to indicate the resource support for various path types - -```typespec -enum Azure.ResourceManager.Foundations.ResourceHome +union Azure.ResourceManager.Foundations.Origin ``` -### `SkuTier` {#Azure.ResourceManager.Foundations.SkuTier} +### `SystemAssignedServiceIdentityType` {#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType} -Available service tiers for the SKU. +The kind of managemed identity assigned to this resource. ```typespec -enum Azure.ResourceManager.Foundations.SkuTier +union Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType ``` diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/index.mdx b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/index.mdx index 8271cf998c..51360a7a56 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/index.mdx +++ b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/index.mdx @@ -139,15 +139,16 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager - [`DefaultProvisioningStateProperty`](./data-types.md#Azure.ResourceManager.DefaultProvisioningStateProperty) - [`Encryption`](./data-types.md#Azure.ResourceManager.Encryption) - [`EncryptionConfiguration`](./data-types.md#Azure.ResourceManager.EncryptionConfiguration) -- [`EntityTag`](./data-types.md#Azure.ResourceManager.EntityTag) +- [`EntityTagProperty`](./data-types.md#Azure.ResourceManager.EntityTagProperty) - [`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) - [`LocationResourceParameter`](./data-types.md#Azure.ResourceManager.LocationResourceParameter) -- [`ManagedBy`](./data-types.md#Azure.ResourceManager.ManagedBy) -- [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.ManagedServiceIdentity) -- [`ManagedSystemAssignedIdentity`](./data-types.md#Azure.ResourceManager.ManagedSystemAssignedIdentity) +- [`ManagedByProperty`](./data-types.md#Azure.ResourceManager.ManagedByProperty) +- [`ManagedServiceIdentityProperty`](./data-types.md#Azure.ResourceManager.ManagedServiceIdentityProperty) +- [`ManagedSystemAssignedIdentityProperty`](./data-types.md#Azure.ResourceManager.ManagedSystemAssignedIdentityProperty) - [`ParentKeysOf`](./data-types.md#Azure.ResourceManager.ParentKeysOf) - [`PrivateEndpoint`](./data-types.md#Azure.ResourceManager.PrivateEndpoint) - [`PrivateEndpointConnection`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnection) @@ -164,11 +165,12 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager - [`ResourceGroupLocationResource`](./data-types.md#Azure.ResourceManager.ResourceGroupLocationResource) - [`ResourceGroupParameter`](./data-types.md#Azure.ResourceManager.ResourceGroupParameter) - [`ResourceInstanceParameters`](./data-types.md#Azure.ResourceManager.ResourceInstanceParameters) -- [`ResourceKind`](./data-types.md#Azure.ResourceManager.ResourceKind) +- [`ResourceKindProperty`](./data-types.md#Azure.ResourceManager.ResourceKindProperty) - [`ResourceListResult`](./data-types.md#Azure.ResourceManager.ResourceListResult) +- [`ResourceNameParameter`](./data-types.md#Azure.ResourceManager.ResourceNameParameter) - [`ResourceParentParameters`](./data-types.md#Azure.ResourceManager.ResourceParentParameters) -- [`ResourcePlan`](./data-types.md#Azure.ResourceManager.ResourcePlan) -- [`ResourceSku`](./data-types.md#Azure.ResourceManager.ResourceSku) +- [`ResourcePlanProperty`](./data-types.md#Azure.ResourceManager.ResourcePlanProperty) +- [`ResourceSkuProperty`](./data-types.md#Azure.ResourceManager.ResourceSkuProperty) - [`ResourceUriParameter`](./data-types.md#Azure.ResourceManager.ResourceUriParameter) - [`SubscriptionIdParameter`](./data-types.md#Azure.ResourceManager.SubscriptionIdParameter) - [`SubscriptionLocationResource`](./data-types.md#Azure.ResourceManager.SubscriptionLocationResource) @@ -188,39 +190,41 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager ### Models -- [`ArmResource`](./data-types.md#Azure.ResourceManager.Foundations.ArmResource) -- [`ArmResourceBase`](./data-types.md#Azure.ResourceManager.Foundations.ArmResourceBase) - [`ArmTagsProperty`](./data-types.md#Azure.ResourceManager.Foundations.ArmTagsProperty) +- [`AzureEntityResource`](./data-types.md#Azure.ResourceManager.Foundations.AzureEntityResource) - [`CheckNameAvailabilityRequest`](./data-types.md#Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest) - [`CheckNameAvailabilityResponse`](./data-types.md#Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse) - [`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) +- [`ExtensionResource`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionResource) - [`ExtensionScope`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionScope) - [`LocationBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.LocationBaseParameters) - [`LocationScope`](./data-types.md#Azure.ResourceManager.Foundations.LocationScope) -- [`ManagedIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedIdentityProperties) -- [`ManagedSystemIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedSystemIdentityProperties) +- [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentity) - [`Operation`](./data-types.md#Azure.ResourceManager.Foundations.Operation) - [`OperationDisplay`](./data-types.md#Azure.ResourceManager.Foundations.OperationDisplay) - [`OperationIdParameter`](./data-types.md#Azure.ResourceManager.Foundations.OperationIdParameter) - [`OperationListResult`](./data-types.md#Azure.ResourceManager.Foundations.OperationListResult) - [`OperationStatusResult`](./data-types.md#Azure.ResourceManager.Foundations.OperationStatusResult) -- [`ProxyResourceBase`](./data-types.md#Azure.ResourceManager.Foundations.ProxyResourceBase) +- [`Plan`](./data-types.md#Azure.ResourceManager.Foundations.Plan) +- [`ProxyResource`](./data-types.md#Azure.ResourceManager.Foundations.ProxyResource) - [`ProxyResourceUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.ProxyResourceUpdateModel) +- [`Resource`](./data-types.md#Azure.ResourceManager.Foundations.Resource) - [`ResourceGroupBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.ResourceGroupBaseParameters) - [`ResourceGroupScope`](./data-types.md#Azure.ResourceManager.Foundations.ResourceGroupScope) -- [`ResourcePlanType`](./data-types.md#Azure.ResourceManager.Foundations.ResourcePlanType) -- [`ResourceSkuType`](./data-types.md#Azure.ResourceManager.Foundations.ResourceSkuType) - [`ResourceUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.ResourceUpdateModel) - [`ResourceUpdateModelProperties`](./data-types.md#Azure.ResourceManager.Foundations.ResourceUpdateModelProperties) +- [`Sku`](./data-types.md#Azure.ResourceManager.Foundations.Sku) - [`SubscriptionBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.SubscriptionBaseParameters) - [`SubscriptionScope`](./data-types.md#Azure.ResourceManager.Foundations.SubscriptionScope) +- [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity) - [`SystemData`](./data-types.md#Azure.ResourceManager.Foundations.SystemData) - [`TagsUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.TagsUpdateModel) - [`TenantBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.TenantBaseParameters) - [`TenantScope`](./data-types.md#Azure.ResourceManager.Foundations.TenantScope) -- [`TrackedResourceBase`](./data-types.md#Azure.ResourceManager.Foundations.TrackedResourceBase) +- [`TrackedResource`](./data-types.md#Azure.ResourceManager.Foundations.TrackedResource) +- [`UserAssignedIdentities`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentities) - [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentity) diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/interfaces.md b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/interfaces.md index f1b4c7fc99..13ef0e088b 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/interfaces.md +++ b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/reference/interfaces.md @@ -22,10 +22,10 @@ interface Azure.ResourceManager.ExtensionResourceCollectionOperations | -------- | ---------------------------------------------- | | Resource | The ArmResource that provides these operations | -#### `ExtensionResourceCollectionOperations.list` {#Azure.ResourceManager.ExtensionResourceCollectionOperations.list} +#### `ExtensionResourceCollectionOperations.listByParent` {#Azure.ResourceManager.ExtensionResourceCollectionOperations.listByParent} ```typespec -op Azure.ResourceManager.ExtensionResourceCollectionOperations.list(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceCollectionOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` ### `ExtensionResourceInstanceOperations` {#Azure.ResourceManager.ExtensionResourceInstanceOperations} @@ -106,10 +106,10 @@ op Azure.ResourceManager.ExtensionResourceOperations.update(apiVersion: string, op Azure.ResourceManager.ExtensionResourceOperations.delete(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse ``` -#### `ExtensionResourceOperations.list` {#Azure.ResourceManager.ExtensionResourceOperations.list} +#### `ExtensionResourceOperations.listByParent` {#Azure.ResourceManager.ExtensionResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ExtensionResourceOperations.list(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` ### `Operations` {#Azure.ResourceManager.Operations} @@ -170,10 +170,10 @@ op Azure.ResourceManager.ProxyResourceOperations.createOrUpdate(provider: "Micro op Azure.ResourceManager.ProxyResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse ``` -#### `ProxyResourceOperations.listByResourceGroup` {#Azure.ResourceManager.ProxyResourceOperations.listByResourceGroup} +#### `ProxyResourceOperations.listByParent` {#Azure.ResourceManager.ProxyResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ProxyResourceOperations.listByResourceGroup(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ProxyResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` ### `ResourceCollectionOperations` {#Azure.ResourceManager.ResourceCollectionOperations} @@ -191,10 +191,10 @@ interface Azure.ResourceManager.ResourceCollectionOperations> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceCollectionOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` #### `ResourceCollectionOperations.listBySubscription` {#Azure.ResourceManager.ResourceCollectionOperations.listBySubscription} @@ -426,10 +426,10 @@ op Azure.ResourceManager.ResourceOperations.update(provider: "Microsoft.ThisWill op Azure.ResourceManager.ResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse ``` -#### `ResourceOperations.listByResourceGroup` {#Azure.ResourceManager.ResourceOperations.listByResourceGroup} +#### `ResourceOperations.listByParent` {#Azure.ResourceManager.ResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ResourceOperations.listByResourceGroup(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` #### `ResourceOperations.listBySubscription` {#Azure.ResourceManager.ResourceOperations.listBySubscription} @@ -546,10 +546,10 @@ op Azure.ResourceManager.TenantResourceOperations.update(apiVersion: string, pro op Azure.ResourceManager.TenantResourceOperations.delete(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse ``` -#### `TenantResourceOperations.listByTenant` {#Azure.ResourceManager.TenantResourceOperations.listByTenant} +#### `TenantResourceOperations.listByParent` {#Azure.ResourceManager.TenantResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.TenantResourceOperations.listByTenant(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.listByParent(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` ### `TrackedResourceOperations` {#Azure.ResourceManager.TrackedResourceOperations} @@ -595,10 +595,10 @@ op Azure.ResourceManager.TrackedResourceOperations.update(provider: "Microsoft.T op Azure.ResourceManager.TrackedResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse ``` -#### `TrackedResourceOperations.listByResourceGroup` {#Azure.ResourceManager.TrackedResourceOperations.listByResourceGroup} +#### `TrackedResourceOperations.listByParent` {#Azure.ResourceManager.TrackedResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.listByResourceGroup(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse ``` #### `TrackedResourceOperations.listBySubscription` {#Azure.ResourceManager.TrackedResourceOperations.listBySubscription} diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/put-operation-response-codes.md b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/put-operation-response-codes.md index be95252893..5d35d577d2 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/put-operation-response-codes.md +++ b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/put-operation-response-codes.md @@ -6,7 +6,7 @@ title: put-operation-response-codes @azure-tools/typespec-azure-resource-manager/put-operation-response-codes ``` -Put operations should use the `ArmResourceCreateOrUpdateAsync`, `ArmResourceCreateOrReplaceAsync` or `ArmResourceCreateOrReplaceSync` template. They must have 200, 201, default and no other responses. +Put operations should use the `ArmResourceCreateOrReplaceAsync` or `ArmResourceCreateOrReplaceSync` template. They must have 200, 201, default and no other responses. #### ❌ Incorrect @@ -26,6 +26,6 @@ interface Employees { ```tsp @armResourceOperations interface Employees { - createOrUpdate is ArmResourceCreateOrUpdateAsync; + createOrUpdate is ArmResourceCreateOrReplaceAsync; } ``` diff --git a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/resource-name-pattern.md b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/resource-name-pattern.md index fd03a68d42..33434b46e0 100644 --- a/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/resource-name-pattern.md +++ b/packages/website/versioned_docs/version-latest/libraries/azure-resource-manager/rules/resource-name-pattern.md @@ -23,10 +23,6 @@ model Employee is ProxyResource<{}> { ```tsp model Employee is ProxyResource<{}> { - @pattern("^[a-zA-Z0-9-]{3,24}$") - @key("employeeName") - @path - @segment("employees") - name: string; + ...ResourceNameParameter; } ``` diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createDiagnostic.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createDiagnostic.md index d09ddd13d6..d1eef18109 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createDiagnostic.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createDiagnostic.md @@ -29,7 +29,12 @@ createDiagnostic(diag): Diagnostic \| `"encoding-multipart-bytes"` \| `"unsupported-kind"` \| `"multiple-services"` - \| `"server-param-not-path"` | + \| `"server-param-not-path"` + \| `"unexpected-http-param-type"` + \| `"multiple-response-types"` + \| `"no-corresponding-method-param"` + \| `"unsupported-protocol"` + \| `"no-emitter-name"` | | `M` extends `string` \| `number` \| `symbol` | ## Parameters diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createSdkContext.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createSdkContext.md index ac16c02d29..ecb5a95cde 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createSdkContext.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/createSdkContext.md @@ -4,7 +4,10 @@ title: "[F] createSdkContext" --- ```ts -createSdkContext(context, emitterName?): SdkContext +createSdkContext( + context, + emitterName?, +options?): SdkContext ``` ## Type parameters @@ -20,6 +23,7 @@ createSdkContext(context, emitterName?): SdkContext | :------ | :------ | | `context` | `EmitContext`<`TOptions`\> | | `emitterName`? | `string` | +| `options`? | `CreateSdkContextOptions` | ## Returns diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/getCrossLanguageDefinitionId.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/getCrossLanguageDefinitionId.md index ff637b36c6..7f7099d53c 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/getCrossLanguageDefinitionId.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/getCrossLanguageDefinitionId.md @@ -4,7 +4,7 @@ title: "[F] getCrossLanguageDefinitionId" --- ```ts -getCrossLanguageDefinitionId(type): string +getCrossLanguageDefinitionId(type, name?): string ``` Helper function to return cross language definition id for a type @@ -15,9 +15,10 @@ Helper function to return cross language definition id for a type | :------ | :------ | :------ | | `type` | `Object` | | | `type.interface`? | `Interface` | - | -| `type.kind` | `string` | - | -| `type.name` | `string` | - | +| `type.kind`? | `string` | - | +| `type.name`? | `string` | - | | `type.namespace`? | `Namespace` | - | +| `name`? | `string` | - | ## Returns diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkFloatKind.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkFloatKind.md new file mode 100644 index 0000000000..0f44d14f7b --- /dev/null +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkFloatKind.md @@ -0,0 +1,18 @@ +--- +jsApi: true +title: "[F] isSdkFloatKind" + +--- +```ts +isSdkFloatKind(kind): kind is "float" | "decimal" | "float32" | "float64" | "decimal128" +``` + +## Parameters + +| Parameter | Type | +| :------ | :------ | +| `kind` | `string` | + +## Returns + +`kind is "float" | "decimal" | "float32" | "float64" | "decimal128"` diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkIntKind.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkIntKind.md new file mode 100644 index 0000000000..2d867123ec --- /dev/null +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/isSdkIntKind.md @@ -0,0 +1,18 @@ +--- +jsApi: true +title: "[F] isSdkIntKind" + +--- +```ts +isSdkIntKind(kind): kind is "numeric" | "integer" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" | "int64" | "uint64" | "safeint" +``` + +## Parameters + +| Parameter | Type | +| :------ | :------ | +| `kind` | `string` | + +## Returns + +`kind is "numeric" | "integer" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" | "int64" | "uint64" | "safeint"` diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/reportDiagnostic.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/reportDiagnostic.md index 6769f7479b..05d00453c2 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/reportDiagnostic.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/functions/reportDiagnostic.md @@ -29,7 +29,12 @@ reportDiagnostic(program, diag): void \| `"encoding-multipart-bytes"` \| `"unsupported-kind"` \| `"multiple-services"` - \| `"server-param-not-path"` | + \| `"server-param-not-path"` + \| `"unexpected-http-param-type"` + \| `"multiple-response-types"` + \| `"no-corresponding-method-param"` + \| `"unsupported-protocol"` + \| `"no-emitter-name"` | | `M` extends `string` \| `number` \| `symbol` | ## Parameters diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/index.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/index.md index 594dff3824..5a2740737d 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/index.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/index.md @@ -139,6 +139,8 @@ title: "[P] JS API" - [isReadOnly](functions/isReadOnly.md) - [isSdkBuiltInKind](functions/isSdkBuiltInKind.md) - [isSdkDatetimeEncodings](functions/isSdkDatetimeEncodings.md) +- [isSdkFloatKind](functions/isSdkFloatKind.md) +- [isSdkIntKind](functions/isSdkIntKind.md) - [listClients](functions/listClients.md) - [listOperationGroups](functions/listOperationGroups.md) - [listOperationsInOperationGroup](functions/listOperationsInOperationGroup.md) diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkBasicServiceMethod.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkBasicServiceMethod.md index cc55a024c7..9080ca06a3 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkBasicServiceMethod.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkBasicServiceMethod.md @@ -20,6 +20,7 @@ title: "[I] SdkBasicServiceMethod" | `__raw?` | `Operation` | `SdkServiceMethodBase.__raw` | | `access` | `undefined` \| [`AccessFlags`](../type-aliases/AccessFlags.md) | `SdkServiceMethodBase.access` | | `apiVersions` | `string`[] | `SdkServiceMethodBase.apiVersions` | +| `crossLanguageDefintionId` | `string` | `SdkServiceMethodBase.crossLanguageDefintionId` | | `description?` | `string` | `SdkServiceMethodBase.description` | | `details?` | `string` | `SdkServiceMethodBase.details` | | `exception?` | [`SdkMethodResponse`](SdkMethodResponse.md) | `SdkServiceMethodBase.exception` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkContext.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkContext.md index 58ecdfeb73..f29c790b6f 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkContext.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkContext.md @@ -18,11 +18,16 @@ title: "[I] SdkContext" | Property | Type | Inherited from | | :------ | :------ | :------ | -| `__api_version_client_default_value?` | `string` | `TCGCContext.__api_version_client_default_value` | -| `__api_version_parameter?` | [`SdkParameter`](../type-aliases/SdkParameter.md) | `TCGCContext.__api_version_parameter` | -| `__api_versions?` | `string`[] | `TCGCContext.__api_versions` | | `__clients?` | [`SdkClientType`](SdkClientType.md)<`TServiceOperation`\>[] | - | +| `__namespaceToApiVersionClientDefaultValue` | `Map`<`Interface` \| `Namespace`, `undefined` \| `string`\> | `TCGCContext.__namespaceToApiVersionClientDefaultValue` | +| `__namespaceToApiVersionParameter` | `Map`<`Interface` \| `Namespace`, [`SdkParameter`](../type-aliases/SdkParameter.md)\> | `TCGCContext.__namespaceToApiVersionParameter` | +| `__namespaceToApiVersions` | `Map`<`Interface` \| `Namespace`, `string`[]\> | `TCGCContext.__namespaceToApiVersions` | +| `__rawClients?` | [`SdkClient`](SdkClient.md)[] | `TCGCContext.__rawClients` | +| `__service_projection?` | `Map`<`Namespace`, [`Namespace`, `undefined` \| `ProjectedProgram`]\> | `TCGCContext.__service_projection` | +| `__subscriptionIdParameter?` | [`SdkParameter`](../type-aliases/SdkParameter.md) | `TCGCContext.__subscriptionIdParameter` | +| `apiVersion?` | `string` | `TCGCContext.apiVersion` | | `arm?` | `boolean` | `TCGCContext.arm` | +| `diagnostics` | readonly `Diagnostic`[] | `TCGCContext.diagnostics` | | `emitContext` | `EmitContext`<`TOptions`\> | - | | `emitterName` | `string` | `TCGCContext.emitterName` | | `experimental_sdkPackage` | [`SdkPackage`](SdkPackage.md)<`TServiceOperation`\> | - | @@ -35,6 +40,7 @@ title: "[I] SdkContext" | `knownScalars?` | `Record`<`string`, [`SdkBuiltInKinds`](../type-aliases/SdkBuiltInKinds.md)\> | `TCGCContext.knownScalars` | | `modelsMap?` | `Map`<`Type`, [`SdkEnumType`](SdkEnumType.md) \| [`SdkModelType`](SdkModelType.md)\> | `TCGCContext.modelsMap` | | `operationModelsMap?` | `Map`<`Operation`, `Map`<`Type`, [`SdkEnumType`](SdkEnumType.md) \| [`SdkModelType`](SdkModelType.md)\>\> | `TCGCContext.operationModelsMap` | +| `originalProgram` | `Program` | `TCGCContext.originalProgram` | | `packageName?` | `string` | `TCGCContext.packageName` | | `program` | `Program` | `TCGCContext.program` | | `unionsMap?` | `Map`<`Union`, [`SdkUnionType`](SdkUnionType.md)\> | `TCGCContext.unionsMap` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkEmitterOptions.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkEmitterOptions.md index d15667f623..bb9c36ec3d 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkEmitterOptions.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkEmitterOptions.md @@ -7,6 +7,7 @@ title: "[I] SdkEmitterOptions" | Property | Type | | :------ | :------ | +| `api-version?` | `string` | | `filter-out-core-models?` | `boolean` | | `flatten-union-as-enum?` | `boolean` | | `generate-convenience-methods?` | `boolean` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkInitializationType.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkInitializationType.md index cf2f1d3199..1d1eb9aab9 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkInitializationType.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkInitializationType.md @@ -14,6 +14,7 @@ title: "[I] SdkInitializationType" | `__raw?` | `Type` | - | [`SdkModelType`](SdkModelType.md).`__raw` | [`SdkModelType`](SdkModelType.md).`__raw` | | `access?` | [`AccessFlags`](../type-aliases/AccessFlags.md) | - | [`SdkModelType`](SdkModelType.md).`access` | [`SdkModelType`](SdkModelType.md).`access` | | `additionalProperties?` | [`SdkType`](../type-aliases/SdkType.md) | - | [`SdkModelType`](SdkModelType.md).`additionalProperties` | [`SdkModelType`](SdkModelType.md).`additionalProperties` | +| `additionalPropertiesNullable?` | `boolean` | - | [`SdkModelType`](SdkModelType.md).`additionalPropertiesNullable` | [`SdkModelType`](SdkModelType.md).`additionalPropertiesNullable` | | `apiVersions` | `string`[] | - | [`SdkModelType`](SdkModelType.md).`apiVersions` | [`SdkModelType`](SdkModelType.md).`apiVersions` | | `baseModel?` | [`SdkModelType`](SdkModelType.md) | - | [`SdkModelType`](SdkModelType.md).`baseModel` | [`SdkModelType`](SdkModelType.md).`baseModel` | | `crossLanguageDefinitionId` | `string` | - | [`SdkModelType`](SdkModelType.md).`crossLanguageDefinitionId` | [`SdkModelType`](SdkModelType.md).`crossLanguageDefinitionId` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroPagingServiceMethod.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroPagingServiceMethod.md index 5cbdd9cf2d..5e25fd6206 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroPagingServiceMethod.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroPagingServiceMethod.md @@ -22,6 +22,7 @@ title: "[I] SdkLroPagingServiceMethod" | `__raw_paged_metadata` | `PagedResultMetadata` | `SdkPagingServiceMethodOptions.__raw_paged_metadata` | | `access` | `undefined` \| [`AccessFlags`](../type-aliases/AccessFlags.md) | `SdkServiceMethodBase.access` | | `apiVersions` | `string`[] | `SdkServiceMethodBase.apiVersions` | +| `crossLanguageDefintionId` | `string` | `SdkServiceMethodBase.crossLanguageDefintionId` | | `description?` | `string` | `SdkServiceMethodBase.description` | | `details?` | `string` | `SdkServiceMethodBase.details` | | `exception?` | [`SdkMethodResponse`](SdkMethodResponse.md) | `SdkServiceMethodBase.exception` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroServiceMethod.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroServiceMethod.md index 8f82f802cd..ffa5ef9ee1 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroServiceMethod.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkLroServiceMethod.md @@ -21,6 +21,7 @@ title: "[I] SdkLroServiceMethod" | `__raw_lro_metadata` | `LroMetadata` | `SdkLroServiceMethodOptions.__raw_lro_metadata` | | `access` | `undefined` \| [`AccessFlags`](../type-aliases/AccessFlags.md) | `SdkServiceMethodBase.access` | | `apiVersions` | `string`[] | `SdkServiceMethodBase.apiVersions` | +| `crossLanguageDefintionId` | `string` | `SdkServiceMethodBase.crossLanguageDefintionId` | | `description?` | `string` | `SdkServiceMethodBase.description` | | `details?` | `string` | `SdkServiceMethodBase.details` | | `exception?` | [`SdkMethodResponse`](SdkMethodResponse.md) | `SdkServiceMethodBase.exception` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkModelType.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkModelType.md index 25fe05e86f..8340a2e540 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkModelType.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkModelType.md @@ -14,6 +14,7 @@ title: "[I] SdkModelType" | `__raw?` | `Type` | - | `SdkTypeBase.__raw` | `SdkTypeBase.__raw` | | `access?` | [`AccessFlags`](../type-aliases/AccessFlags.md) | - | - | - | | `additionalProperties?` | [`SdkType`](../type-aliases/SdkType.md) | - | - | - | +| `additionalPropertiesNullable?` | `boolean` | - | - | - | | `apiVersions` | `string`[] | - | - | - | | `baseModel?` | [`SdkModelType`](SdkModelType.md) | - | - | - | | `crossLanguageDefinitionId` | `string` | - | - | - | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPackage.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPackage.md index f4a3deb0e7..f205412701 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPackage.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPackage.md @@ -11,11 +11,12 @@ title: "[I] SdkPackage" ## Properties -| Property | Type | -| :------ | :------ | -| `clients` | [`SdkClientType`](SdkClientType.md)<`TServiceOperation`\>[] | -| `diagnostics` | readonly `Diagnostic`[] | -| `enums` | [`SdkEnumType`](SdkEnumType.md)[] | -| `models` | [`SdkModelType`](SdkModelType.md)[] | -| `name` | `string` | -| `rootNamespace` | `string` | +| Property | Type | Description | +| :------ | :------ | :------ | +| `clients` | [`SdkClientType`](SdkClientType.md)<`TServiceOperation`\>[] | - | +| `crossLanguagePackageId` | `string` | - | +| ~~`diagnostics`~~ | readonly `Diagnostic`[] | **Deprecated**
This property is deprecated. Look at `.diagnostics` on SdkContext instead | +| `enums` | [`SdkEnumType`](SdkEnumType.md)[] | - | +| `models` | [`SdkModelType`](SdkModelType.md)[] | - | +| `name` | `string` | - | +| `rootNamespace` | `string` | - | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPagingServiceMethod.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPagingServiceMethod.md index 12d3289a52..167cec6144 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPagingServiceMethod.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/interfaces/SdkPagingServiceMethod.md @@ -21,6 +21,7 @@ title: "[I] SdkPagingServiceMethod" | `__raw_paged_metadata` | `PagedResultMetadata` | `SdkPagingServiceMethodOptions.__raw_paged_metadata` | | `access` | `undefined` \| [`AccessFlags`](../type-aliases/AccessFlags.md) | `SdkServiceMethodBase.access` | | `apiVersions` | `string`[] | `SdkServiceMethodBase.apiVersions` | +| `crossLanguageDefintionId` | `string` | `SdkServiceMethodBase.crossLanguageDefintionId` | | `description?` | `string` | `SdkServiceMethodBase.description` | | `details?` | `string` | `SdkServiceMethodBase.details` | | `exception?` | [`SdkMethodResponse`](SdkMethodResponse.md) | `SdkServiceMethodBase.exception` | diff --git a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/variables/$lib.md b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/variables/$lib.md index 1d188402af..17c79e0e81 100644 --- a/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/variables/$lib.md +++ b/packages/website/versioned_docs/version-latest/libraries/typespec-client-generator-core/reference/js-api/variables/$lib.md @@ -33,10 +33,18 @@ const $lib: TypeSpecLibrary, never>; | `invalid-encode.wrongType` | `CallableMessage`<[`string`, `string`]\> | - | | `invalid-usage` | `Object` | - | | `invalid-usage.default` | `string` | - | +| `multiple-response-types` | `Object` | - | +| `multiple-response-types.default` | `CallableMessage`<[`string`, `string`]\> | - | | `multiple-services` | `Object` | - | | `multiple-services.default` | `CallableMessage`<[`string`]\> | - | +| `no-corresponding-method-param` | `Object` | - | +| `no-corresponding-method-param.default` | `string` | - | +| `no-emitter-name` | `Object` | - | +| `no-emitter-name.default` | `CallableMessage`<[]\> | - | | `server-param-not-path` | `Object` | - | | `server-param-not-path.default` | `CallableMessage`<[`string`, `string`]\> | - | +| `unexpected-http-param-type` | `Object` | - | +| `unexpected-http-param-type.default` | `CallableMessage`<[`string`, `string`, `string`]\> | - | | `union-null` | `Object` | - | | `union-null.default` | `string` | "Cannot have a union containing only null types." | | `union-unsupported` | `Object` | - | @@ -46,6 +54,8 @@ const $lib: TypeSpecLibrary, never>; | `unknown-client-format.default` | `CallableMessage`<[`string`, `string`]\> | - | | `unsupported-kind` | `Object` | - | | `unsupported-kind.default` | `CallableMessage`<[`string`]\> | - | +| `unsupported-protocol` | `Object` | - | +| `unsupported-protocol.default` | `CallableMessage`<[]\> | - | | `use-enum-instead` | `Object` | - | | `use-enum-instead.default` | `string` | "Use enum instead of union of string or number literals. Falling back to the literal type." | | `wrong-client-decorator` | `Object` | - | diff --git a/packages/website/versioned_docs/version-latest/release-notes/release-2024-03-05.md b/packages/website/versioned_docs/version-latest/release-notes/release-2024-03-05.md index a7b7625812..ce72825b63 100644 --- a/packages/website/versioned_docs/version-latest/release-notes/release-2024-03-05.md +++ b/packages/website/versioned_docs/version-latest/release-notes/release-2024-03-05.md @@ -6,7 +6,7 @@ title: March 2024 See TypeSpec Core [release notes](https://typespec.io/docs/release-notes/release-2024-03-05) -:::warn +:::warning This release contains breaking changes in typespec core. ::: diff --git a/packages/website/versioned_docs/version-latest/release-notes/release-2024-04-02.md b/packages/website/versioned_docs/version-latest/release-notes/release-2024-04-02.md index 8e3b1950a6..36c0f1d89c 100644 --- a/packages/website/versioned_docs/version-latest/release-notes/release-2024-04-02.md +++ b/packages/website/versioned_docs/version-latest/release-notes/release-2024-04-02.md @@ -6,7 +6,7 @@ title: 0.41.0 March 2024 See TypeSpec Core 0.55 [release notes](https://typespec.io/docs/release-notes/release-2024-04-02) -:::warn +:::warning This release contains breaking changes ::: diff --git a/packages/website/versioned_docs/version-latest/release-notes/release-2024-05-07.md b/packages/website/versioned_docs/version-latest/release-notes/release-2024-05-07.md new file mode 100644 index 0000000000..cac0d055de --- /dev/null +++ b/packages/website/versioned_docs/version-latest/release-notes/release-2024-05-07.md @@ -0,0 +1,145 @@ +--- +title: 0.42.0 May 2024 +--- + +# Release Notes Version 0.42.0 - May 2024 + +See TypeSpec Core 0.56 [release notes](https://typespec.io/docs/release-notes/release-2024-05-07) + +:::warning +This release contains breaking changes +::: + +## Breaking Changes + +### @azure-tools/typespec-autorest + +- [#774](https://github.com/Azure/typespec-azure/pull/774) Version enum is now omitted by default. Use `version-enum-strategy: include` to revert behavior. + +### @azure-tools/typespec-azure-core + +- [#521](https://github.com/Azure/typespec-azure/pull/521) Switching ProvisioningState from enum to Open union + +### @azure-tools/typespec-azure-resource-manager + +- [#521](https://github.com/Azure/typespec-azure/pull/521) Switching ProvisioningState from enum to Open union + +## Deprecations + +### @azure-tools/typespec-azure-resource-manager + +- [899f640](https://github.com/Azure/typespec-azure/commit/899f6406b503781173669bcddcde8a82bc74ed38) Renaming internal TypeSpec ARM foundation model names to be consistent with ARM common-type definitions. + However, these are `Azure.Resource.Manager.Foundations` models that would not normally be used directly in service specs. + +- Deprecate `Foundations.ArmResource`. `Foundations.Resource` should be used instead. + +- Deprecate `Foundations.ResourceSkuType`. `Foundations.Sku` should be used instead. + +- Deprecate `Foundations.ResourcePlanType`. `Foundations.Plan` should be used instead. + +- Deprecate `Foundations.TrackedResourceBase`. `Foundations.TrackedResource` should be used instead. + +- Deprecate `Foundations.ProxyResourceBase`. `Foundations.ProxyResource` should be used instead. + +- Deprecate `Foundations.ExtensionResourceBase`. `Foundations.ExtensionResource` should be used instead. + +Standardizing mix-in model names with consistent `Property` suffix. + +- Deprecate `ManagedServiceIdentity`. `ManagedServiceIdentityProperty` should be used instead. + + Example: + + ```diff + -...ManagedServiceIdentity; + +...ManagedServiceIdentityProperty; + ``` + +- Deprecate `ManagedSystemAssignedIdentity`. `ManagedSystemAssignedIdentityProperty` should be used instead. + + Example: + + ```diff + -...ManagedSystemAssignedIdentity; + +...ManagedSystemAssignedIdentityProperty; + ``` + +- Deprecate `EntityTag`. `EntityTagProperty` should be used instead. + + Example: + + ```diff + -...EntityTag; + +...EntityTagProperty; + ``` + +- Deprecate `ResourceKind`. `ResourceKindProperty` should be used instead. + + Example: + + ```diff + -...ResourceKind; + +...ResourceKindProperty; + ``` + +- Deprecate `ResourcePlan`. `ResourcePlanProperty` should be used instead. + + Example: + + ```diff + -...ResourcePlan; + +...ResourcePlanProperty; + ``` + +- Deprecate `ResourceSku`. `ResourceSkuProperty` should be used instead. + + Example: + + ```diff + -...ResourceSku; + +...ResourceSkuProperty; + ``` + +- Deprecate `ManagedBy`. `ManagedByProperty` should be used instead. + + Example: + + ```diff + -...ManagedBy; + +...ManagedByProperty; + ``` + +## Features + +### @azure-tools/typespec-autorest + +- [#765](https://github.com/Azure/typespec-azure/pull/765) [API] Refactor to provide functions to get the OpenAPI programtically + +### @azure-tools/typespec-azure-resource-manager + +- [#661](https://github.com/Azure/typespec-azure/pull/661) Fixing ArmResource base model and add an easier way to define Resource Name parameter +- [#736](https://github.com/Azure/typespec-azure/pull/736) Adding standard ExtendedLocation definition for ARM library + +## Bug Fixes + +### @azure-tools/typespec-autorest + +- [#745](https://github.com/Azure/typespec-azure/pull/745) prevent tcgc versioning projection +- [#293](https://github.com/Azure/typespec-azure/pull/293) Add support for new `@body` `@bodyRoot` and `@bodyIgnore` decorators + +### @azure-tools/typespec-azure-core + +- [#619](https://github.com/Azure/typespec-azure/pull/619) Add `no-generic-numeric` rule to disable LintDiff `IntegerTypeMustHaveFormat` +- [#760](https://github.com/Azure/typespec-azure/pull/760) Fix `rpc-operation-request-body` rule not actually checking for a body parameter. +- [#694](https://github.com/Azure/typespec-azure/pull/694) Fix crash when `Traits` builders gets passed non model +- [#710](https://github.com/Azure/typespec-azure/pull/710) Exempt versioning enums and discriminator enum/unions from `documentation-required` rule. +- [#740](https://github.com/Azure/typespec-azure/pull/740) Require documentation on most unions. +- [#293](https://github.com/Azure/typespec-azure/pull/293) Update to support new meaning of `@body` + +### @azure-tools/typespec-azure-resource-manager + +- [#605](https://github.com/Azure/typespec-azure/pull/605) Specify the fully qualified name of `@OpenAPI.extension` decorator in `missing-x-ms-identifiers` linter warning. +- [#400](https://github.com/Azure/typespec-azure/pull/400) Updated `ManagedIndentity` and `CustomerManagedKey` TypeSpec model definition to be consistent with Swagger commont-types +- [#567](https://github.com/Azure/typespec-azure/pull/567) Enable `arm-common-types-version` rule by default. +- [#751](https://github.com/Azure/typespec-azure/pull/751) Allow `@pattern` to be provided on a scalar +- [#702](https://github.com/Azure/typespec-azure/pull/702) Fix `arm-resource-name-pattern` rule codefix producing invalid syntax +- [#293](https://github.com/Azure/typespec-azure/pull/293) Update to support new meaning of `@body`