diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/back-compatible.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/back-compatible.tsp new file mode 100644 index 000000000000..02174c5a5d77 --- /dev/null +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/back-compatible.tsp @@ -0,0 +1,25 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; +using Microsoft.AppComplianceAutomation; + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" +@@Azure.ClientGenerator.Core.Legacy.flattenProperty(EvidenceResource.properties, + "autorest,go,python,javascript" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" +@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ReportResource.properties, + "autorest,go,python,javascript" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" +@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ScopingConfigurationResource.properties, + "autorest,go,python,javascript" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" +@@Azure.ClientGenerator.Core.Legacy.flattenProperty(SnapshotResource.properties, + "autorest,go,python,javascript" +); +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" +@@Azure.ClientGenerator.Core.Legacy.flattenProperty(WebhookResource.properties, + "autorest,go,python,javascript" +); diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/client.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/client.tsp index 745941d727e8..6bd4387d9804 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/client.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/client.tsp @@ -2,8 +2,225 @@ import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; +using Azure.Core; +using Azure.ResourceManager.Foundations; +using Microsoft.AppComplianceAutomation; @@clientName(Microsoft.AppComplianceAutomation, "AppComplianceAutomationMgmt", "python" ); + +@@alternateType(Azure.ResourceManager.CommonTypes.Resource.id, + armResourceIdentifier, + "csharp" +); +@@clientName(EvidenceResource, "AppComplianceReportEvidence", "csharp"); +@@clientName(EvidenceProperties, + "AppComplianceReportEvidenceProperties", + "csharp" +); +@@clientName(ReportResource, "AppComplianceReport", "csharp"); +@@clientName(ScopingConfigurationResource, + "AppComplianceReportScopingConfiguration", + "csharp" +); +@@clientName(ScopingConfigurationProperties, + "AppComplianceReportScopingConfigurationProperties", + "csharp" +); +@@usage(SnapshotResource, Usage.input | Usage.output, "csharp"); +@@clientName(SnapshotResource, "AppComplianceReportSnapshot", "csharp"); +@@clientName(SnapshotProperties, + "AppComplianceReportSnapshotProperties", + "csharp" +); +@@clientName(WebhookResource, "AppComplianceReportWebhook", "csharp"); +@@clientName(WebhookProperties, + "AppComplianceReportWebhookProperties", + "csharp" +); +@@alternateType(WebhookProperties.payloadUrl, url, "csharp"); +@@alternateType(WebhookProperties.tenantId, uuid, "csharp"); +@@clientName(SendAllEvents, "SendAllEvent", "csharp"); +@@clientName(Category, "AppComplianceCategory", "csharp"); +@@clientName(CategoryStatus, "AppComplianceCategoryStatus", "csharp"); +@@clientName(ProviderActions.checkNameAvailability, + "CheckAppComplianceReportNameAvailability", + "csharp" +); +@@clientName(Report.checkNameAvailability, + "CheckAppComplianceReportNestedResourceNameAvailability", + "csharp" +); +@@clientName(CheckNameAvailabilityReason, + "AppComplianceReportNameUnavailabilityReason", + "csharp" +); +@@clientName(CheckNameAvailabilityRequest, + "AppComplianceReportNameAvailabilityContent", + "csharp" +); +@@clientName(CheckNameAvailabilityRequest.type, "ResourceType", "csharp"); +@@clientName(CheckNameAvailabilityResponse, + "AppComplianceReportNameAvailabilityResult", + "csharp" +); +@@clientName(CheckNameAvailabilityResponse.nameAvailable, + "IsNameAvailable", + "csharp" +); +@@alternateType(CheckNameAvailabilityRequest.type, armResourceType, "csharp"); +@@clientName(ComplianceReportItem, "AppComplianceReportItem", "csharp"); +@@alternateType(ComplianceReportItem.resourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType(ComplianceReportItem.resourceType, armResourceType, "csharp"); +@@clientName(ComplianceReportItem.resourceStatusChangeDate, + "ResourceStatusChangedOn", + "csharp" +); +@@clientName(ComplianceResult, "AppComplianceResult", "csharp"); +@@clientName(ContentType, "WebhookContentType", "csharp"); +@@clientName(Control, "AppComplianceControl", "csharp"); +@@alternateType(Control.controlDescriptionHyperLink, url, "csharp"); +@@clientName(ControlFamily, "AppComplianceControlFamily", "csharp"); +@@clientName(ControlStatus, "AppComplianceControlStatus", "csharp"); +@@clientName(DeliveryStatus, "WebhookDeliveryStatus", "csharp"); +@@clientName(DownloadResponse, "AppComplianceDownloadResult", "csharp"); +@@clientName(DownloadResponseComplianceDetailedPdfReport, + "AppComplianceDetailedPdfReport", + "csharp" +); +@@alternateType(DownloadResponseComplianceDetailedPdfReport.sasUri, + url, + "csharp" +); +@@clientName(DownloadResponseCompliancePdfReport, + "AppCompliancePdfReport", + "csharp" +); +@@alternateType(DownloadResponseCompliancePdfReport.sasUri, url, "csharp"); +@@clientName(DownloadType, "AppComplianceDownloadType", "csharp"); +@@clientName(EvidenceFileDownloadResponse, + "EvidenceFileDownloadResult", + "csharp" +); +@@clientName(EvidenceFileDownloadResponseEvidenceFile, + "EvidenceFileUrlInfo", + "csharp" +); +@@alternateType(EvidenceFileDownloadResponseEvidenceFile.url, url, "csharp"); +@@clientName(EvidenceType, "AppComplianceReportEvidenceType", "csharp"); +@@clientName(GetCollectionCountRequest, + "ReportCollectionGetCountContent", + "csharp" +); +@@clientName(GetCollectionCountRequest.type, + "GetCollectionCountRequestType", + "csharp" +); +@@clientName(GetCollectionCountResponse, + "ReportCollectionGetCountResult", + "csharp" +); +@@clientName(GetOverviewStatusRequest, + "AppComplianceGetOverviewStatusContent", + "csharp" +); +@@clientName(GetOverviewStatusRequest.type, + "GetOverviewStatusRequestType", + "csharp" +); +@@clientName(GetOverviewStatusResponse, + "AppComplianceGetOverviewStatusResult", + "csharp" +); +@@clientName(InputType, "ScopingQuestionInputType", "csharp"); +@@clientName(ListInUseStorageAccountsRequest, + "ReportListInUseStorageAccountsContent", + "csharp" +); +@@clientName(ListInUseStorageAccountsResponse, + "ReportListInUseStorageAccountsResult", + "csharp" +); +@@clientName(NotificationEvent, "WebhookNotificationEvent", "csharp"); +@@clientName(OnboardRequest, "AppComplianceOnboardContent", "csharp"); +@@clientName(OnboardResponse, "AppComplianceOnboardResult", "csharp"); +@@clientName(OverviewStatus, "ReportOverviewStatus", "csharp"); +@@clientName(ProvisioningState, "AppComplianceProvisioningState", "csharp"); +@@clientName(Recommendation, "RecommendationDetails", "csharp"); +@@clientName(ReportPatchProperties, + "AppComplianceReportPatchProperties", + "csharp" +); +@@alternateType(ReportPatchProperties.tenantId, uuid, "csharp"); +@@clientName(ReportProperties, "AppComplianceReportProperties", "csharp"); +@@alternateType(ReportProperties.tenantId, uuid, "csharp"); +@@clientName(ReportStatus, "AppComplianceReportStatus", "csharp"); +@@clientName(ResourceItem, "ReportResourceItem", "csharp"); +@@alternateType(ResourceItem.resourceId, armResourceIdentifier, "csharp"); +@@alternateType(ResourceItem.resourceType, armResourceType, "csharp"); +@@clientName(ResourceMetadata, "ReportResourceMetadata", "csharp"); +@@alternateType(ResourceMetadata.resourceId, armResourceIdentifier, "csharp"); +@@alternateType(ResourceMetadata.resourceType, armResourceType, "csharp"); +@@clientName(ResourceOrigin, "ReportResourceOrigin", "csharp"); +@@clientName(ResourceOrigin.AWS, "Aws", "csharp"); +@@clientName(ResourceOrigin.GCP, "Gcp", "csharp"); +@@clientName(ResourceStatus, "ReportResourceStatus", "csharp"); +@@clientName(Responsibility, "CustomerResponsibility", "csharp"); +@@clientName(ResponsibilityEnvironment.AWS, "Aws", "csharp"); +@@clientName(ResponsibilityEnvironment.GCP, "Gcp", "csharp"); +@@clientName(ResponsibilityResource, "ResponsibilityResourceItem", "csharp"); +@@alternateType(ResponsibilityResource.resourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType(ResponsibilityResource.resourceType, armResourceType, "csharp"); +@@clientName(ResponsibilityResource.resourceStatusChangeDate, + "ResourceStatusChangedOn", + "csharp" +); +@@clientName(Result, "ReportResult", "csharp"); +@@clientName(Rule, "QuestionRuleItem", "csharp"); +@@clientName(StatusItem, "OverviewStatusItem", "csharp"); +@@clientName(StorageInfo, "ReportStorageInfo", "csharp"); +@@alternateType(StorageInfo.location, azureLocation, "csharp"); +@@clientName(SyncCertRecordResponse, "SyncCertRecordResult", "csharp"); +@@clientName(TriggerEvaluationResponse, "TriggerEvaluationResult", "csharp"); +@@alternateType(QuickAssessment.resourceId, armResourceIdentifier, "csharp"); +@@clientName(QuickAssessment.timestamp, "CreatedOn", "csharp"); +@@clientName(SnapshotDownloadRequest, + "SnapshotDownloadRequestContent", + "csharp" +); +@@clientName(TriggerEvaluationRequest, "TriggerEvaluationContent", "csharp"); +@@alternateType(SnapshotDownloadRequest.reportCreatorTenantId, uuid, "csharp"); +@@clientName(SyncCertRecordRequest, "SyncCertRecordContent", "csharp"); +@@clientName(EvidenceFileDownloadRequest, + "EvidenceFileDownloadRequestContent", + "csharp" +); +@@alternateType(EvidenceFileDownloadRequest.reportCreatorTenantId, + uuid, + "csharp" +); +@@clientName(ProviderActions.getCollectionCount, + "GetCollectionCountProviderAction", + "csharp" +); +@@clientName(ProviderActions.listInUseStorageAccounts, + "GetInUseStorageAccountsProviderAction", + "csharp" +); +@@clientName(ProviderActions.getOverviewStatus, + "GetOverviewStatusProviderAction", + "csharp" +); +@@clientName(ProviderActions.onboard, "OnboardProviderAction", "csharp"); +@@clientName(ProviderActions.triggerEvaluation, + "TriggerEvaluationProviderAction", + "csharp" +); diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/main.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/main.tsp index 761e7db631ba..c1ba9b5f2b1c 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/main.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/main.tsp @@ -3,6 +3,7 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; import "./models/models.tsp"; +import "./back-compatible.tsp"; import "./resources/ReportResource.tsp"; import "./resources/WebhookResource.tsp"; import "./resources/SnapshotResource.tsp"; diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/EvidenceResource.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/EvidenceResource.tsp index 9f4f5d3a9003..5b5260605cd1 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/EvidenceResource.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/EvidenceResource.tsp @@ -36,8 +36,6 @@ model EvidenceResource extends Azure.ResourceManager.Foundations.ProxyResource { /** * Evidence property. */ - #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" - @Azure.ClientGenerator.Core.Legacy.flattenProperty("!java") properties: EvidenceProperties; } diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ReportResource.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ReportResource.tsp index 18db5de4307d..c0fd92c914f0 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ReportResource.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ReportResource.tsp @@ -35,8 +35,6 @@ model ReportResource extends Azure.ResourceManager.Foundations.ProxyResource { /** * Report property. */ - #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" - @Azure.ClientGenerator.Core.Legacy.flattenProperty("!java") properties: ReportProperties; } diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ScopingConfigurationResource.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ScopingConfigurationResource.tsp index fd8687d20c7e..9770db143cd5 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ScopingConfigurationResource.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ScopingConfigurationResource.tsp @@ -41,8 +41,6 @@ model ScopingConfigurationResource /** * ScopingConfiguration property. */ - #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" - @Azure.ClientGenerator.Core.Legacy.flattenProperty("!java") properties: ScopingConfigurationProperties; } diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/SnapshotResource.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/SnapshotResource.tsp index 49da5270d5db..9f6198408a07 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/SnapshotResource.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/SnapshotResource.tsp @@ -34,8 +34,6 @@ model SnapshotResource extends Azure.ResourceManager.Foundations.ProxyResource { /** * Snapshot's property. */ - #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" - @Azure.ClientGenerator.Core.Legacy.flattenProperty("!java") properties?: SnapshotProperties; } diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/WebhookResource.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/WebhookResource.tsp index 2f407e4eba6e..8671fe1a8819 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/WebhookResource.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/WebhookResource.tsp @@ -40,8 +40,6 @@ model WebhookResource extends Azure.ResourceManager.Foundations.ProxyResource { /** * Webhook property. */ - #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Legacy flatten" - @Azure.ClientGenerator.Core.Legacy.flattenProperty("!java") properties: WebhookProperties; // Replace 'WebhookProperties' with the actual type } diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/routes.tsp b/specification/appcomplianceautomation/AppComplianceAutomation.Management/routes.tsp index 00e1e5274eed..17cf51956c1e 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/routes.tsp +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/routes.tsp @@ -24,7 +24,11 @@ alias ArmProviderActionAsync< Response | ArmAcceptedLroResponse<"Accepted", LroHeaders>, BaseParameters = ApiVersionParameter, Parameters = Parameters, - LroHeaders = ArmLroLocationHeader> + LroHeaders = ArmLroLocationHeader< + Azure.Core.StatusMonitorPollingOptions, + Response, + string + > >; alias ArmProviderActionSync< diff --git a/specification/appcomplianceautomation/AppComplianceAutomation.Management/tspconfig.yaml b/specification/appcomplianceautomation/AppComplianceAutomation.Management/tspconfig.yaml index 38de71ed0cf2..ca7595869b0d 100644 --- a/specification/appcomplianceautomation/AppComplianceAutomation.Management/tspconfig.yaml +++ b/specification/appcomplianceautomation/AppComplianceAutomation.Management/tspconfig.yaml @@ -39,6 +39,9 @@ options: generate-fakes: true head-as-boolean: true inject-spans: true + "@azure-typespec/http-client-csharp-mgmt": + namespace: "Azure.ResourceManager.AppComplianceAutomation" + emitter-output-dir: "{output-dir}/{service-dir}/{namespace}" linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager"