diff --git a/specification/impact/Impact.Management/client.tsp b/specification/impact/Impact.Management/client.tsp index 71dc7f0a1d72..336babba65c1 100644 --- a/specification/impact/Impact.Management/client.tsp +++ b/specification/impact/Impact.Management/client.tsp @@ -1,8 +1,13 @@ import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; +import "@typespec/versioning"; +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; using Azure.Core; using Azure.ClientGenerator.Core; +using Azure.ResourceManager; using Microsoft.Impact; @@clientName(Microsoft.Impact, "ImpactReportingMgmtClient", "java"); @@ -74,3 +79,38 @@ using Microsoft.Impact; Azure.Core.armResourceIdentifier, "csharp" ); + +// JavaScript SDK visibility workaround: +// For write operations whose body models contain server-side read-only properties +// that are also required, provide write-specific models that omit those fields so +// JS SDK users are not forced to supply server-computed values. +// Pattern: https://github.com/Azure/azure-rest-api-specs/pull/42784 +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "Write-only helper models for JS SDK alternate types; operations are defined on the original resources in connectors.tsp" +namespace Microsoft.Impact { + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "" + @doc("Connector properties for create/update operations, omitting server-side read-only fields (connectorId, tenantId, lastRunTimeStamp, processingState, processingStateMessage are required+read-only in the canonical model).") + model ConnectorPropertiesCreate { + @doc("connector type") + connectorType: Platform; + } + + @subscriptionResource + @doc("Connector resource for create/update operations.") + model ConnectorResourceCreate + is Azure.ResourceManager.ProxyResource { + @doc("The name of the connector") + @pattern("^[a-zA-Z0-9-]{3,24}$") + @key("connectorName") + @segment("connectors") + @path + name: string; + + ...ConnectorManagedUserAssignedIdentityProperty; + } +} + +@@alternateType( + Connectors.createOrUpdate::parameters.resource, + ConnectorResourceCreate, + "javascript" +); diff --git a/specification/impact/Impact.Management/connectors.tsp b/specification/impact/Impact.Management/connectors.tsp index 38c3329466b2..f1f33d887a21 100644 --- a/specification/impact/Impact.Management/connectors.tsp +++ b/specification/impact/Impact.Management/connectors.tsp @@ -92,12 +92,25 @@ union Platform { @doc("Type of Azure Monitor") AzureMonitor: "AzureMonitor", } +@doc("The type used for update operations of the Connector.") +model ConnectorUpdate + is OptionalProperties>> { + /** The resource-specific properties for this resource. */ + properties?: ConnectorUpdateProperties; +} +model ConnectorUpdateProperties is Azure.ResourceManager.Foundations.ResourceUpdateModelProperties< + Connector, + ConnectorProperties +>; @armResourceOperations(Connector) interface Connectors { get is ArmResourceRead; createOrUpdate is ArmResourceCreateOrReplaceAsync; - update is ArmResourcePatchSync; + update is ArmCustomPatchSync; delete is ArmResourceDeleteSync; listBySubscription is ArmListBySubscription; } diff --git a/specification/impact/Impact.Management/tspconfig.yaml b/specification/impact/Impact.Management/tspconfig.yaml index c1b8484c2cc1..608a95053149 100644 --- a/specification/impact/Impact.Management/tspconfig.yaml +++ b/specification/impact/Impact.Management/tspconfig.yaml @@ -10,6 +10,7 @@ linter: options: "@azure-tools/typespec-autorest": use-read-only-status-schema: true + omit-unreachable-types: true emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/impact.json" diff --git a/specification/impact/resource-manager/Microsoft.Impact/preview/2025-01-01-preview/impact.json b/specification/impact/resource-manager/Microsoft.Impact/preview/2025-01-01-preview/impact.json index 151e795dbc7e..44782e83155a 100644 --- a/specification/impact/resource-manager/Microsoft.Impact/preview/2025-01-01-preview/impact.json +++ b/specification/impact/resource-manager/Microsoft.Impact/preview/2025-01-01-preview/impact.json @@ -898,29 +898,6 @@ } }, "definitions": { - "AdditionalField": { - "type": "object", - "description": "additional user defined field.", - "properties": { - "name": { - "type": "string", - "description": "name of the field." - }, - "value": { - "type": "string", - "description": "value of the field." - } - }, - "required": [ - "name", - "value" - ] - }, - "Azure.Core.uuid": { - "type": "string", - "format": "uuid", - "description": "Universally Unique Identifier" - }, "ClientIncidentDetails": { "type": "object", "description": "Client incident details ex: incidentId , incident source", @@ -1028,16 +1005,6 @@ "value" ] }, - "ConnectorManagedUserAssignedIdentityProperty": { - "type": "object", - "description": "The managed service identities envelope.", - "properties": { - "identity": { - "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssigned", - "description": "The managed service identities assigned to this resource." - } - } - }, "ConnectorProperties": { "type": "object", "description": "Details of the Connector.", @@ -1087,34 +1054,29 @@ "processingStateMessage" ] }, - "ConnectorPropertiesUpdate": { + "ConnectorUpdate": { "type": "object", - "description": "Details of the Connector.", + "description": "The type used for update operations of the Connector.", "properties": { - "connectorType": { - "$ref": "#/definitions/Platform", - "description": "connector type" + "identity": { + "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssigned", + "description": "The managed service identities assigned to this resource." + }, + "properties": { + "$ref": "#/definitions/ConnectorUpdateProperties", + "description": "The resource-specific properties for this resource." } } }, - "ConnectorUpdate": { + "ConnectorUpdateProperties": { "type": "object", - "description": "A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft.", + "description": "The updatable properties of the Connector.", "properties": { - "properties": { - "$ref": "#/definitions/ConnectorPropertiesUpdate", - "description": "The resource-specific properties for this resource." - }, - "identity": { - "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssignedUpdate", - "description": "The managed service identities assigned to this resource." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "connectorType": { + "$ref": "#/definitions/Platform", + "description": "connector type" } - ] + } }, "Content": { "type": "object", @@ -1213,36 +1175,6 @@ } ] }, - "ImpactCategoryEnum": { - "type": "string", - "description": "List of impact categories.", - "enum": [ - "Availability", - "Performance", - "Other" - ], - "x-ms-enum": { - "name": "ImpactCategoryEnum", - "modelAsString": true, - "values": [ - { - "name": "Availability", - "value": "Availability", - "description": "Availability category" - }, - { - "name": "Performance", - "value": "Performance", - "description": "Performance category" - }, - { - "name": "Other", - "value": "Other", - "description": "Other category" - } - ] - } - }, "ImpactCategoryListResult": { "type": "object", "description": "The response of a ImpactCategory list operation.", @@ -1329,19 +1261,6 @@ "impactId" ] }, - "ImpactedResource": { - "type": "object", - "description": "impacted azure resource id.", - "properties": { - "impactedResourceId": { - "type": "string", - "description": "impacted azure resource id" - } - }, - "required": [ - "impactedResourceId" - ] - }, "IncidentSource": { "type": "string", "description": "List of incident interfaces.", @@ -1399,79 +1318,6 @@ } ] }, - "InsightCategoryGroup": { - "type": "object", - "description": "Group of insights for a category", - "properties": { - "category": { - "type": "string", - "description": "Category name" - }, - "status": { - "type": "string", - "description": "Status of the insights in this category" - }, - "insights": { - "type": "array", - "description": "List of insight references in this category", - "items": { - "$ref": "#/definitions/InsightReference" - }, - "x-ms-identifiers": [ - "id" - ] - } - }, - "required": [ - "category" - ] - }, - "InsightCustomResourceCommonParameters": { - "type": "object", - "description": "context of post call for insight", - "properties": { - "apiVersion": { - "type": "string", - "description": "The API version to use for this operation.", - "minLength": 1 - }, - "subscriptionId": { - "$ref": "#/definitions/Azure.Core.uuid", - "description": "The ID of the target subscription. The value must be an UUID.", - "minLength": 1 - }, - "provider": { - "type": "string", - "description": "The provider namespace for the resource.", - "enum": [ - "Microsoft.Impact" - ], - "x-ms-enum": { - "modelAsString": false - } - }, - "azureResourceId": { - "type": "string", - "description": "Filter by resource type", - "minLength": 1 - } - }, - "required": [ - "apiVersion", - "subscriptionId", - "provider" - ] - }, - "InsightDetails": { - "type": "object", - "description": "Body of the get all insights", - "properties": { - "azureResourceId": { - "type": "string", - "description": "The ID of the azure resource." - } - } - }, "InsightListResult": { "type": "object", "description": "The response of a Insight list operation.", @@ -1547,34 +1393,6 @@ "impact" ] }, - "InsightReference": { - "type": "object", - "description": "Reference to an Insight resource", - "properties": { - "id": { - "type": "string", - "description": "Azure resource ID of the insight" - } - }, - "required": [ - "id" - ] - }, - "InsightUnderSubscription": { - "type": "object", - "description": "Insight resource", - "properties": { - "properties": { - "$ref": "#/definitions/InsightProperties", - "description": "The resource-specific properties for this resource." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" - } - ] - }, "ManagedServiceIdentityOnlyUserAssigned": { "type": "object", "description": "Managed service identity (system assigned and/or user assigned identities)", @@ -1596,24 +1414,6 @@ "type" ] }, - "ManagedServiceIdentityOnlyUserAssignedUpdate": { - "type": "object", - "description": "Managed service identity (system assigned and/or user assigned identities)", - "properties": { - "type": { - "$ref": "#/definitions/ManagedServiceIdentityTypeOnlyUserAssigned", - "description": "The type of managed identity assigned to this resource." - }, - "userAssignedIdentities": { - "type": "object", - "description": "The identities assigned to this resource by the user.", - "additionalProperties": { - "$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity", - "x-nullable": true - } - } - } - }, "ManagedServiceIdentityTypeOnlyUserAssigned": { "type": "string", "description": "Type of managed service identity, where only UserAssigned type is allowed.", diff --git a/specification/impact/resource-manager/Microsoft.Impact/preview/2026-01-01-preview/impact.json b/specification/impact/resource-manager/Microsoft.Impact/preview/2026-01-01-preview/impact.json index 67b44e2aee40..565b082f41df 100644 --- a/specification/impact/resource-manager/Microsoft.Impact/preview/2026-01-01-preview/impact.json +++ b/specification/impact/resource-manager/Microsoft.Impact/preview/2026-01-01-preview/impact.json @@ -898,29 +898,6 @@ } }, "definitions": { - "AdditionalField": { - "type": "object", - "description": "additional user defined field.", - "properties": { - "name": { - "type": "string", - "description": "name of the field." - }, - "value": { - "type": "string", - "description": "value of the field." - } - }, - "required": [ - "name", - "value" - ] - }, - "Azure.Core.uuid": { - "type": "string", - "format": "uuid", - "description": "Universally Unique Identifier" - }, "ClientIncidentDetails": { "type": "object", "description": "Client incident details ex: incidentId , incident source", @@ -1028,16 +1005,6 @@ "value" ] }, - "ConnectorManagedUserAssignedIdentityProperty": { - "type": "object", - "description": "The managed service identities envelope.", - "properties": { - "identity": { - "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssigned", - "description": "The managed service identities assigned to this resource." - } - } - }, "ConnectorProperties": { "type": "object", "description": "Details of the Connector.", @@ -1087,34 +1054,29 @@ "processingStateMessage" ] }, - "ConnectorPropertiesUpdate": { + "ConnectorUpdate": { "type": "object", - "description": "Details of the Connector.", + "description": "The type used for update operations of the Connector.", "properties": { - "connectorType": { - "$ref": "#/definitions/Platform", - "description": "connector type" + "identity": { + "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssigned", + "description": "The managed service identities assigned to this resource." + }, + "properties": { + "$ref": "#/definitions/ConnectorUpdateProperties", + "description": "The resource-specific properties for this resource." } } }, - "ConnectorUpdate": { + "ConnectorUpdateProperties": { "type": "object", - "description": "A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft.", + "description": "The updatable properties of the Connector.", "properties": { - "properties": { - "$ref": "#/definitions/ConnectorPropertiesUpdate", - "description": "The resource-specific properties for this resource." - }, - "identity": { - "$ref": "#/definitions/ManagedServiceIdentityOnlyUserAssignedUpdate", - "description": "The managed service identities assigned to this resource." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" + "connectorType": { + "$ref": "#/definitions/Platform", + "description": "connector type" } - ] + } }, "Content": { "type": "object", @@ -1213,36 +1175,6 @@ } ] }, - "ImpactCategoryEnum": { - "type": "string", - "description": "List of impact categories.", - "enum": [ - "Availability", - "Performance", - "Other" - ], - "x-ms-enum": { - "name": "ImpactCategoryEnum", - "modelAsString": true, - "values": [ - { - "name": "Availability", - "value": "Availability", - "description": "Availability category" - }, - { - "name": "Performance", - "value": "Performance", - "description": "Performance category" - }, - { - "name": "Other", - "value": "Other", - "description": "Other category" - } - ] - } - }, "ImpactCategoryListResult": { "type": "object", "description": "The response of a ImpactCategory list operation.", @@ -1329,19 +1261,6 @@ "impactId" ] }, - "ImpactedResource": { - "type": "object", - "description": "impacted azure resource id.", - "properties": { - "impactedResourceId": { - "type": "string", - "description": "impacted azure resource id" - } - }, - "required": [ - "impactedResourceId" - ] - }, "IncidentSource": { "type": "string", "description": "List of incident interfaces.", @@ -1426,52 +1345,6 @@ "category" ] }, - "InsightCustomResourceCommonParameters": { - "type": "object", - "description": "context of post call for insight", - "properties": { - "apiVersion": { - "type": "string", - "description": "The API version to use for this operation.", - "minLength": 1 - }, - "subscriptionId": { - "$ref": "#/definitions/Azure.Core.uuid", - "description": "The ID of the target subscription. The value must be an UUID.", - "minLength": 1 - }, - "provider": { - "type": "string", - "description": "The provider namespace for the resource.", - "enum": [ - "Microsoft.Impact" - ], - "x-ms-enum": { - "modelAsString": false - } - }, - "azureResourceId": { - "type": "string", - "description": "Filter by resource type", - "minLength": 1 - } - }, - "required": [ - "apiVersion", - "subscriptionId", - "provider" - ] - }, - "InsightDetails": { - "type": "object", - "description": "Body of the get all insights", - "properties": { - "azureResourceId": { - "type": "string", - "description": "The ID of the azure resource." - } - } - }, "InsightListResult": { "type": "object", "description": "The response of a Insight list operation.", @@ -1560,21 +1433,6 @@ "id" ] }, - "InsightUnderSubscription": { - "type": "object", - "description": "Insight resource", - "properties": { - "properties": { - "$ref": "#/definitions/InsightProperties", - "description": "The resource-specific properties for this resource." - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" - } - ] - }, "ManagedServiceIdentityOnlyUserAssigned": { "type": "object", "description": "Managed service identity (system assigned and/or user assigned identities)", @@ -1596,24 +1454,6 @@ "type" ] }, - "ManagedServiceIdentityOnlyUserAssignedUpdate": { - "type": "object", - "description": "Managed service identity (system assigned and/or user assigned identities)", - "properties": { - "type": { - "$ref": "#/definitions/ManagedServiceIdentityTypeOnlyUserAssigned", - "description": "The type of managed identity assigned to this resource." - }, - "userAssignedIdentities": { - "type": "object", - "description": "The identities assigned to this resource by the user.", - "additionalProperties": { - "$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity", - "x-nullable": true - } - } - } - }, "ManagedServiceIdentityTypeOnlyUserAssigned": { "type": "string", "description": "Type of managed service identity, where only UserAssigned type is allowed.",