From be0b62ca1afbde54e91f3f7f782b679cef8bd426 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:38:47 +0800 Subject: [PATCH 1/4] generate csharp SDK for OperationalInsights --- .../Customizations/Models/DataExport.cs | 16 + .../AvailableServiceTiersOperations.cs | 281 +++ ...ailableServiceTiersOperationsExtensions.cs | 67 + .../Generated/ClustersOperations.cs | 1710 +++++++++++++++++ .../Generated/ClustersOperationsExtensions.cs | 453 +++++ .../Generated/DataExportsOperations.cs | 999 ++++++++++ .../DataExportsOperationsExtensions.cs | 208 ++ .../Generated/DataSourcesOperations.cs | 1204 ++++++++++++ .../DataSourcesOperationsExtensions.cs | 257 +++ .../Generated/DeletedWorkspacesOperations.cs | 431 +++++ .../DeletedWorkspacesOperationsExtensions.cs | 91 + .../Generated/GatewaysOperations.cs | 269 +++ .../Generated/GatewaysOperationsExtensions.cs | 68 + .../IAvailableServiceTiersOperations.cs | 52 + .../Generated/IClustersOperations.cs | 295 +++ .../Generated/IDataExportsOperations.cs | 136 ++ .../Generated/IDataSourcesOperations.cs | 167 ++ .../Generated/IDeletedWorkspacesOperations.cs | 70 + .../Generated/IGatewaysOperations.cs | 52 + .../Generated/IIntelligencePacksOperations.cs | 103 + .../Generated/ILinkedServicesOperations.cs | 198 ++ .../ILinkedStorageAccountsOperations.cs | 144 ++ .../Generated/IManagementGroupsOperations.cs | 52 + .../Generated/IOperationStatusesOperations.cs | 52 + .../IOperationalInsightsManagementClient.cs | 167 ++ .../Generated/IOperations.cs | 68 + .../Generated/ISavedSearchesOperations.cs | 136 ++ .../Generated/ISchemaOperations.cs | 52 + .../Generated/ISharedKeysOperations.cs | 79 + .../IStorageInsightConfigsOperations.cs | 158 ++ .../Generated/ITablesOperations.cs | 281 +++ .../Generated/IUsagesOperations.cs | 52 + .../Generated/IWorkspacePurgeOperations.cs | 93 + .../Generated/IWorkspacesOperations.cs | 237 +++ .../Generated/IntelligencePacksOperations.cs | 712 +++++++ .../IntelligencePacksOperationsExtensions.cs | 155 ++ .../Generated/LinkedServicesOperations.cs | 1074 +++++++++++ .../LinkedServicesOperationsExtensions.cs | 309 +++ .../LinkedStorageAccountsOperations.cs | 978 ++++++++++ ...nkedStorageAccountsOperationsExtensions.cs | 222 +++ .../Generated/ManagementGroupsOperations.cs | 281 +++ .../ManagementGroupsOperationsExtensions.cs | 67 + .../Generated/Models/AssociatedWorkspace.cs | 78 + .../Generated/Models/AvailableServiceTier.cs | 113 ++ .../Generated/Models/AzureEntityResource.cs | 62 + .../Generated/Models/BillingType.cs | 22 + .../Models/CapacityReservationProperties.cs | 62 + .../Generated/Models/Cluster.cs | 192 ++ .../Generated/Models/ClusterEntityStatus.cs | 27 + .../Generated/Models/ClusterPatch.cs | 105 + .../Generated/Models/ClusterSku.cs | 61 + .../Generated/Models/ClusterSkuNameEnum.cs | 21 + .../Generated/Models/Column.cs | 104 + .../Models/ColumnDataTypeHintEnum.cs | 40 + .../Generated/Models/ColumnTypeEnum.cs | 28 + .../Generated/Models/CoreSummary.cs | 70 + .../Generated/Models/CreatedByType.cs | 24 + .../Generated/Models/DataExport.cs | 141 ++ .../Generated/Models/DataIngestionStatus.cs | 45 + .../Generated/Models/DataSource.cs | 134 ++ .../Generated/Models/DataSourceFilter.cs | 81 + .../Generated/Models/DataSourceKind.cs | 53 + .../Generated/Models/DataSourceType.cs | 72 + .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../Generated/Models/ErrorDetail.cs | 85 + .../Generated/Models/ErrorResponse.cs | 56 + .../Models/ErrorResponseException.cs | 62 + .../Generated/Models/Identity.cs | 95 + .../Generated/Models/IdentityType.cs | 66 + .../Generated/Models/IntelligencePack.cs | 70 + .../Generated/Models/KeyVaultProperties.cs | 82 + .../Generated/Models/LinkedService.cs | 99 + .../Models/LinkedServiceEntityStatus.cs | 24 + .../Models/LinkedStorageAccountsResource.cs | 77 + .../Generated/Models/ManagementGroup.cs | 121 ++ .../Generated/Models/MetricName.cs | 60 + .../Generated/Models/Operation.cs | 61 + .../Generated/Models/OperationDisplay.cs | 78 + .../Generated/Models/OperationStatus.cs | 92 + .../Generated/Models/Page.cs | 53 + .../Generated/Models/Page1.cs | 53 + .../Generated/Models/Page2.cs | 53 + .../Models/PrivateLinkScopedResource.cs | 62 + .../Generated/Models/ProvisioningStateEnum.cs | 35 + .../Generated/Models/ProxyResource.cs | 53 + .../Models/PublicNetworkAccessType.cs | 28 + .../Generated/Models/PurgeState.cs | 22 + .../Generated/Models/Resource.cs | 79 + .../Generated/Models/RestoredLogs.cs | 69 + .../Generated/Models/ResultStatistics.cs | 77 + .../Generated/Models/SavedSearch.cs | 168 ++ .../Models/SavedSearchesListResult.cs | 53 + .../Generated/Models/Schema.cs | 162 ++ .../Models/SearchGetSchemaResponse.cs | 61 + .../Generated/Models/SearchMetadata.cs | 185 ++ .../Generated/Models/SearchMetadataSchema.cs | 59 + .../Generated/Models/SearchResults.cs | 95 + .../Generated/Models/SearchSchemaValue.cs | 117 ++ .../Generated/Models/SearchSort.cs | 62 + .../Generated/Models/SearchSortEnum.cs | 22 + .../Generated/Models/SharedKeys.cs | 61 + .../Generated/Models/SkuNameEnum.cs | 27 + .../Generated/Models/SourceEnum.cs | 30 + .../Generated/Models/StorageAccount.cs | 79 + .../Generated/Models/StorageInsight.cs | 129 ++ .../Generated/Models/StorageInsightState.cs | 22 + .../Generated/Models/StorageInsightStatus.cs | 76 + .../Generated/Models/SystemData.cs | 103 + .../Generated/Models/Table.cs | 201 ++ .../Generated/Models/TablePlanEnum.cs | 29 + .../Generated/Models/TableSubTypeEnum.cs | 37 + .../Generated/Models/TableTypeEnum.cs | 36 + .../Generated/Models/Tag.cs | 77 + .../Generated/Models/TrackedResource.cs | 87 + .../Generated/Models/Type.cs | 22 + .../Generated/Models/UsageMetric.cs | 94 + .../Models/UserIdentityProperties.cs | 61 + .../Generated/Models/Workspace.cs | 215 +++ .../Generated/Models/WorkspaceCapping.cs | 74 + .../Generated/Models/WorkspaceEntityStatus.cs | 27 + .../Generated/Models/WorkspaceFeatures.cs | 103 + .../Generated/Models/WorkspacePatch.cs | 206 ++ .../Generated/Models/WorkspacePurgeBody.cs | 81 + .../Models/WorkspacePurgeBodyFilters.cs | 90 + .../Models/WorkspacePurgePurgeHeaders.cs | 53 + .../Models/WorkspacePurgeResponse.cs | 67 + .../Models/WorkspacePurgeStatusResponse.cs | 70 + .../Generated/Models/WorkspaceSku.cs | 89 + .../Generated/Models/WorkspaceSkuNameEnum.cs | 28 + .../Generated/OperationStatusesOperations.cs | 255 +++ .../OperationStatusesOperationsExtensions.cs | 65 + .../OperationalInsightsManagementClient.cs | 465 +++++ .../Generated/Operations.cs | 382 ++++ .../Generated/OperationsExtensions.cs | 87 + .../Generated/SavedSearchesOperations.cs | 986 ++++++++++ .../SavedSearchesOperationsExtensions.cs | 206 ++ .../Generated/SchemaOperations.cs | 281 +++ .../Generated/SchemaOperationsExtensions.cs | 65 + ...nfo_OperationalInsightsManagementClient.cs | 46 + .../Generated/SharedKeysOperations.cs | 509 +++++ .../SharedKeysOperationsExtensions.cs | 107 ++ .../StorageInsightConfigsOperations.cs | 1177 ++++++++++++ ...orageInsightConfigsOperationsExtensions.cs | 240 +++ .../Generated/TablesOperations.cs | 1504 +++++++++++++++ .../Generated/TablesOperationsExtensions.cs | 454 +++++ .../Generated/UsagesOperations.cs | 281 +++ .../Generated/UsagesOperationsExtensions.cs | 67 + .../Generated/WorkspacePurgeOperations.cs | 557 ++++++ .../WorkspacePurgeOperationsExtensions.cs | 135 ++ .../Generated/WorkspacesOperations.cs | 1413 ++++++++++++++ .../WorkspacesOperationsExtensions.cs | 369 ++++ .../OperationalInsights.Management.Sdk.csproj | 13 + .../Properties/AssemblyInfo.cs | 28 + .../README.md | 95 + .../OperationalInsights.sln | 40 +- .../Az.OperationalInsights.psd1 | 2 +- .../OperationalInsights.csproj | 5 +- 157 files changed, 28875 insertions(+), 19 deletions(-) create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/README.md diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs new file mode 100644 index 000000000000..345146bea651 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Customizations/Models/DataExport.cs @@ -0,0 +1,16 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + public partial class DataExport : Resource + { + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs new file mode 100644 index 000000000000..03558adc50df --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AvailableServiceTiersOperations operations. + /// + internal partial class AvailableServiceTiersOperations : IServiceOperations, IAvailableServiceTiersOperations + { + /// + /// Initializes a new instance of the AvailableServiceTiersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AvailableServiceTiersOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs new file mode 100644 index 000000000000..d55c34356b09 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AvailableServiceTiersOperations. + /// + public static partial class AvailableServiceTiersOperationsExtensions + { + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IList ListByWorkspace(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs new file mode 100644 index 000000000000..87d703abf18f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs @@ -0,0 +1,1710 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ClustersOperations operations. + /// + internal partial class ClustersOperations : IServiceOperations, IClustersOperations + { + /// + /// Initializes a new instance of the ClustersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ClustersOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (clusterName != null) + { + if (clusterName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "clusterName", 63); + } + if (clusterName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "clusterName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs new file mode 100644 index 000000000000..d999fd7ef830 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs @@ -0,0 +1,453 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ClustersOperations. + /// + public static partial class ClustersOperationsExtensions + { + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByResourceGroup(this IClustersOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IClustersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IClustersOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IClustersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + public static Cluster CreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void Delete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + operations.DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + return operations.GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return operations.UpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + operations.BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IClustersOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IClustersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs new file mode 100644 index 000000000000..9171c0ad1109 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs @@ -0,0 +1,999 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataExportsOperations operations. + /// + internal partial class DataExportsOperations : IServiceOperations, IDataExportsOperations + { + /// + /// Initializes a new instance of the DataExportsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataExportsOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a data export. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + } + if (dataExportName != null) + { + if (dataExportName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); + } + if (dataExportName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a data export instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataExportName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs new file mode 100644 index 000000000000..579f127cfcb6 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs @@ -0,0 +1,208 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataExportsOperations. + /// + public static partial class DataExportsOperationsExtensions + { + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable ListByWorkspace(this IDataExportsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + public static DataExport CreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataExportName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static DataExport Get(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + return operations.GetAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } + + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static void Delete(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs new file mode 100644 index 000000000000..c5e7fea9eff7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs @@ -0,0 +1,1204 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataSourcesOperations operations. + /// + internal partial class DataSourcesOperations : IServiceOperations, IDataSourcesOperations + { + /// + /// Initializes a new instance of the DataSourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataSourcesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a data source. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a data source instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a datasource instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (dataSourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (odataQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "odataQuery"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs new file mode 100644 index 000000000000..0ad7d1378c83 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs @@ -0,0 +1,257 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataSourcesOperations. + /// + public static partial class DataSourcesOperationsExtensions + { + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + public static DataSource CreateOrUpdate(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + public static void Delete(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + public static DataSource Get(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + return operations.GetAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + public static IPage ListByWorkspace(this IDataSourcesOperations operations, ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string)) + { + return operations.ListByWorkspaceAsync(odataQuery, resourceGroupName, workspaceName, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IDataSourcesOperations operations, ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(odataQuery, resourceGroupName, workspaceName, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this IDataSourcesOperations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this IDataSourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs new file mode 100644 index 000000000000..b042bc8bf45e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs @@ -0,0 +1,431 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DeletedWorkspacesOperations operations. + /// + internal partial class DeletedWorkspacesOperations : IServiceOperations, IDeletedWorkspacesOperations + { + /// + /// Initializes a new instance of the DeletedWorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..88d91dd2e860 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs @@ -0,0 +1,91 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DeletedWorkspacesOperations. + /// + public static partial class DeletedWorkspacesOperationsExtensions + { + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IDeletedWorkspacesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDeletedWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IEnumerable ListByResourceGroup(this IDeletedWorkspacesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDeletedWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs new file mode 100644 index 000000000000..f924b670b9d7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs @@ -0,0 +1,269 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GatewaysOperations operations. + /// + internal partial class GatewaysOperations : IServiceOperations, IGatewaysOperations + { + /// + /// Initializes a new instance of the GatewaysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal GatewaysOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (gatewayId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "gatewayId"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("gatewayId", gatewayId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs new file mode 100644 index 000000000000..16311bb1f6b4 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for GatewaysOperations. + /// + public static partial class GatewaysOperationsExtensions + { + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + public static void Delete(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId) + { + operations.DeleteAsync(resourceGroupName, workspaceName, gatewayId).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, gatewayId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs new file mode 100644 index 000000000000..e10add9d9636 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AvailableServiceTiersOperations operations. + /// + public partial interface IAvailableServiceTiersOperations + { + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs new file mode 100644 index 000000000000..595be09e83b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs @@ -0,0 +1,295 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ClustersOperations operations. + /// + public partial interface IClustersOperations + { + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics + /// cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The parameters required to create or update a Log Analytics + /// cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a cluster instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The parameters required to patch a Log Analytics cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs new file mode 100644 index 000000000000..32d52702e7e8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs @@ -0,0 +1,136 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataExportsOperations operations. + /// + public partial interface IDataExportsOperations + { + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a data export. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The parameters required to create or update a data export. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a data export instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs new file mode 100644 index 000000000000..50c3c802a999 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs @@ -0,0 +1,167 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataSourcesOperations operations. + /// + public partial interface IDataSourcesOperations + { + /// + /// Create or update a data source. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The parameters required to create or update a datasource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a data source instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a datasource instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the first page of data source instances in a workspace with + /// the link to the next page. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the first page of data source instances in a workspace with + /// the link to the next page. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs new file mode 100644 index 000000000000..5db749e7c2c2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DeletedWorkspacesOperations operations. + /// + public partial interface IDeletedWorkspacesOperations + { + /// + /// Gets recently deleted workspaces in a subscription, available for + /// recovery. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs new file mode 100644 index 000000000000..79ccee746650 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// GatewaysOperations operations. + /// + public partial interface IGatewaysOperations + { + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs new file mode 100644 index 000000000000..b3eae4d089bb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntelligencePacksOperations operations. + /// + public partial interface IIntelligencePacksOperations + { + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the intelligence packs possible and whether they are + /// enabled or disabled for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs new file mode 100644 index 000000000000..b5f8a401408f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs @@ -0,0 +1,198 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedServicesOperations operations. + /// + public partial interface ILinkedServicesOperations + { + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs new file mode 100644 index 000000000000..d87630e84e72 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs @@ -0,0 +1,144 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedStorageAccountsOperations operations. + /// + public partial interface ILinkedStorageAccountsOperations + { + /// + /// Create or Update a link relation between current workspace and a + /// group of storage accounts of a specific data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Linked storage accounts resources ids. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all linked storage account of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all linked storage accounts associated with the specified + /// workspace, storage accounts will be sorted by their data source + /// type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs new file mode 100644 index 000000000000..94bf0bf98415 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagementGroupsOperations operations. + /// + public partial interface IManagementGroupsOperations + { + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs new file mode 100644 index 000000000000..c0ccc2341f24 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusesOperations operations. + /// + public partial interface IOperationStatusesOperations + { + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs new file mode 100644 index 000000000000..8408006cfe96 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs @@ -0,0 +1,167 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// + public partial interface IOperationalInsightsManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + IDeletedWorkspacesOperations DeletedWorkspaces { get; } + + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + + /// + /// Gets the IDataExportsOperations. + /// + IDataExportsOperations DataExports { get; } + + /// + /// Gets the IDataSourcesOperations. + /// + IDataSourcesOperations DataSources { get; } + + /// + /// Gets the IIntelligencePacksOperations. + /// + IIntelligencePacksOperations IntelligencePacks { get; } + + /// + /// Gets the ILinkedServicesOperations. + /// + ILinkedServicesOperations LinkedServices { get; } + + /// + /// Gets the ILinkedStorageAccountsOperations. + /// + ILinkedStorageAccountsOperations LinkedStorageAccounts { get; } + + /// + /// Gets the IManagementGroupsOperations. + /// + IManagementGroupsOperations ManagementGroups { get; } + + /// + /// Gets the IOperationStatusesOperations. + /// + IOperationStatusesOperations OperationStatuses { get; } + + /// + /// Gets the ISharedKeysOperations. + /// + ISharedKeysOperations SharedKeys { get; } + + /// + /// Gets the IUsagesOperations. + /// + IUsagesOperations Usages { get; } + + /// + /// Gets the IStorageInsightConfigsOperations. + /// + IStorageInsightConfigsOperations StorageInsightConfigs { get; } + + /// + /// Gets the ISavedSearchesOperations. + /// + ISavedSearchesOperations SavedSearches { get; } + + /// + /// Gets the IAvailableServiceTiersOperations. + /// + IAvailableServiceTiersOperations AvailableServiceTiers { get; } + + /// + /// Gets the IGatewaysOperations. + /// + IGatewaysOperations Gateways { get; } + + /// + /// Gets the ISchemaOperations. + /// + ISchemaOperations Schema { get; } + + /// + /// Gets the IWorkspacePurgeOperations. + /// + IWorkspacePurgeOperations WorkspacePurge { get; } + + /// + /// Gets the IClustersOperations. + /// + IClustersOperations Clusters { get; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs new file mode 100644 index 000000000000..104d5efc6eb2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs new file mode 100644 index 000000000000..61aba8e7e7c9 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs @@ -0,0 +1,136 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SavedSearchesOperations operations. + /// + public partial interface ISavedSearchesOperations + { + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs new file mode 100644 index 000000000000..e2c367d0a724 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SchemaOperations operations. + /// + public partial interface ISchemaOperations + { + /// + /// Gets the schema for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs new file mode 100644 index 000000000000..49ff9cd92c01 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedKeysOperations operations. + /// + public partial interface ISharedKeysOperations + { + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These + /// keys are used to connect Microsoft Operational Insights agents to + /// the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs new file mode 100644 index 000000000000..45ddb1077518 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs @@ -0,0 +1,158 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageInsightConfigsOperations operations. + /// + public partial interface IStorageInsightConfigsOperations + { + /// + /// Create or update a storage insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a storage insight instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs new file mode 100644 index 000000000000..4b2e43bd9240 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TablesOperations operations. + /// + public partial interface ITablesOperations + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Migrate a Log Analytics table from support of the Data Collector + /// API and Custom Fields features to support of Data Collection + /// Rule-based Custom Logs. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs new file mode 100644 index 000000000000..abb9df1e8c13 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs @@ -0,0 +1,52 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs new file mode 100644 index 000000000000..d1cc6e003a36 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacePurgeOperations operations. + /// + public partial interface IWorkspacePurgeOperations + { + /// + /// Purges data in an Log Analytics workspace by a set of user-defined + /// filters. + /// + /// In order to manage system resources, purge requests are throttled + /// at 50 requests per hour. You should batch the execution of purge + /// requests by sending a single command whose predicate includes all + /// user identities that require purging. Use the in operator to + /// specify multiple identities. You should run the query prior to + /// using for a purge request to verify that the results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of + /// an Log Analytics Workspace + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the + /// status of which is returned. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs new file mode 100644 index 000000000000..b200f6dea07e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs @@ -0,0 +1,237 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + public partial interface IWorkspacesOperations + { + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets workspaces in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a workspace resource. To recover the workspace, create it + /// again with the same name, in the same subscription, resource group + /// and location. The name is kept for 14 days and cannot be used for + /// another workspace. To remove the workspace completely and release + /// the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that + /// was deleted with this flag cannot be recovered. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a workspace instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a workspace resource. To recover the workspace, create it + /// again with the same name, in the same subscription, resource group + /// and location. The name is kept for 14 days and cannot be used for + /// another workspace. To remove the workspace completely and release + /// the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that + /// was deleted with this flag cannot be recovered. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs new file mode 100644 index 000000000000..6565939cc189 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs @@ -0,0 +1,712 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntelligencePacksOperations operations. + /// + internal partial class IntelligencePacksOperations : IServiceOperations, IIntelligencePacksOperations + { + /// + /// Initializes a new instance of the IntelligencePacksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntelligencePacksOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (intelligencePackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (intelligencePackName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs new file mode 100644 index 000000000000..20d3824e2cb5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs @@ -0,0 +1,155 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntelligencePacksOperations. + /// + public static partial class IntelligencePacksOperationsExtensions + { + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + public static void Disable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + operations.DisableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } + + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// The cancellation token. + /// + public static async Task DisableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DisableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + public static void Enable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + operations.EnableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } + + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// The cancellation token. + /// + public static async Task EnableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.EnableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IList List(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs new file mode 100644 index 000000000000..45807f9649f1 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs @@ -0,0 +1,1074 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedServicesOperations operations. + /// + internal partial class LinkedServicesOperations : IServiceOperations, ILinkedServicesOperations + { + /// + /// Initializes a new instance of the LinkedServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LinkedServicesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a linked service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (linkedServiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs new file mode 100644 index 000000000000..3fe9f50940df --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs @@ -0,0 +1,309 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for LinkedServicesOperations. + /// + public static partial class LinkedServicesOperationsExtensions + { + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + public static LinkedService CreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Delete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return operations.DeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Get(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return operations.GetAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable ListByWorkspace(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + public static LinkedService BeginCreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The parameters required to create or update a linked service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService BeginDelete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return operations.BeginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs new file mode 100644 index 000000000000..c90001a1a49f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs @@ -0,0 +1,978 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// LinkedStorageAccountsOperations operations. + /// + internal partial class LinkedStorageAccountsOperations : IServiceOperations, ILinkedStorageAccountsOperations + { + /// + /// Initializes a new instance of the LinkedStorageAccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Linked storage accounts resources ids. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + LinkedStorageAccountsResource parameters = new LinkedStorageAccountsResource(); + if (storageAccountIds != null) + { + parameters.StorageAccountIds = storageAccountIds; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs new file mode 100644 index 000000000000..327017b8e9b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs @@ -0,0 +1,222 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for LinkedStorageAccountsOperations. + /// + public static partial class LinkedStorageAccountsOperationsExtensions + { + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Linked storage accounts resources ids. + /// + public static LinkedStorageAccountsResource CreateOrUpdate(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).GetAwaiter().GetResult(); + } + + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// Linked storage accounts resources ids. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + operations.DeleteAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } + + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + return operations.GetAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } + + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. Possible values include: 'CustomLogs', + /// 'AzureWatson', 'Query', 'Alerts' + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable ListByWorkspace(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs new file mode 100644 index 000000000000..2f2228980c0e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagementGroupsOperations operations. + /// + internal partial class ManagementGroupsOperations : IServiceOperations, IManagementGroupsOperations + { + /// + /// Initializes a new instance of the ManagementGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagementGroupsOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..31af29056e93 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ManagementGroupsOperations. + /// + public static partial class ManagementGroupsOperationsExtensions + { + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable List(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs new file mode 100644 index 000000000000..6f79ee6ac743 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The list of Log Analytics workspaces associated with the cluster. + /// + public partial class AssociatedWorkspace + { + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + public AssociatedWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + /// The id of the assigned workspace. + /// The name id the assigned + /// workspace. + /// The ResourceId id the assigned + /// workspace. + /// The time of workspace + /// association. + public AssociatedWorkspace(string workspaceId = default(string), string workspaceName = default(string), string resourceId = default(string), string associateDate = default(string)) + { + WorkspaceId = workspaceId; + WorkspaceName = workspaceName; + ResourceId = resourceId; + AssociateDate = associateDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the id of the assigned workspace. + /// + [JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets the name id the assigned workspace. + /// + [JsonProperty(PropertyName = "workspaceName")] + public string WorkspaceName { get; private set; } + + /// + /// Gets the ResourceId id the assigned workspace. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; private set; } + + /// + /// Gets the time of workspace association. + /// + [JsonProperty(PropertyName = "associateDate")] + public string AssociateDate { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs new file mode 100644 index 000000000000..1c2618c5baeb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Service Tier details. + /// + public partial class AvailableServiceTier + { + /// + /// Initializes a new instance of the AvailableServiceTier class. + /// + public AvailableServiceTier() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailableServiceTier class. + /// + /// The name of the Service Tier. Possible + /// values include: 'Free', 'Standard', 'Premium', 'PerNode', + /// 'PerGB2018', 'Standalone', 'CapacityReservation' + /// True if the Service Tier is enabled for the + /// workspace. + /// The minimum retention for the + /// Service Tier, in days. + /// The maximum retention for the + /// Service Tier, in days. + /// The default retention for the + /// Service Tier, in days. + /// The capacity reservation + /// level in GB per day. Returned for the Capacity Reservation Service + /// Tier. + /// Time when the sku was last updated for + /// the workspace. Returned for the Capacity Reservation Service + /// Tier. + public AvailableServiceTier(string serviceTier = default(string), bool? enabled = default(bool?), long? minimumRetention = default(long?), long? maximumRetention = default(long?), long? defaultRetention = default(long?), long? capacityReservationLevel = default(long?), string lastSkuUpdate = default(string)) + { + ServiceTier = serviceTier; + Enabled = enabled; + MinimumRetention = minimumRetention; + MaximumRetention = maximumRetention; + DefaultRetention = defaultRetention; + CapacityReservationLevel = capacityReservationLevel; + LastSkuUpdate = lastSkuUpdate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the Service Tier. Possible values include: 'Free', + /// 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', + /// 'CapacityReservation' + /// + [JsonProperty(PropertyName = "serviceTier")] + public string ServiceTier { get; private set; } + + /// + /// Gets true if the Service Tier is enabled for the workspace. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; private set; } + + /// + /// Gets the minimum retention for the Service Tier, in days. + /// + [JsonProperty(PropertyName = "minimumRetention")] + public long? MinimumRetention { get; private set; } + + /// + /// Gets the maximum retention for the Service Tier, in days. + /// + [JsonProperty(PropertyName = "maximumRetention")] + public long? MaximumRetention { get; private set; } + + /// + /// Gets the default retention for the Service Tier, in days. + /// + [JsonProperty(PropertyName = "defaultRetention")] + public long? DefaultRetention { get; private set; } + + /// + /// Gets the capacity reservation level in GB per day. Returned for the + /// Capacity Reservation Service Tier. + /// + [JsonProperty(PropertyName = "capacityReservationLevel")] + public long? CapacityReservationLevel { get; private set; } + + /// + /// Gets time when the sku was last updated for the workspace. Returned + /// for the Capacity Reservation Service Tier. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs new file mode 100644 index 000000000000..4923d59a4ac3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs new file mode 100644 index 000000000000..4cece2a8e88f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for BillingType. + /// + public static class BillingType + { + public const string Cluster = "Cluster"; + public const string Workspaces = "Workspaces"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs new file mode 100644 index 000000000000..18d66429ce55 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Capacity Reservation properties. + /// + public partial class CapacityReservationProperties + { + /// + /// Initializes a new instance of the CapacityReservationProperties + /// class. + /// + public CapacityReservationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CapacityReservationProperties + /// class. + /// + /// The last time Sku was updated. + /// Minimum CapacityReservation value in + /// GB. + public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?)) + { + LastSkuUpdate = lastSkuUpdate; + MinCapacity = minCapacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the last time Sku was updated. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + + /// + /// Gets minimum CapacityReservation value in GB. + /// + [JsonProperty(PropertyName = "minCapacity")] + public long? MinCapacity { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs new file mode 100644 index 000000000000..0afe9167ade2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs @@ -0,0 +1,192 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level Log Analytics cluster resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class Cluster : TrackedResource + { + /// + /// Initializes a new instance of the Cluster class. + /// + public Cluster() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Cluster class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The identity of the resource. + /// The sku properties. + /// The ID associated with the cluster. + /// The provisioning state of the + /// cluster. Possible values include: 'Creating', 'Succeeded', + /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + /// Configures whether cluster + /// will use double encryption. This Property can not be modified after + /// cluster creation. Default value is 'true' + /// Sets whether the cluster + /// will support availability zones. This can be set as true only in + /// regions where Azure Data Explorer support Availability Zones. This + /// Property can not be modified after cluster creation. Default value + /// is 'true' if region supports Availability Zones. + /// The cluster's billing type. Possible + /// values include: 'Cluster', 'Workspaces' + /// The associated key + /// properties. + /// The last time the cluster was + /// updated. + /// The cluster creation time + /// The list of Log Analytics + /// workspaces associated with the cluster + /// Additional properties + /// for capacity reservation + public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), IList associatedWorkspaces = default(IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) + : base(location, id, name, type, tags) + { + Identity = identity; + Sku = sku; + ClusterId = clusterId; + ProvisioningState = provisioningState; + IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + BillingType = billingType; + KeyVaultProperties = keyVaultProperties; + LastModifiedDate = lastModifiedDate; + CreatedDate = createdDate; + AssociatedWorkspaces = associatedWorkspaces; + CapacityReservationProperties = capacityReservationProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets or sets the sku properties. + /// + [JsonProperty(PropertyName = "sku")] + public ClusterSku Sku { get; set; } + + /// + /// Gets the ID associated with the cluster. + /// + [JsonProperty(PropertyName = "properties.clusterId")] + public string ClusterId { get; private set; } + + /// + /// Gets the provisioning state of the cluster. Possible values + /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + /// 'ProvisioningAccount', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets configures whether cluster will use double encryption. + /// This Property can not be modified after cluster creation. Default + /// value is 'true' + /// + [JsonProperty(PropertyName = "properties.isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled { get; set; } + + /// + /// Gets or sets sets whether the cluster will support availability + /// zones. This can be set as true only in regions where Azure Data + /// Explorer support Availability Zones. This Property can not be + /// modified after cluster creation. Default value is 'true' if region + /// supports Availability Zones. + /// + [JsonProperty(PropertyName = "properties.isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled { get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: + /// 'Cluster', 'Workspaces' + /// + [JsonProperty(PropertyName = "properties.billingType")] + public string BillingType { get; set; } + + /// + /// Gets or sets the associated key properties. + /// + [JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Gets the last time the cluster was updated. + /// + [JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate { get; private set; } + + /// + /// Gets the cluster creation time + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets or sets the list of Log Analytics workspaces associated with + /// the cluster + /// + [JsonProperty(PropertyName = "properties.associatedWorkspaces")] + public IList AssociatedWorkspaces { get; set; } + + /// + /// Gets or sets additional properties for capacity reservation + /// + [JsonProperty(PropertyName = "properties.capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Identity != null) + { + Identity.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs new file mode 100644 index 000000000000..805e81dce682 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ClusterEntityStatus. + /// + public static class ClusterEntityStatus + { + public const string Creating = "Creating"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs new file mode 100644 index 000000000000..fdc2e62fcc8a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level Log Analytics cluster resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class ClusterPatch : IResource + { + /// + /// Initializes a new instance of the ClusterPatch class. + /// + public ClusterPatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterPatch class. + /// + /// The associated key + /// properties. + /// The cluster's billing type. Possible + /// values include: 'Cluster', 'Workspaces' + /// The identity of the resource. + /// The sku properties. + /// Resource tags. + public ClusterPatch(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string billingType = default(string), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), IDictionary tags = default(IDictionary)) + { + KeyVaultProperties = keyVaultProperties; + BillingType = billingType; + Identity = identity; + Sku = sku; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the associated key properties. + /// + [JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: + /// 'Cluster', 'Workspaces' + /// + [JsonProperty(PropertyName = "properties.billingType")] + public string BillingType { get; set; } + + /// + /// Gets or sets the identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + + /// + /// Gets or sets the sku properties. + /// + [JsonProperty(PropertyName = "sku")] + public ClusterSku Sku { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Identity != null) + { + Identity.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs new file mode 100644 index 000000000000..78d93195bedc --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The cluster sku definition. + /// + public partial class ClusterSku + { + /// + /// Initializes a new instance of the ClusterSku class. + /// + public ClusterSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterSku class. + /// + /// The capacity value + /// The name of the SKU. Possible values include: + /// 'CapacityReservation' + public ClusterSku(long? capacity = default(long?), string name = default(string)) + { + Capacity = capacity; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the capacity value + /// + [JsonProperty(PropertyName = "capacity")] + public long? Capacity { get; set; } + + /// + /// Gets or sets the name of the SKU. Possible values include: + /// 'CapacityReservation' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs new file mode 100644 index 000000000000..a34fc481db8b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ClusterSkuNameEnum. + /// + public static class ClusterSkuNameEnum + { + public const string CapacityReservation = "CapacityReservation"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs new file mode 100644 index 000000000000..93c8f432af90 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs @@ -0,0 +1,104 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Table column. + /// + public partial class Column + { + /// + /// Initializes a new instance of the Column class. + /// + public Column() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Column class. + /// + /// Column name. + /// Column data type. Possible values include: + /// 'string', 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', + /// 'dynamic' + /// Column data type logical hint. Possible + /// values include: 'uri', 'guid', 'armPath', 'ip' + /// Column display name. + /// Column description. + /// Is displayed by default. + /// Is column hidden. + public Column(string name = default(string), string type = default(string), string dataTypeHint = default(string), string displayName = default(string), string description = default(string), bool? isDefaultDisplay = default(bool?), bool? isHidden = default(bool?)) + { + Name = name; + Type = type; + DataTypeHint = dataTypeHint; + DisplayName = displayName; + Description = description; + IsDefaultDisplay = isDefaultDisplay; + IsHidden = isHidden; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets column name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets column data type. Possible values include: 'string', + /// 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', 'dynamic' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets column data type logical hint. Possible values + /// include: 'uri', 'guid', 'armPath', 'ip' + /// + [JsonProperty(PropertyName = "dataTypeHint")] + public string DataTypeHint { get; set; } + + /// + /// Gets or sets column display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets column description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets is displayed by default. + /// + [JsonProperty(PropertyName = "isDefaultDisplay")] + public bool? IsDefaultDisplay { get; private set; } + + /// + /// Gets is column hidden. + /// + [JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs new file mode 100644 index 000000000000..87c5db388a9d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnDataTypeHintEnum. + /// + public static class ColumnDataTypeHintEnum + { + /// + /// A string that matches the pattern of a URI, for example, + /// scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment + /// + public const string Uri = "uri"; + /// + /// A standard 128-bit GUID following the standard shape, + /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// + public const string Guid = "guid"; + /// + /// An Azure Resource Model (ARM) path: + /// /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}... + /// + public const string ArmPath = "armPath"; + /// + /// A standard V4/V6 ip address following the standard shape, + /// x.x.x.x/y:y:y:y:y:y:y:y + /// + public const string Ip = "ip"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs new file mode 100644 index 000000000000..dec674236591 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ColumnTypeEnum. + /// + public static class ColumnTypeEnum + { + public const string String = "string"; + public const string Int = "int"; + public const string Long = "long"; + public const string Real = "real"; + public const string Boolean = "boolean"; + public const string DateTime = "dateTime"; + public const string Guid = "guid"; + public const string Dynamic = "dynamic"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs new file mode 100644 index 000000000000..736000ddffc2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The core summary of a search. + /// + public partial class CoreSummary + { + /// + /// Initializes a new instance of the CoreSummary class. + /// + public CoreSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CoreSummary class. + /// + /// The number of documents of a core + /// summary. + /// The status of a core summary. + public CoreSummary(long numberOfDocuments, string status = default(string)) + { + Status = status; + NumberOfDocuments = numberOfDocuments; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status of a core summary. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the number of documents of a core summary. + /// + [JsonProperty(PropertyName = "numberOfDocuments")] + public long NumberOfDocuments { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..c2d6149cd9ce --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs new file mode 100644 index 000000000000..22c7831f8f9e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs @@ -0,0 +1,141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level data export resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataExport : IResource + { + /// + /// Initializes a new instance of the DataExport class. + /// + public DataExport() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataExport class. + /// + /// An array of tables to export, for example: + /// [“Heartbeat, SecurityEvent”]. + /// The destination resource ID. This can be + /// copied from the Properties entry of the destination resource in + /// Azure. + /// The data export rule ID. + /// The type of the destination resource. + /// Possible values include: 'StorageAccount', 'EventHub' + /// Optional. Allows to define an Event Hub + /// name. Not applicable when destination is Storage Account. + /// Active when enabled. + /// The latest data export rule modification + /// time. + /// Date and time when the export was + /// last modified. + public DataExport(IList tableNames, string resourceId, string dataExportId = default(string), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) + { + DataExportId = dataExportId; + TableNames = tableNames; + ResourceId = resourceId; + DataExportType = dataExportType; + EventHubName = eventHubName; + Enable = enable; + CreatedDate = createdDate; + LastModifiedDate = lastModifiedDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the data export rule ID. + /// + [JsonProperty(PropertyName = "properties.dataExportId")] + public string DataExportId { get; set; } + + /// + /// Gets or sets an array of tables to export, for example: + /// [“Heartbeat, SecurityEvent”]. + /// + [JsonProperty(PropertyName = "properties.tableNames")] + public IList TableNames { get; set; } + + /// + /// Gets or sets the destination resource ID. This can be copied from + /// the Properties entry of the destination resource in Azure. + /// + [JsonProperty(PropertyName = "properties.destination.resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets the type of the destination resource. Possible values include: + /// 'StorageAccount', 'EventHub' + /// + [JsonProperty(PropertyName = "properties.destination.type")] + public string DataExportType { get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not + /// applicable when destination is Storage Account. + /// + [JsonProperty(PropertyName = "properties.destination.metaData.eventHubName")] + public string EventHubName { get; set; } + + /// + /// Gets or sets active when enabled. + /// + [JsonProperty(PropertyName = "properties.enable")] + public bool? Enable { get; set; } + + /// + /// Gets or sets the latest data export rule modification time. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; set; } + + /// + /// Gets or sets date and time when the export was last modified. + /// + [JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TableNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TableNames"); + } + if (ResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs new file mode 100644 index 000000000000..78ed4da9ec3c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for DataIngestionStatus. + /// + public static class DataIngestionStatus + { + /// + /// Ingestion enabled following daily cap quota reset, or subscription + /// enablement. + /// + public const string RespectQuota = "RespectQuota"; + /// + /// Ingestion started following service setting change. + /// + public const string ForceOn = "ForceOn"; + /// + /// Ingestion stopped following service setting change. + /// + public const string ForceOff = "ForceOff"; + /// + /// Reached daily cap quota, ingestion stopped. + /// + public const string OverQuota = "OverQuota"; + /// + /// Ingestion stopped following suspended subscription. + /// + public const string SubscriptionSuspended = "SubscriptionSuspended"; + /// + /// 80% of daily cap quota reached. + /// + public const string ApproachingQuota = "ApproachingQuota"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs new file mode 100644 index 000000000000..62ec50342b71 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs @@ -0,0 +1,134 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Datasources under OMS Workspace. + /// + public partial class DataSource : ProxyResource + { + /// + /// Initializes a new instance of the DataSource class. + /// + public DataSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSource class. + /// + /// The data source properties in raw json + /// format, each kind of data source have it's own schema. + /// Possible values include: 'WindowsEvent', + /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', + /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', + /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', + /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', + /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the data source. + /// Resource tags. + public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Properties = properties; + Etag = etag; + Kind = kind; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the data source properties in raw json format, each + /// kind of data source have it's own schema. + /// + [JsonProperty(PropertyName = "properties")] + public object Properties { get; set; } + + /// + /// Gets or sets the ETag of the data source. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// Gets or sets possible values include: 'WindowsEvent', + /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', + /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', + /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', + /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', + /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + if (Kind == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs new file mode 100644 index 000000000000..204e5c64334c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// DataSource filter. Right now, only filter by kind is supported. + /// + public partial class DataSourceFilter + { + /// + /// Initializes a new instance of the DataSourceFilter class. + /// + public DataSourceFilter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSourceFilter class. + /// + /// Possible values include: 'WindowsEvent', + /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', + /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', + /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', + /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', + /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + public DataSourceFilter(string kind = default(string)) + { + Kind = kind; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'WindowsEvent', + /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', + /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', + /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', + /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', + /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs new file mode 100644 index 000000000000..a333acf6c231 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for DataSourceKind. + /// + public static class DataSourceKind + { + public const string WindowsEvent = "WindowsEvent"; + public const string WindowsPerformanceCounter = "WindowsPerformanceCounter"; + public const string IISLogs = "IISLogs"; + public const string LinuxSyslog = "LinuxSyslog"; + public const string LinuxSyslogCollection = "LinuxSyslogCollection"; + public const string LinuxPerformanceObject = "LinuxPerformanceObject"; + public const string LinuxPerformanceCollection = "LinuxPerformanceCollection"; + public const string CustomLog = "CustomLog"; + public const string CustomLogCollection = "CustomLogCollection"; + public const string AzureAuditLog = "AzureAuditLog"; + public const string AzureActivityLog = "AzureActivityLog"; + public const string GenericDataSource = "GenericDataSource"; + public const string ChangeTrackingCustomPath = "ChangeTrackingCustomPath"; + public const string ChangeTrackingPath = "ChangeTrackingPath"; + public const string ChangeTrackingServices = "ChangeTrackingServices"; + public const string ChangeTrackingDataTypeConfiguration = "ChangeTrackingDataTypeConfiguration"; + public const string ChangeTrackingDefaultRegistry = "ChangeTrackingDefaultRegistry"; + public const string ChangeTrackingRegistry = "ChangeTrackingRegistry"; + public const string ChangeTrackingLinuxPath = "ChangeTrackingLinuxPath"; + public const string LinuxChangeTrackingPath = "LinuxChangeTrackingPath"; + public const string ChangeTrackingContentLocation = "ChangeTrackingContentLocation"; + public const string WindowsTelemetry = "WindowsTelemetry"; + public const string Office365 = "Office365"; + public const string SecurityWindowsBaselineConfiguration = "SecurityWindowsBaselineConfiguration"; + public const string SecurityCenterSecurityWindowsBaselineConfiguration = "SecurityCenterSecurityWindowsBaselineConfiguration"; + public const string SecurityEventCollectionConfiguration = "SecurityEventCollectionConfiguration"; + public const string SecurityInsightsSecurityEventCollectionConfiguration = "SecurityInsightsSecurityEventCollectionConfiguration"; + public const string ImportComputerGroup = "ImportComputerGroup"; + public const string NetworkMonitoring = "NetworkMonitoring"; + public const string Itsm = "Itsm"; + public const string DnsAnalytics = "DnsAnalytics"; + public const string ApplicationInsights = "ApplicationInsights"; + public const string SqlDataClassification = "SqlDataClassification"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs new file mode 100644 index 000000000000..9a20d7347e55 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DataSourceType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DataSourceType + { + [EnumMember(Value = "CustomLogs")] + CustomLogs, + [EnumMember(Value = "AzureWatson")] + AzureWatson, + [EnumMember(Value = "Query")] + Query, + [EnumMember(Value = "Alerts")] + Alerts + } + internal static class DataSourceTypeEnumExtension + { + internal static string ToSerializedValue(this DataSourceType? value) + { + return value == null ? null : ((DataSourceType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DataSourceType value) + { + switch( value ) + { + case DataSourceType.CustomLogs: + return "CustomLogs"; + case DataSourceType.AzureWatson: + return "AzureWatson"; + case DataSourceType.Query: + return "Query"; + case DataSourceType.Alerts: + return "Alerts"; + } + return null; + } + + internal static DataSourceType? ParseDataSourceType(this string value) + { + switch( value ) + { + case "CustomLogs": + return DataSourceType.CustomLogs; + case "AzureWatson": + return DataSourceType.AzureWatson; + case "Query": + return DataSourceType.Query; + case "Alerts": + return DataSourceType.Alerts; + } + return null; + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..f37324dc3b0f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..308fd06f3b34 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..8ea5c4fc5282 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..9addf8aa02d2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs new file mode 100644 index 000000000000..d41b26537594 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// Type of managed service identity. Possible + /// values include: 'SystemAssigned', 'UserAssigned', 'None' + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The list of user identities + /// associated with the resource. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets type of managed service identity. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public IdentityType Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with the + /// resource. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..b63a090303c0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for IdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum IdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [EnumMember(Value = "None")] + None + } + internal static class IdentityTypeEnumExtension + { + internal static string ToSerializedValue(this IdentityType? value) + { + return value == null ? null : ((IdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this IdentityType value) + { + switch( value ) + { + case IdentityType.SystemAssigned: + return "SystemAssigned"; + case IdentityType.UserAssigned: + return "UserAssigned"; + case IdentityType.None: + return "None"; + } + return null; + } + + internal static IdentityType? ParseIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return IdentityType.SystemAssigned; + case "UserAssigned": + return IdentityType.UserAssigned; + case "None": + return IdentityType.None; + } + return null; + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs new file mode 100644 index 000000000000..fe3dfa4f2d26 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Intelligence Pack containing a string name and boolean indicating if + /// it's enabled. + /// + public partial class IntelligencePack + { + /// + /// Initializes a new instance of the IntelligencePack class. + /// + public IntelligencePack() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IntelligencePack class. + /// + /// The name of the intelligence pack. + /// The enabled boolean for the intelligence + /// pack. + /// The display name of the intelligence + /// pack. + public IntelligencePack(string name = default(string), bool? enabled = default(bool?), string displayName = default(string)) + { + Name = name; + Enabled = enabled; + DisplayName = displayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the intelligence pack. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the enabled boolean for the intelligence pack. + /// + [JsonProperty(PropertyName = "enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets the display name of the intelligence pack. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..2fc2a0e6b29e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,82 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The key vault properties. + /// + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// The Key Vault uri which holds they key + /// associated with the Log Analytics cluster. + /// The name of the key associated with the Log + /// Analytics cluster. + /// The version of the key associated with the + /// Log Analytics cluster. + /// Selected key minimum required + /// size. + public KeyVaultProperties(string keyVaultUri = default(string), string keyName = default(string), string keyVersion = default(string), int? keyRsaSize = default(int?)) + { + KeyVaultUri = keyVaultUri; + KeyName = keyName; + KeyVersion = keyVersion; + KeyRsaSize = keyRsaSize; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Key Vault uri which holds they key associated with + /// the Log Analytics cluster. + /// + [JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri { get; set; } + + /// + /// Gets or sets the name of the key associated with the Log Analytics + /// cluster. + /// + [JsonProperty(PropertyName = "keyName")] + public string KeyName { get; set; } + + /// + /// Gets or sets the version of the key associated with the Log + /// Analytics cluster. + /// + [JsonProperty(PropertyName = "keyVersion")] + public string KeyVersion { get; set; } + + /// + /// Gets or sets selected key minimum required size. + /// + [JsonProperty(PropertyName = "keyRsaSize")] + public int? KeyRsaSize { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs new file mode 100644 index 000000000000..56b3f4f15a12 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level Linked service resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class LinkedService : ProxyResource + { + /// + /// Initializes a new instance of the LinkedService class. + /// + public LinkedService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedService class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The resource id of the resource that will + /// be linked to the workspace. This should be used for linking + /// resources which require read access + /// The resource id of the resource + /// that will be linked to the workspace. This should be used for + /// linking resources which require write access + /// The provisioning state of the + /// linked service. Possible values include: 'Succeeded', 'Deleting', + /// 'ProvisioningAccount', 'Updating' + /// Resource tags. + public LinkedService(string id = default(string), string name = default(string), string type = default(string), string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + ResourceId = resourceId; + WriteAccessResourceId = writeAccessResourceId; + ProvisioningState = provisioningState; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource id of the resource that will be linked to + /// the workspace. This should be used for linking resources which + /// require read access + /// + [JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the resource id of the resource that will be linked to + /// the workspace. This should be used for linking resources which + /// require write access + /// + [JsonProperty(PropertyName = "properties.writeAccessResourceId")] + public string WriteAccessResourceId { get; set; } + + /// + /// Gets or sets the provisioning state of the linked service. Possible + /// values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs new file mode 100644 index 000000000000..b0072a205ebe --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for LinkedServiceEntityStatus. + /// + public static class LinkedServiceEntityStatus + { + public const string Succeeded = "Succeeded"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs new file mode 100644 index 000000000000..9ea1f0c6c731 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Linked storage accounts top level resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class LinkedStorageAccountsResource : ProxyResource + { + /// + /// Initializes a new instance of the LinkedStorageAccountsResource + /// class. + /// + public LinkedStorageAccountsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedStorageAccountsResource + /// class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Linked storage accounts type. Possible + /// values include: 'CustomLogs', 'AzureWatson', 'Query', + /// 'Alerts' + /// Linked storage accounts resources + /// ids. + public LinkedStorageAccountsResource(string id = default(string), string name = default(string), string type = default(string), DataSourceType? dataSourceType = default(DataSourceType?), IList storageAccountIds = default(IList)) + : base(id, name, type) + { + DataSourceType = dataSourceType; + StorageAccountIds = storageAccountIds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets linked storage accounts type. Possible values include: + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + [JsonProperty(PropertyName = "properties.dataSourceType")] + public DataSourceType? DataSourceType { get; private set; } + + /// + /// Gets or sets linked storage accounts resources ids. + /// + [JsonProperty(PropertyName = "properties.storageAccountIds")] + public IList StorageAccountIds { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs new file mode 100644 index 000000000000..a99a5f036cf0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs @@ -0,0 +1,121 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A management group that is connected to a workspace + /// + [Rest.Serialization.JsonTransformation] + public partial class ManagementGroup + { + /// + /// Initializes a new instance of the ManagementGroup class. + /// + public ManagementGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagementGroup class. + /// + /// The number of servers connected to the + /// management group. + /// Gets or sets a value indicating whether the + /// management group is a gateway. + /// The name of the management group. + /// The unique ID of the management group. + /// The datetime that the management group was + /// created. + /// The last datetime that the management + /// group received data. + /// The version of System Center that is managing + /// the management group. + /// The SKU of System Center that is managing the + /// management group. + public ManagementGroup(int? serverCount = default(int?), bool? isGateway = default(bool?), string name = default(string), string id = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? dataReceived = default(System.DateTime?), string version = default(string), string sku = default(string)) + { + ServerCount = serverCount; + IsGateway = isGateway; + Name = name; + Id = id; + Created = created; + DataReceived = dataReceived; + Version = version; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the number of servers connected to the management + /// group. + /// + [JsonProperty(PropertyName = "properties.serverCount")] + public int? ServerCount { get; set; } + + /// + /// Gets or sets a value indicating whether the management group is a + /// gateway. + /// + [JsonProperty(PropertyName = "properties.isGateway")] + public bool? IsGateway { get; set; } + + /// + /// Gets or sets the name of the management group. + /// + [JsonProperty(PropertyName = "properties.name")] + public string Name { get; set; } + + /// + /// Gets or sets the unique ID of the management group. + /// + [JsonProperty(PropertyName = "properties.id")] + public string Id { get; set; } + + /// + /// Gets or sets the datetime that the management group was created. + /// + [JsonProperty(PropertyName = "properties.created")] + public System.DateTime? Created { get; set; } + + /// + /// Gets or sets the last datetime that the management group received + /// data. + /// + [JsonProperty(PropertyName = "properties.dataReceived")] + public System.DateTime? DataReceived { get; set; } + + /// + /// Gets or sets the version of System Center that is managing the + /// management group. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; set; } + + /// + /// Gets or sets the SKU of System Center that is managing the + /// management group. + /// + [JsonProperty(PropertyName = "properties.sku")] + public string Sku { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs new file mode 100644 index 000000000000..bdea65678730 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The name of a metric. + /// + public partial class MetricName + { + /// + /// Initializes a new instance of the MetricName class. + /// + public MetricName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricName class. + /// + /// The system name of the metric. + /// The localized name of the + /// metric. + public MetricName(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the system name of the metric. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets the localized name of the metric. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs new file mode 100644 index 000000000000..a42143ed3968 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Supported operation of OperationalInsights resource provider. + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// Display metadata associated with the + /// operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display metadata associated with the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..49f796a52d92 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Display metadata associated with the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: Microsoft + /// OperationsManagement. + /// Resource on which the operation is performed + /// etc. + /// Type of operation: get, read, delete, + /// etc. + /// Description of operation + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets service provider: Microsoft OperationsManagement. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets resource on which the operation is performed etc. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets type of operation: get, read, delete, etc. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets description of operation + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..5ece076b7af3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The status of operation. + /// + public partial class OperationStatus + { + /// + /// Initializes a new instance of the OperationStatus class. + /// + public OperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationStatus class. + /// + /// The operation Id. + /// The operation name. + /// The start time of the operation. + /// The end time of the operation. + /// The status of the operation. + /// The error detail of the operation if + /// any. + public OperationStatus(string id = default(string), string name = default(string), string startTime = default(string), string endTime = default(string), string status = default(string), ErrorResponse error = default(ErrorResponse)) + { + Id = id; + Name = name; + StartTime = startTime; + EndTime = endTime; + Status = status; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the operation Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the operation name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the start time of the operation. + /// + [JsonProperty(PropertyName = "startTime")] + public string StartTime { get; set; } + + /// + /// Gets or sets the end time of the operation. + /// + [JsonProperty(PropertyName = "endTime")] + public string EndTime { get; set; } + + /// + /// Gets or sets the status of the operation. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the error detail of the operation if any. + /// + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs new file mode 100644 index 000000000000..aaf4ca1c0238 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs new file mode 100644 index 000000000000..4950adfade26 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs new file mode 100644 index 000000000000..332e1363540c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page2 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("@odata.nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs new file mode 100644 index 000000000000..14bb99ee7083 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The private link scope resource reference. + /// + public partial class PrivateLinkScopedResource + { + /// + /// Initializes a new instance of the PrivateLinkScopedResource class. + /// + public PrivateLinkScopedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateLinkScopedResource class. + /// + /// The full resource Id of the private link + /// scope resource. + /// The private link scope unique + /// Identifier. + public PrivateLinkScopedResource(string resourceId = default(string), string scopeId = default(string)) + { + ResourceId = resourceId; + ScopeId = scopeId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the full resource Id of the private link scope + /// resource. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the private link scope unique Identifier. + /// + [JsonProperty(PropertyName = "scopeId")] + public string ScopeId { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs new file mode 100644 index 000000000000..fee961764b03 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for ProvisioningStateEnum. + /// + public static class ProvisioningStateEnum + { + /// + /// Table schema is still being built and updated, table is currently + /// locked for any changes till the procedure is done. + /// + public const string Updating = "Updating"; + /// + /// Table schema is stable and without changes, table data is being + /// updated. + /// + public const string InProgress = "InProgress"; + /// + /// Table state is stable and without changes, table is unlocked and + /// open for new updates. + /// + public const string Succeeded = "Succeeded"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..431122ae6974 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Proxy Resource + /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs new file mode 100644 index 000000000000..7f1409896031 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for PublicNetworkAccessType. + /// + public static class PublicNetworkAccessType + { + /// + /// Enables connectivity to Log Analytics through public DNS. + /// + public const string Enabled = "Enabled"; + /// + /// Disables public connectivity to Log Analytics through public DNS. + /// + public const string Disabled = "Disabled"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs new file mode 100644 index 000000000000..436d09d56d7f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for PurgeState. + /// + public static class PurgeState + { + public const string Pending = "pending"; + public const string Completed = "completed"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs new file mode 100644 index 000000000000..da86706ff956 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs new file mode 100644 index 000000000000..99ccb6c4208c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Restore parameters. + /// + public partial class RestoredLogs + { + /// + /// Initializes a new instance of the RestoredLogs class. + /// + public RestoredLogs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoredLogs class. + /// + /// The timestamp to start the restore + /// from (UTC). + /// The timestamp to end the restore by + /// (UTC). + /// The table to restore data from. + public RestoredLogs(System.DateTime? startRestoreTime = default(System.DateTime?), System.DateTime? endRestoreTime = default(System.DateTime?), string sourceTable = default(string)) + { + StartRestoreTime = startRestoreTime; + EndRestoreTime = endRestoreTime; + SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the timestamp to start the restore from (UTC). + /// + [JsonProperty(PropertyName = "startRestoreTime")] + public System.DateTime? StartRestoreTime { get; set; } + + /// + /// Gets or sets the timestamp to end the restore by (UTC). + /// + [JsonProperty(PropertyName = "endRestoreTime")] + public System.DateTime? EndRestoreTime { get; set; } + + /// + /// Gets or sets the table to restore data from. + /// + [JsonProperty(PropertyName = "sourceTable")] + public string SourceTable { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs new file mode 100644 index 000000000000..b898ec847176 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Search job execution statistics. + /// + public partial class ResultStatistics + { + /// + /// Initializes a new instance of the ResultStatistics class. + /// + public ResultStatistics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResultStatistics class. + /// + /// Search job completion percentage. + /// The number of rows that were returned + /// by the search job. + public ResultStatistics(double? progress = default(double?), int? ingestedRecords = default(int?)) + { + Progress = progress; + IngestedRecords = ingestedRecords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets search job completion percentage. + /// + [JsonProperty(PropertyName = "progress")] + public double? Progress { get; private set; } + + /// + /// Gets the number of rows that were returned by the search job. + /// + [JsonProperty(PropertyName = "ingestedRecords")] + public int? IngestedRecords { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Progress != null) + { + if (Progress % 0.01 != 0) + { + throw new ValidationException(ValidationRules.MultipleOf, "Progress", 0.01); + } + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs new file mode 100644 index 000000000000..d5d016e94186 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs @@ -0,0 +1,168 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Value object for saved search results. + /// + [Rest.Serialization.JsonTransformation] + public partial class SavedSearch : ProxyResource + { + /// + /// Initializes a new instance of the SavedSearch class. + /// + public SavedSearch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearch class. + /// + /// The category of the saved search. This helps + /// the user to find a saved search faster. + /// Saved search display name. + /// The query expression for the saved + /// search. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the saved search. To override an + /// existing saved search, use "*" or specify the current Etag + /// The function alias if query serves as a + /// function. + /// The optional function parameters + /// if query serves as a function. Value should be in the following + /// format: 'param-name1:type1 = default_value1, param-name2:type2 = + /// default_value2'. For more examples and proper syntax please refer + /// to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// The version number of the query language. The + /// current version is 2 and is the default. + /// The tags attached to the saved search. + public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), IList tags = default(IList)) + : base(id, name, type) + { + Etag = etag; + Category = category; + DisplayName = displayName; + Query = query; + FunctionAlias = functionAlias; + FunctionParameters = functionParameters; + Version = version; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ETag of the saved search. To override an existing + /// saved search, use "*" or specify the current Etag + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// Gets or sets the category of the saved search. This helps the user + /// to find a saved search faster. + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets saved search display name. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the query expression for the saved search. + /// + [JsonProperty(PropertyName = "properties.query")] + public string Query { get; set; } + + /// + /// Gets or sets the function alias if query serves as a function. + /// + [JsonProperty(PropertyName = "properties.functionAlias")] + public string FunctionAlias { get; set; } + + /// + /// Gets or sets the optional function parameters if query serves as a + /// function. Value should be in the following format: + /// 'param-name1:type1 = default_value1, param-name2:type2 = + /// default_value2'. For more examples and proper syntax please refer + /// to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + [JsonProperty(PropertyName = "properties.functionParameters")] + public string FunctionParameters { get; set; } + + /// + /// Gets or sets the version number of the query language. The current + /// version is 2 and is the default. + /// + [JsonProperty(PropertyName = "properties.version")] + public long? Version { get; set; } + + /// + /// Gets or sets the tags attached to the saved search. + /// + [JsonProperty(PropertyName = "properties.tags")] + public IList Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Category == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Category"); + } + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + if (Query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Query"); + } + if (Tags != null) + { + foreach (var element in Tags) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs new file mode 100644 index 000000000000..7723eaf9b783 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The saved search list operation response. + /// + public partial class SavedSearchesListResult + { + /// + /// Initializes a new instance of the SavedSearchesListResult class. + /// + public SavedSearchesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearchesListResult class. + /// + /// The array of result values. + public SavedSearchesListResult(IList value = default(IList)) + { + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the array of result values. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs new file mode 100644 index 000000000000..b5e09561fbbb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs @@ -0,0 +1,162 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Table's schema. + /// + public partial class Schema + { + /// + /// Initializes a new instance of the Schema class. + /// + public Schema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Schema class. + /// + /// Table name. + /// Table display name. + /// Table description. + /// A list of table custom columns. + /// A list of table standard + /// columns. + /// Table category. + /// Table labels. + /// Table's creator. Possible values include: + /// 'microsoft', 'customer' + /// Table's creator. Possible values include: + /// 'Microsoft', 'CustomLog', 'RestoredLogs', 'SearchResults' + /// The subtype describes what APIs can be + /// used to interact with the table, and what features are available + /// against it. Possible values include: 'Any', 'Classic', + /// 'DataCollectionRuleBased' + /// List of solutions the table is affiliated + /// with + /// Parameters of the search job that + /// initiated this table. + /// Parameters of the restore operation that + /// initiated this table. + public Schema(string name = default(string), string displayName = default(string), string description = default(string), IList columns = default(IList), IList standardColumns = default(IList), IList categories = default(IList), IList labels = default(IList), string source = default(string), string tableType = default(string), string tableSubType = default(string), IList solutions = default(IList), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs)) + { + Name = name; + DisplayName = displayName; + Description = description; + Columns = columns; + StandardColumns = standardColumns; + Categories = categories; + Labels = labels; + Source = source; + TableType = tableType; + TableSubType = tableSubType; + Solutions = solutions; + SearchResults = searchResults; + RestoredLogs = restoredLogs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets table name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets table display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets table description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets a list of table custom columns. + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; set; } + + /// + /// Gets a list of table standard columns. + /// + [JsonProperty(PropertyName = "standardColumns")] + public IList StandardColumns { get; private set; } + + /// + /// Gets table category. + /// + [JsonProperty(PropertyName = "categories")] + public IList Categories { get; private set; } + + /// + /// Gets table labels. + /// + [JsonProperty(PropertyName = "labels")] + public IList Labels { get; private set; } + + /// + /// Gets table's creator. Possible values include: 'microsoft', + /// 'customer' + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; private set; } + + /// + /// Gets table's creator. Possible values include: 'Microsoft', + /// 'CustomLog', 'RestoredLogs', 'SearchResults' + /// + [JsonProperty(PropertyName = "tableType")] + public string TableType { get; private set; } + + /// + /// Gets the subtype describes what APIs can be used to interact with + /// the table, and what features are available against it. Possible + /// values include: 'Any', 'Classic', 'DataCollectionRuleBased' + /// + [JsonProperty(PropertyName = "tableSubType")] + public string TableSubType { get; private set; } + + /// + /// Gets list of solutions the table is affiliated with + /// + [JsonProperty(PropertyName = "solutions")] + public IList Solutions { get; private set; } + + /// + /// Gets parameters of the search job that initiated this table. + /// + [JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults { get; private set; } + + /// + /// Gets parameters of the restore operation that initiated this table. + /// + [JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs new file mode 100644 index 000000000000..7ab25942d305 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The get schema operation response. + /// + public partial class SearchGetSchemaResponse + { + /// + /// Initializes a new instance of the SearchGetSchemaResponse class. + /// + public SearchGetSchemaResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchGetSchemaResponse class. + /// + /// The metadata from search results. + /// The array of result values. + public SearchGetSchemaResponse(SearchMetadata metadata = default(SearchMetadata), IList value = default(IList)) + { + Metadata = metadata; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the metadata from search results. + /// + [JsonProperty(PropertyName = "metadata")] + public SearchMetadata Metadata { get; set; } + + /// + /// Gets or sets the array of result values. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs new file mode 100644 index 000000000000..94753bf45639 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs @@ -0,0 +1,185 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Metadata for search results. + /// + public partial class SearchMetadata + { + /// + /// Initializes a new instance of the SearchMetadata class. + /// + public SearchMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchMetadata class. + /// + /// The request id of the search. + /// The search result type. + /// The total number of search results. + /// The number of top search results. + /// The id of the search results request. + /// The core summaries. + /// The status of the search results. + /// The start time for the search. + /// The time of last update. + /// The ETag of the search results. + /// How the results are sorted. + /// The request time. + /// The aggregated value + /// field. + /// The aggregated grouping + /// fields. + /// The sum of all aggregates returned in the result + /// set. + /// The max of all aggregates returned in the result + /// set. + /// The schema. + public SearchMetadata(string searchId = default(string), string resultType = default(string), long? total = default(long?), long? top = default(long?), string id = default(string), IList coreSummaries = default(IList), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastUpdated = default(System.DateTime?), string eTag = default(string), IList sort = default(IList), long? requestTime = default(long?), string aggregatedValueField = default(string), string aggregatedGroupingFields = default(string), long? sum = default(long?), long? max = default(long?), SearchMetadataSchema schema = default(SearchMetadataSchema)) + { + SearchId = searchId; + ResultType = resultType; + Total = total; + Top = top; + Id = id; + CoreSummaries = coreSummaries; + Status = status; + StartTime = startTime; + LastUpdated = lastUpdated; + ETag = eTag; + Sort = sort; + RequestTime = requestTime; + AggregatedValueField = aggregatedValueField; + AggregatedGroupingFields = aggregatedGroupingFields; + Sum = sum; + Max = max; + Schema = schema; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the request id of the search. + /// + [JsonProperty(PropertyName = "requestId")] + public string SearchId { get; set; } + + /// + /// Gets or sets the search result type. + /// + [JsonProperty(PropertyName = "resultType")] + public string ResultType { get; set; } + + /// + /// Gets or sets the total number of search results. + /// + [JsonProperty(PropertyName = "total")] + public long? Total { get; set; } + + /// + /// Gets or sets the number of top search results. + /// + [JsonProperty(PropertyName = "top")] + public long? Top { get; set; } + + /// + /// Gets or sets the id of the search results request. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the core summaries. + /// + [JsonProperty(PropertyName = "coreSummaries")] + public IList CoreSummaries { get; set; } + + /// + /// Gets or sets the status of the search results. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the start time for the search. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the time of last update. + /// + [JsonProperty(PropertyName = "lastUpdated")] + public System.DateTime? LastUpdated { get; set; } + + /// + /// Gets or sets the ETag of the search results. + /// + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } + + /// + /// Gets or sets how the results are sorted. + /// + [JsonProperty(PropertyName = "sort")] + public IList Sort { get; set; } + + /// + /// Gets or sets the request time. + /// + [JsonProperty(PropertyName = "requestTime")] + public long? RequestTime { get; set; } + + /// + /// Gets or sets the aggregated value field. + /// + [JsonProperty(PropertyName = "aggregatedValueField")] + public string AggregatedValueField { get; set; } + + /// + /// Gets or sets the aggregated grouping fields. + /// + [JsonProperty(PropertyName = "aggregatedGroupingFields")] + public string AggregatedGroupingFields { get; set; } + + /// + /// Gets or sets the sum of all aggregates returned in the result set. + /// + [JsonProperty(PropertyName = "sum")] + public long? Sum { get; set; } + + /// + /// Gets or sets the max of all aggregates returned in the result set. + /// + [JsonProperty(PropertyName = "max")] + public long? Max { get; set; } + + /// + /// Gets or sets the schema. + /// + [JsonProperty(PropertyName = "schema")] + public SearchMetadataSchema Schema { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs new file mode 100644 index 000000000000..f22e7f8ad3a5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Schema metadata for search. + /// + public partial class SearchMetadataSchema + { + /// + /// Initializes a new instance of the SearchMetadataSchema class. + /// + public SearchMetadataSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchMetadataSchema class. + /// + /// The name of the metadata schema. + /// The version of the metadata schema. + public SearchMetadataSchema(string name = default(string), int? version = default(int?)) + { + Name = name; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the metadata schema. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the version of the metadata schema. + /// + [JsonProperty(PropertyName = "version")] + public int? Version { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs new file mode 100644 index 000000000000..8675e189c120 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Parameters of the search job that initiated this table. + /// + public partial class SearchResults + { + /// + /// Initializes a new instance of the SearchResults class. + /// + public SearchResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchResults class. + /// + /// Search job query. + /// Search job Description. + /// Limit the search job to return up to specified + /// number of rows. + /// The timestamp to start the search + /// from (UTC) + /// The timestamp to end the search by + /// (UTC) + /// The table used in the search job. + public SearchResults(string query = default(string), string description = default(string), int? limit = default(int?), System.DateTime? startSearchTime = default(System.DateTime?), System.DateTime? endSearchTime = default(System.DateTime?), string sourceTable = default(string)) + { + Query = query; + Description = description; + Limit = limit; + StartSearchTime = startSearchTime; + EndSearchTime = endSearchTime; + SourceTable = sourceTable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets search job query. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// Gets or sets search job Description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets limit the search job to return up to specified number + /// of rows. + /// + [JsonProperty(PropertyName = "limit")] + public int? Limit { get; set; } + + /// + /// Gets or sets the timestamp to start the search from (UTC) + /// + [JsonProperty(PropertyName = "startSearchTime")] + public System.DateTime? StartSearchTime { get; set; } + + /// + /// Gets or sets the timestamp to end the search by (UTC) + /// + [JsonProperty(PropertyName = "endSearchTime")] + public System.DateTime? EndSearchTime { get; set; } + + /// + /// Gets the table used in the search job. + /// + [JsonProperty(PropertyName = "sourceTable")] + public string SourceTable { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs new file mode 100644 index 000000000000..a799f47d0fa4 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Value object for schema results. + /// + public partial class SearchSchemaValue + { + /// + /// Initializes a new instance of the SearchSchemaValue class. + /// + public SearchSchemaValue() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchSchemaValue class. + /// + /// The boolean that indicates the field is + /// searchable as free text. + /// The boolean that indicates whether or not the + /// field is stored. + /// The boolean that indicates whether or not the + /// field is a facet. + /// The name of the schema. + /// The display name of the schema. + /// The type. + /// The array of workflows containing the + /// field. + public SearchSchemaValue(bool indexed, bool stored, bool facet, string name = default(string), string displayName = default(string), string type = default(string), IList ownerType = default(IList)) + { + Name = name; + DisplayName = displayName; + Type = type; + Indexed = indexed; + Stored = stored; + Facet = facet; + OwnerType = ownerType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the schema. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the display name of the schema. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the boolean that indicates the field is searchable as + /// free text. + /// + [JsonProperty(PropertyName = "indexed")] + public bool Indexed { get; set; } + + /// + /// Gets or sets the boolean that indicates whether or not the field is + /// stored. + /// + [JsonProperty(PropertyName = "stored")] + public bool Stored { get; set; } + + /// + /// Gets or sets the boolean that indicates whether or not the field is + /// a facet. + /// + [JsonProperty(PropertyName = "facet")] + public bool Facet { get; set; } + + /// + /// Gets or sets the array of workflows containing the field. + /// + [JsonProperty(PropertyName = "ownerType")] + public IList OwnerType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs new file mode 100644 index 000000000000..8a41638d2b7b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The sort parameters for search. + /// + public partial class SearchSort + { + /// + /// Initializes a new instance of the SearchSort class. + /// + public SearchSort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SearchSort class. + /// + /// The name of the field the search query is sorted + /// on. + /// The sort order of the search. Possible values + /// include: 'asc', 'desc' + public SearchSort(string name = default(string), string order = default(string)) + { + Name = name; + Order = order; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the field the search query is sorted on. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the sort order of the search. Possible values include: + /// 'asc', 'desc' + /// + [JsonProperty(PropertyName = "order")] + public string Order { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs new file mode 100644 index 000000000000..0a681c0d75a7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for SearchSortEnum. + /// + public static class SearchSortEnum + { + public const string Asc = "asc"; + public const string Desc = "desc"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs new file mode 100644 index 000000000000..089d88abde3b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The shared keys for a workspace. + /// + public partial class SharedKeys + { + /// + /// Initializes a new instance of the SharedKeys class. + /// + public SharedKeys() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SharedKeys class. + /// + /// The primary shared key of a + /// workspace. + /// The secondary shared key of a + /// workspace. + public SharedKeys(string primarySharedKey = default(string), string secondarySharedKey = default(string)) + { + PrimarySharedKey = primarySharedKey; + SecondarySharedKey = secondarySharedKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the primary shared key of a workspace. + /// + [JsonProperty(PropertyName = "primarySharedKey")] + public string PrimarySharedKey { get; set; } + + /// + /// Gets or sets the secondary shared key of a workspace. + /// + [JsonProperty(PropertyName = "secondarySharedKey")] + public string SecondarySharedKey { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs new file mode 100644 index 000000000000..6f99cb627e0f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for SkuNameEnum. + /// + public static class SkuNameEnum + { + public const string Free = "Free"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string PerNode = "PerNode"; + public const string PerGB2018 = "PerGB2018"; + public const string Standalone = "Standalone"; + public const string CapacityReservation = "CapacityReservation"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs new file mode 100644 index 000000000000..1174fdc4c720 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for SourceEnum. + /// + public static class SourceEnum + { + /// + /// Tables provisioned by the system, as collected via Diagnostic + /// Settings, the Agents, or any other standard data collection means. + /// + public const string Microsoft = "microsoft"; + /// + /// Tables created by the owner of the Workspace, and only found in + /// this Workspace. + /// + public const string Customer = "customer"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs new file mode 100644 index 000000000000..933aa1fa9750 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a storage account connection. + /// + public partial class StorageAccount + { + /// + /// Initializes a new instance of the StorageAccount class. + /// + public StorageAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageAccount class. + /// + /// The Azure Resource Manager ID of the storage + /// account resource. + /// The storage account key. + public StorageAccount(string id, string key) + { + Id = id; + Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Azure Resource Manager ID of the storage account + /// resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the storage account key. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Key"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs new file mode 100644 index 000000000000..0e95b99f9a8f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level storage insight resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class StorageInsight : ProxyResource + { + /// + /// Initializes a new instance of the StorageInsight class. + /// + public StorageInsight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsight class. + /// + /// The storage account connection + /// details + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The names of the blob containers that the + /// workspace should read + /// The names of the Azure tables that the + /// workspace should read + /// The status of the storage insight + /// The ETag of the storage insight. + /// Resource tags. + public StorageInsight(StorageAccount storageAccount, string id = default(string), string name = default(string), string type = default(string), IList containers = default(IList), IList tables = default(IList), StorageInsightStatus status = default(StorageInsightStatus), string eTag = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Containers = containers; + Tables = tables; + StorageAccount = storageAccount; + Status = status; + ETag = eTag; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the names of the blob containers that the workspace + /// should read + /// + [JsonProperty(PropertyName = "properties.containers")] + public IList Containers { get; set; } + + /// + /// Gets or sets the names of the Azure tables that the workspace + /// should read + /// + [JsonProperty(PropertyName = "properties.tables")] + public IList Tables { get; set; } + + /// + /// Gets or sets the storage account connection details + /// + [JsonProperty(PropertyName = "properties.storageAccount")] + public StorageAccount StorageAccount { get; set; } + + /// + /// Gets the status of the storage insight + /// + [JsonProperty(PropertyName = "properties.status")] + public StorageInsightStatus Status { get; private set; } + + /// + /// Gets or sets the ETag of the storage insight. + /// + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccount == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccount"); + } + if (StorageAccount != null) + { + StorageAccount.Validate(); + } + if (Status != null) + { + Status.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs new file mode 100644 index 000000000000..b640af7c0230 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for StorageInsightState. + /// + public static class StorageInsightState + { + public const string OK = "OK"; + public const string ERROR = "ERROR"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs new file mode 100644 index 000000000000..24d77243b3e8 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The status of the storage insight. + /// + public partial class StorageInsightStatus + { + /// + /// Initializes a new instance of the StorageInsightStatus class. + /// + public StorageInsightStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsightStatus class. + /// + /// The state of the storage insight connection to + /// the workspace. Possible values include: 'OK', 'ERROR' + /// Description of the state of the storage + /// insight. + public StorageInsightStatus(string state, string description = default(string)) + { + State = state; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state of the storage insight connection to the + /// workspace. Possible values include: 'OK', 'ERROR' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Gets or sets description of the state of the storage insight. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (State == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "State"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..964c4aa5e6b6 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs new file mode 100644 index 000000000000..a2e91b99ad65 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs @@ -0,0 +1,201 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace data table definition. + /// + [Rest.Serialization.JsonTransformation] + public partial class Table : ProxyResource + { + /// + /// Initializes a new instance of the Table class. + /// + public Table() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Table class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The table retention in days, between + /// 4 and 730. Setting this property to -1 will default to the + /// workspace retention. + /// The table total retention in + /// days, between 4 and 2555. Setting this property to -1 will default + /// to table retention. + /// The table data archive + /// retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// Parameters of the search job that + /// initiated this table. + /// Parameters of the restore operation that + /// initiated this table. + /// Search job execution + /// statistics. + /// Instruct the system how to handle and charge the + /// logs ingested to this table. Possible values include: 'Basic', + /// 'Analytics' + /// The timestamp that table plan + /// was last modified (UTC). + /// Table schema. + /// Table's current provisioning state. + /// If set to 'updating', indicates a resource lock due to ongoing + /// operation, forbidding any update to the table until the ongoing + /// operation is concluded. Possible values include: 'Updating', + /// 'InProgress', 'Succeeded' + public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + RetentionInDays = retentionInDays; + TotalRetentionInDays = totalRetentionInDays; + ArchiveRetentionInDays = archiveRetentionInDays; + SearchResults = searchResults; + RestoredLogs = restoredLogs; + ResultStatistics = resultStatistics; + Plan = plan; + LastPlanModifiedDate = lastPlanModifiedDate; + Schema = schema; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the table retention in days, between 4 and 730. + /// Setting this property to -1 will default to the workspace + /// retention. + /// + [JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays { get; set; } + + /// + /// Gets or sets the table total retention in days, between 4 and 2555. + /// Setting this property to -1 will default to table retention. + /// + [JsonProperty(PropertyName = "properties.totalRetentionInDays")] + public int? TotalRetentionInDays { get; set; } + + /// + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + [JsonProperty(PropertyName = "properties.archiveRetentionInDays")] + public int? ArchiveRetentionInDays { get; private set; } + + /// + /// Gets or sets parameters of the search job that initiated this + /// table. + /// + [JsonProperty(PropertyName = "properties.searchResults")] + public SearchResults SearchResults { get; set; } + + /// + /// Gets or sets parameters of the restore operation that initiated + /// this table. + /// + [JsonProperty(PropertyName = "properties.restoredLogs")] + public RestoredLogs RestoredLogs { get; set; } + + /// + /// Gets or sets search job execution statistics. + /// + [JsonProperty(PropertyName = "properties.resultStatistics")] + public ResultStatistics ResultStatistics { get; set; } + + /// + /// Gets or sets instruct the system how to handle and charge the logs + /// ingested to this table. Possible values include: 'Basic', + /// 'Analytics' + /// + [JsonProperty(PropertyName = "properties.plan")] + public string Plan { get; set; } + + /// + /// Gets the timestamp that table plan was last modified (UTC). + /// + [JsonProperty(PropertyName = "properties.lastPlanModifiedDate")] + public string LastPlanModifiedDate { get; private set; } + + /// + /// Gets or sets table schema. + /// + [JsonProperty(PropertyName = "properties.schema")] + public Schema Schema { get; set; } + + /// + /// Gets table's current provisioning state. If set to 'updating', + /// indicates a resource lock due to ongoing operation, forbidding any + /// update to the table until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RetentionInDays != null) + { + if (RetentionInDays > 730) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (RetentionInDays < 4) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + } + } + if (TotalRetentionInDays != null) + { + if (TotalRetentionInDays > 2555) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + } + if (TotalRetentionInDays < 4) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + } + } + if (ResultStatistics != null) + { + ResultStatistics.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs new file mode 100644 index 000000000000..7a408029858f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TablePlanEnum. + /// + public static class TablePlanEnum + { + /// + /// Logs that are adjusted to support high volume low value verbose + /// logs. + /// + public const string Basic = "Basic"; + /// + /// Logs that allow monitoring and analytics. + /// + public const string Analytics = "Analytics"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs new file mode 100644 index 000000000000..66290ed88e5e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TableSubTypeEnum. + /// + public static class TableSubTypeEnum + { + /// + /// The default subtype with which built-in tables are created. + /// + public const string Any = "Any"; + /// + /// Indicates a table created through the Data Collector API or with + /// the custom logs feature of the MMA agent, or any table against + /// which Custom Fields were created. + /// + public const string Classic = "Classic"; + /// + /// A table eligible to have data sent into it via any of the means + /// supported by Data Collection Rules: the Data Collection Endpoint + /// API, ingestion-time transformations, or any other mechanism + /// provided by Data Collection Rules + /// + public const string DataCollectionRuleBased = "DataCollectionRuleBased"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs new file mode 100644 index 000000000000..c0a47dc4ff49 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for TableTypeEnum. + /// + public static class TableTypeEnum + { + /// + /// Standard data collected by Azure Monitor. + /// + public const string Microsoft = "Microsoft"; + /// + /// Custom log table. + /// + public const string CustomLog = "CustomLog"; + /// + /// Restored data. + /// + public const string RestoredLogs = "RestoredLogs"; + /// + /// Data collected by a search job. + /// + public const string SearchResults = "SearchResults"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs new file mode 100644 index 000000000000..0217ed7c7775 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A tag of a saved search. + /// + public partial class Tag + { + /// + /// Initializes a new instance of the Tag class. + /// + public Tag() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Tag class. + /// + /// The tag name. + /// The tag value. + public Tag(string name, string value) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the tag name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the tag value. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..3bf49fa1ae27 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked Resource + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs new file mode 100644 index 000000000000..5041fa877447 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for Type. + /// + public static class Type + { + public const string StorageAccount = "StorageAccount"; + public const string EventHub = "EventHub"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs new file mode 100644 index 000000000000..d7d330e90858 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A metric describing the usage of a resource. + /// + public partial class UsageMetric + { + /// + /// Initializes a new instance of the UsageMetric class. + /// + public UsageMetric() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UsageMetric class. + /// + /// The name of the metric. + /// The units used for the metric. + /// The current value of the metric. + /// The quota limit for the metric. + /// The time that the metric's value will + /// reset. + /// The quota period that determines the + /// length of time between value resets. + public UsageMetric(MetricName name = default(MetricName), string unit = default(string), double? currentValue = default(double?), double? limit = default(double?), System.DateTime? nextResetTime = default(System.DateTime?), string quotaPeriod = default(string)) + { + Name = name; + Unit = unit; + CurrentValue = currentValue; + Limit = limit; + NextResetTime = nextResetTime; + QuotaPeriod = quotaPeriod; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the metric. + /// + [JsonProperty(PropertyName = "name")] + public MetricName Name { get; set; } + + /// + /// Gets or sets the units used for the metric. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets the current value of the metric. + /// + [JsonProperty(PropertyName = "currentValue")] + public double? CurrentValue { get; set; } + + /// + /// Gets or sets the quota limit for the metric. + /// + [JsonProperty(PropertyName = "limit")] + public double? Limit { get; set; } + + /// + /// Gets or sets the time that the metric's value will reset. + /// + [JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime { get; set; } + + /// + /// Gets or sets the quota period that determines the length of time + /// between value resets. + /// + [JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs new file mode 100644 index 000000000000..ebe5da6faf3a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// User assigned identity properties. + /// + public partial class UserIdentityProperties + { + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + public UserIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs new file mode 100644 index 000000000000..30cfa30eaef6 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs @@ -0,0 +1,215 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level Workspace resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class Workspace : TrackedResource + { + /// + /// Initializes a new instance of the Workspace class. + /// + public Workspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workspace class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// The provisioning state of the + /// workspace. Possible values include: 'Creating', 'Succeeded', + /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + /// This is a read-only property. Represents + /// the ID associated with the workspace. + /// The SKU of the workspace. + /// The workspace data retention in days. + /// Allowed values are per pricing plan. See pricing tiers + /// documentation for details. + /// The daily volume cap for + /// ingestion. + /// Workspace creation date. + /// Workspace modification date. + /// The network access + /// type for accessing Log Analytics ingestion. Possible values + /// include: 'Enabled', 'Disabled' + /// The network access type + /// for accessing Log Analytics query. Possible values include: + /// 'Enabled', 'Disabled' + /// Indicates whether customer managed + /// storage is mandatory for query management. + /// List of linked private + /// link scope resources. + /// Workspace features. + /// The resource ID + /// of the default Data Collection Rule to use for this workspace. + /// Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// The ETag of the workspace. + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), SystemData systemData = default(SystemData), string eTag = default(string)) + : base(location, id, name, type, tags) + { + ProvisioningState = provisioningState; + CustomerId = customerId; + Sku = sku; + RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; + CreatedDate = createdDate; + ModifiedDate = modifiedDate; + PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + ForceCmkForQuery = forceCmkForQuery; + PrivateLinkScopedResources = privateLinkScopedResources; + Features = features; + DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + SystemData = systemData; + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state of the workspace. Possible values + /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + /// 'ProvisioningAccount', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated + /// with the workspace. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku { get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values + /// are per pricing plan. See pricing tiers documentation for details. + /// + [JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays { get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + + /// + /// Gets workspace creation date. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets workspace modification date. + /// + [JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate { get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics + /// ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion { get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics + /// query. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery { get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is + /// mandatory for query management. + /// + [JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery { get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public IList PrivateLinkScopedResources { get; private set; } + + /// + /// Gets or sets workspace features. + /// + [JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features { get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to + /// use for this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId { get; set; } + + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Gets or sets the ETag of the workspace. + /// + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs new file mode 100644 index 000000000000..21334397f8a0 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The daily volume cap for ingestion. + /// + public partial class WorkspaceCapping + { + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + public WorkspaceCapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + /// The workspace daily quota for + /// ingestion. + /// The time when the quota will be + /// rest. + /// The status of data ingestion for + /// this workspace. Possible values include: 'RespectQuota', 'ForceOn', + /// 'ForceOff', 'OverQuota', 'SubscriptionSuspended', + /// 'ApproachingQuota' + public WorkspaceCapping(double? dailyQuotaGb = default(double?), string quotaNextResetTime = default(string), string dataIngestionStatus = default(string)) + { + DailyQuotaGb = dailyQuotaGb; + QuotaNextResetTime = quotaNextResetTime; + DataIngestionStatus = dataIngestionStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the workspace daily quota for ingestion. + /// + [JsonProperty(PropertyName = "dailyQuotaGb")] + public double? DailyQuotaGb { get; set; } + + /// + /// Gets the time when the quota will be rest. + /// + [JsonProperty(PropertyName = "quotaNextResetTime")] + public string QuotaNextResetTime { get; private set; } + + /// + /// Gets the status of data ingestion for this workspace. Possible + /// values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', + /// 'SubscriptionSuspended', 'ApproachingQuota' + /// + [JsonProperty(PropertyName = "dataIngestionStatus")] + public string DataIngestionStatus { get; private set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs new file mode 100644 index 000000000000..4863a223b41a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs @@ -0,0 +1,27 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for WorkspaceEntityStatus. + /// + public static class WorkspaceEntityStatus + { + public const string Creating = "Creating"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Deleting = "Deleting"; + public const string ProvisioningAccount = "ProvisioningAccount"; + public const string Updating = "Updating"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs new file mode 100644 index 000000000000..43b3cefe27d2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Workspace features. + /// + public partial class WorkspaceFeatures + { + /// + /// Initializes a new instance of the WorkspaceFeatures class. + /// + public WorkspaceFeatures() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceFeatures class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Flag that indicate if data should be + /// exported. + /// Flag that describes if we + /// want to remove the data after 30 days. + /// Flag that + /// indicate which permission to use - resource or workspace or + /// both. + /// Dedicated LA cluster resourceId + /// that is linked to the workspaces. + /// Disable Non-AAD based Auth. + public WorkspaceFeatures(IDictionary additionalProperties = default(IDictionary), bool? enableDataExport = default(bool?), bool? immediatePurgeDataOn30Days = default(bool?), bool? enableLogAccessUsingOnlyResourcePermissions = default(bool?), string clusterResourceId = default(string), bool? disableLocalAuth = default(bool?)) + { + AdditionalProperties = additionalProperties; + EnableDataExport = enableDataExport; + ImmediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + EnableLogAccessUsingOnlyResourcePermissions = enableLogAccessUsingOnlyResourcePermissions; + ClusterResourceId = clusterResourceId; + DisableLocalAuth = disableLocalAuth; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets or sets flag that indicate if data should be exported. + /// + [JsonProperty(PropertyName = "enableDataExport")] + public bool? EnableDataExport { get; set; } + + /// + /// Gets or sets flag that describes if we want to remove the data + /// after 30 days. + /// + [JsonProperty(PropertyName = "immediatePurgeDataOn30Days")] + public bool? ImmediatePurgeDataOn30Days { get; set; } + + /// + /// Gets or sets flag that indicate which permission to use - resource + /// or workspace or both. + /// + [JsonProperty(PropertyName = "enableLogAccessUsingOnlyResourcePermissions")] + public bool? EnableLogAccessUsingOnlyResourcePermissions { get; set; } + + /// + /// Gets or sets dedicated LA cluster resourceId that is linked to the + /// workspaces. + /// + [JsonProperty(PropertyName = "clusterResourceId")] + public string ClusterResourceId { get; set; } + + /// + /// Gets or sets disable Non-AAD based Auth. + /// + [JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs new file mode 100644 index 000000000000..308ed59db14d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs @@ -0,0 +1,206 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The top level Workspace resource container. + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspacePatch : AzureEntityResource + { + /// + /// Initializes a new instance of the WorkspacePatch class. + /// + public WorkspacePatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePatch class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + /// The provisioning state of the + /// workspace. Possible values include: 'Creating', 'Succeeded', + /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + /// This is a read-only property. Represents + /// the ID associated with the workspace. + /// The SKU of the workspace. + /// The workspace data retention in days. + /// Allowed values are per pricing plan. See pricing tiers + /// documentation for details. + /// The daily volume cap for + /// ingestion. + /// Workspace creation date. + /// Workspace modification date. + /// The network access + /// type for accessing Log Analytics ingestion. Possible values + /// include: 'Enabled', 'Disabled' + /// The network access type + /// for accessing Log Analytics query. Possible values include: + /// 'Enabled', 'Disabled' + /// Indicates whether customer managed + /// storage is mandatory for query management. + /// List of linked private + /// link scope resources. + /// Workspace features. + /// The resource ID + /// of the default Data Collection Rule to use for this workspace. + /// Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// Resource tags. Optional. + public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type, etag) + { + ProvisioningState = provisioningState; + CustomerId = customerId; + Sku = sku; + RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; + CreatedDate = createdDate; + ModifiedDate = modifiedDate; + PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + ForceCmkForQuery = forceCmkForQuery; + PrivateLinkScopedResources = privateLinkScopedResources; + Features = features; + DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state of the workspace. Possible values + /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + /// 'ProvisioningAccount', 'Updating' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated + /// with the workspace. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku { get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values + /// are per pricing plan. See pricing tiers documentation for details. + /// + [JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays { get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + + /// + /// Gets workspace creation date. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets workspace modification date. + /// + [JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate { get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics + /// ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion { get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics + /// query. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery { get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is + /// mandatory for query management. + /// + [JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery { get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public IList PrivateLinkScopedResources { get; private set; } + + /// + /// Gets or sets workspace features. + /// + [JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features { get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to + /// use for this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId { get; set; } + + /// + /// Gets or sets resource tags. Optional. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs new file mode 100644 index 000000000000..ba29038ffa6e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the body of a purge request for an App Insights Workspace + /// + public partial class WorkspacePurgeBody + { + /// + /// Initializes a new instance of the WorkspacePurgeBody class. + /// + public WorkspacePurgeBody() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeBody class. + /// + /// Table from which to purge data. + /// The set of columns and filters (queries) to + /// run over them to purge the resulting data. + public WorkspacePurgeBody(string table, IList filters) + { + Table = table; + Filters = filters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets table from which to purge data. + /// + [JsonProperty(PropertyName = "table")] + public string Table { get; set; } + + /// + /// Gets or sets the set of columns and filters (queries) to run over + /// them to purge the resulting data. + /// + [JsonProperty(PropertyName = "filters")] + public IList Filters { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Table == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Table"); + } + if (Filters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Filters"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs new file mode 100644 index 000000000000..829096e31e90 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// User-defined filters to return data which will be purged from the + /// table. + /// + public partial class WorkspacePurgeBodyFilters + { + /// + /// Initializes a new instance of the WorkspacePurgeBodyFilters class. + /// + public WorkspacePurgeBodyFilters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeBodyFilters class. + /// + /// The column of the table over which the given + /// query should run + /// A query operator to evaluate over + /// the provided column and value(s). Supported operators are ==, =~, + /// in, in~, >, >=, <, <=, between, and have the same + /// behavior as they would in a KQL query. + /// the value for the operator to function over. + /// This can be a number (e.g., > 100), a string (timestamp >= + /// '2017-09-01') or array of values. + /// When filtering over custom dimensions, this key + /// will be used as the name of the custom dimension. + public WorkspacePurgeBodyFilters(string column = default(string), string operatorProperty = default(string), object value = default(object), string key = default(string)) + { + Column = column; + OperatorProperty = operatorProperty; + Value = value; + Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the column of the table over which the given query + /// should run + /// + [JsonProperty(PropertyName = "column")] + public string Column { get; set; } + + /// + /// Gets or sets a query operator to evaluate over the provided column + /// and value(s). Supported operators are ==, =~, in, in~, &gt;, + /// &gt;=, &lt;, &lt;=, between, and have the same behavior + /// as they would in a KQL query. + /// + [JsonProperty(PropertyName = "operator")] + public string OperatorProperty { get; set; } + + /// + /// Gets or sets the value for the operator to function over. This can + /// be a number (e.g., &gt; 100), a string (timestamp &gt;= + /// '2017-09-01') or array of values. + /// + [JsonProperty(PropertyName = "value")] + public object Value { get; set; } + + /// + /// Gets or sets when filtering over custom dimensions, this key will + /// be used as the name of the custom dimension. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs new file mode 100644 index 000000000000..729968083c35 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Purge operation. + /// + public partial class WorkspacePurgePurgeHeaders + { + /// + /// Initializes a new instance of the WorkspacePurgePurgeHeaders class. + /// + public WorkspacePurgePurgeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgePurgeHeaders class. + /// + /// The location from which to request + /// the operation status. + public WorkspacePurgePurgeHeaders(string xMsStatusLocation = default(string)) + { + XMsStatusLocation = xMsStatusLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the location from which to request the operation + /// status. + /// + [JsonProperty(PropertyName = "x-ms-status-location")] + public string XMsStatusLocation { get; set; } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs new file mode 100644 index 000000000000..f248a8c344b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response containing operationId for a specific purge action. + /// + public partial class WorkspacePurgeResponse + { + /// + /// Initializes a new instance of the WorkspacePurgeResponse class. + /// + public WorkspacePurgeResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeResponse class. + /// + /// Id to use when querying for status for a + /// particular purge operation. + public WorkspacePurgeResponse(string operationId) + { + OperationId = operationId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets id to use when querying for status for a particular + /// purge operation. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (OperationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OperationId"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs new file mode 100644 index 000000000000..dc9439c0c469 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response containing status for a specific purge operation. + /// + public partial class WorkspacePurgeStatusResponse + { + /// + /// Initializes a new instance of the WorkspacePurgeStatusResponse + /// class. + /// + public WorkspacePurgeStatusResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeStatusResponse + /// class. + /// + /// Status of the operation represented by the + /// requested Id. Possible values include: 'pending', + /// 'completed' + public WorkspacePurgeStatusResponse(string status) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the operation represented by the requested + /// Id. Possible values include: 'pending', 'completed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs new file mode 100644 index 000000000000..7a9c6153a300 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The SKU (tier) of a workspace. + /// + public partial class WorkspaceSku + { + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + public WorkspaceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceSku class. + /// + /// The name of the SKU. Possible values include: + /// 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', + /// 'Standalone', 'CapacityReservation', 'LACluster' + /// The capacity reservation + /// level in GB for this workspace, when CapacityReservation sku is + /// selected. + /// The last time when the sku was + /// updated. + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) + { + Name = name; + CapacityReservationLevel = capacityReservationLevel; + LastSkuUpdate = lastSkuUpdate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the SKU. Possible values include: 'Free', + /// 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', + /// 'CapacityReservation', 'LACluster' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the capacity reservation level in GB for this + /// workspace, when CapacityReservation sku is selected. + /// + [JsonProperty(PropertyName = "capacityReservationLevel")] + public int? CapacityReservationLevel { get; set; } + + /// + /// Gets the last time when the sku was updated. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs new file mode 100644 index 000000000000..8706725bae8d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for WorkspaceSkuNameEnum. + /// + public static class WorkspaceSkuNameEnum + { + public const string Free = "Free"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + public const string PerNode = "PerNode"; + public const string PerGB2018 = "PerGB2018"; + public const string Standalone = "Standalone"; + public const string CapacityReservation = "CapacityReservation"; + public const string LACluster = "LACluster"; + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs new file mode 100644 index 000000000000..c2d691db9046 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs @@ -0,0 +1,255 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusesOperations operations. + /// + internal partial class OperationStatusesOperations : IServiceOperations, IOperationStatusesOperations + { + /// + /// Initializes a new instance of the OperationStatusesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationStatusesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (asyncOperationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "asyncOperationId"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("asyncOperationId", asyncOperationId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{asyncOperationId}", System.Uri.EscapeDataString(asyncOperationId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..c4e6012e0ee1 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationStatusesOperations. + /// + public static partial class OperationStatusesOperationsExtensions + { + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + public static OperationStatus Get(this IOperationStatusesOperations operations, string location, string asyncOperationId) + { + return operations.GetAsync(location, asyncOperationId).GetAwaiter().GetResult(); + } + + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationStatusesOperations operations, string location, string asyncOperationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, asyncOperationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs new file mode 100644 index 000000000000..30dcc115a3e5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs @@ -0,0 +1,465 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + public partial class OperationalInsightsManagementClient : ServiceClient, IOperationalInsightsManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The ID of the target subscription. + /// + public string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } + + /// + /// Gets the ITablesOperations. + /// + public virtual ITablesOperations Tables { get; private set; } + + /// + /// Gets the IDataExportsOperations. + /// + public virtual IDataExportsOperations DataExports { get; private set; } + + /// + /// Gets the IDataSourcesOperations. + /// + public virtual IDataSourcesOperations DataSources { get; private set; } + + /// + /// Gets the IIntelligencePacksOperations. + /// + public virtual IIntelligencePacksOperations IntelligencePacks { get; private set; } + + /// + /// Gets the ILinkedServicesOperations. + /// + public virtual ILinkedServicesOperations LinkedServices { get; private set; } + + /// + /// Gets the ILinkedStorageAccountsOperations. + /// + public virtual ILinkedStorageAccountsOperations LinkedStorageAccounts { get; private set; } + + /// + /// Gets the IManagementGroupsOperations. + /// + public virtual IManagementGroupsOperations ManagementGroups { get; private set; } + + /// + /// Gets the IOperationStatusesOperations. + /// + public virtual IOperationStatusesOperations OperationStatuses { get; private set; } + + /// + /// Gets the ISharedKeysOperations. + /// + public virtual ISharedKeysOperations SharedKeys { get; private set; } + + /// + /// Gets the IUsagesOperations. + /// + public virtual IUsagesOperations Usages { get; private set; } + + /// + /// Gets the IStorageInsightConfigsOperations. + /// + public virtual IStorageInsightConfigsOperations StorageInsightConfigs { get; private set; } + + /// + /// Gets the ISavedSearchesOperations. + /// + public virtual ISavedSearchesOperations SavedSearches { get; private set; } + + /// + /// Gets the IAvailableServiceTiersOperations. + /// + public virtual IAvailableServiceTiersOperations AvailableServiceTiers { get; private set; } + + /// + /// Gets the IGatewaysOperations. + /// + public virtual IGatewaysOperations Gateways { get; private set; } + + /// + /// Gets the ISchemaOperations. + /// + public virtual ISchemaOperations Schema { get; private set; } + + /// + /// Gets the IWorkspacePurgeOperations. + /// + public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } + + /// + /// Gets the IClustersOperations. + /// + public virtual IClustersOperations Clusters { get; private set; } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling OperationalInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + protected OperationalInsightsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected OperationalInsightsManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected OperationalInsightsManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected OperationalInsightsManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected OperationalInsightsManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling OperationalInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Operations = new Operations(this); + Workspaces = new WorkspacesOperations(this); + DeletedWorkspaces = new DeletedWorkspacesOperations(this); + Tables = new TablesOperations(this); + DataExports = new DataExportsOperations(this); + DataSources = new DataSourcesOperations(this); + IntelligencePacks = new IntelligencePacksOperations(this); + LinkedServices = new LinkedServicesOperations(this); + LinkedStorageAccounts = new LinkedStorageAccountsOperations(this); + ManagementGroups = new ManagementGroupsOperations(this); + OperationStatuses = new OperationStatusesOperations(this); + SharedKeys = new SharedKeysOperations(this); + Usages = new UsagesOperations(this); + StorageInsightConfigs = new StorageInsightConfigsOperations(this); + SavedSearches = new SavedSearchesOperations(this); + AvailableServiceTiers = new AvailableServiceTiersOperations(this); + Gateways = new GatewaysOperations(this); + Schema = new SchemaOperations(this); + WorkspacePurge = new WorkspacePurgeOperations(this); + Clusters = new ClustersOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs new file mode 100644 index 000000000000..8780c7fb6d41 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs @@ -0,0 +1,382 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.OperationalInsights/operations").ToString(); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..88b7fd3d4e71 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs new file mode 100644 index 000000000000..cb8dcc2f74ff --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs @@ -0,0 +1,986 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SavedSearchesOperations operations. + /// + internal partial class SavedSearchesOperations : IServiceOperations, ISavedSearchesOperations + { + /// + /// Initializes a new instance of the SavedSearchesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SavedSearchesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (savedSearchId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs new file mode 100644 index 000000000000..bd0160bdcf68 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs @@ -0,0 +1,206 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SavedSearchesOperations. + /// + public static partial class SavedSearchesOperationsExtensions + { + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static void Delete(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + operations.DeleteAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The parameters required to save a search. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static SavedSearch Get(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + return operations.GetAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SavedSearchesListResult ListByWorkspace(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task ListByWorkspaceAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs new file mode 100644 index 000000000000..3681f0a61987 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SchemaOperations operations. + /// + internal partial class SchemaOperations : IServiceOperations, ISchemaOperations + { + /// + /// Initializes a new instance of the SchemaOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SchemaOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the schema for a given workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs new file mode 100644 index 000000000000..dbeb3dd2bc27 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SchemaOperations. + /// + public static partial class SchemaOperationsExtensions + { + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SearchGetSchemaResponse Get(this ISchemaOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISchemaOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs new file mode 100644 index 000000000000..0d1aeeb16983 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs @@ -0,0 +1,46 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_OperationalInsightsManagementClient + { + get + { + return new Tuple[] + { + new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-08-01"), + new Tuple("OperationalInsights", "Clusters", "2021-06-01"), + new Tuple("OperationalInsights", "DataExports", "2020-08-01"), + new Tuple("OperationalInsights", "DataSources", "2020-08-01"), + new Tuple("OperationalInsights", "DeletedWorkspaces", "2021-12-01-preview"), + new Tuple("OperationalInsights", "Gateways", "2020-08-01"), + new Tuple("OperationalInsights", "IntelligencePacks", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedServices", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-08-01"), + new Tuple("OperationalInsights", "ManagementGroups", "2020-08-01"), + new Tuple("OperationalInsights", "OperationStatuses", "2020-08-01"), + new Tuple("OperationalInsights", "Operations", "2021-12-01-preview"), + new Tuple("OperationalInsights", "SavedSearches", "2020-08-01"), + new Tuple("OperationalInsights", "Schema", "2020-08-01"), + new Tuple("OperationalInsights", "SharedKeys", "2020-08-01"), + new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-08-01"), + new Tuple("OperationalInsights", "Tables", "2021-12-01-preview"), + new Tuple("OperationalInsights", "Usages", "2020-08-01"), + new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), + new Tuple("OperationalInsights", "Workspaces", "2021-12-01-preview"), + }.AsEnumerable(); + } + } + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs new file mode 100644 index 000000000000..3ff3be59e77f --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs @@ -0,0 +1,509 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharedKeysOperations operations. + /// + internal partial class SharedKeysOperations : IServiceOperations, ISharedKeysOperations + { + /// + /// Initializes a new instance of the SharedKeysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SharedKeysOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetSharedKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Regenerate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs new file mode 100644 index 000000000000..d867f85ec9ee --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SharedKeysOperations. + /// + public static partial class SharedKeysOperationsExtensions + { + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys GetSharedKeys(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetSharedKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetSharedKeysAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetSharedKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys Regenerate(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return operations.RegenerateAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs new file mode 100644 index 000000000000..f9aaa53440c2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs @@ -0,0 +1,1177 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageInsightConfigsOperations operations. + /// + internal partial class StorageInsightConfigsOperations : IServiceOperations, IStorageInsightConfigsOperations + { + /// + /// Initializes a new instance of the StorageInsightConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal StorageInsightConfigsOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Create or update a storage insight. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a storage insight instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (storageInsightName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..d6a7241509a6 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs @@ -0,0 +1,240 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for StorageInsightConfigsOperations. + /// + public static partial class StorageInsightConfigsOperationsExtensions + { + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + public static StorageInsight CreateOrUpdate(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, storageInsightName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The parameters required to create or update a storage insight. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static StorageInsight Get(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + return operations.GetAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } + + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static void Delete(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IPage ListByWorkspace(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByWorkspaceNext(this IStorageInsightConfigsOperations operations, string nextPageLink) + { + return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceNextAsync(this IStorageInsightConfigsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs new file mode 100644 index 000000000000..68ab5674a04a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs @@ -0,0 +1,1504 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TablesOperations operations. + /// + internal partial class TablesOperations : IServiceOperations, ITablesOperations + { + /// + /// Initializes a new instance of the TablesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TablesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse
_response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs new file mode 100644 index 000000000000..cecdd43a657e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs @@ -0,0 +1,454 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for TablesOperations. + /// + public static partial class TablesOperationsExtensions + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table CreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
CreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Get(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + return operations.GetAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Delete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Migrate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.MigrateAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task MigrateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table BeginCreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
BeginCreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table BeginUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
BeginUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void BeginDelete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs new file mode 100644 index 000000000000..9dc81912a309 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs @@ -0,0 +1,281 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 000000000000..0f082fe105a3 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UsagesOperations. + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IEnumerable List(this IUsagesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUsagesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs new file mode 100644 index 000000000000..421f17d5e458 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs @@ -0,0 +1,557 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacePurgeOperations operations. + /// + internal partial class WorkspacePurgeOperations : IServiceOperations, IWorkspacePurgeOperations + { + /// + /// Initializes a new instance of the WorkspacePurgeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Purge", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (purgeId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "purgeId"); + } + string apiVersion = "2020-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("purgeId", purgeId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPurgeStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{purgeId}", System.Uri.EscapeDataString(purgeId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs new file mode 100644 index 000000000000..7a9c982bbd8e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs @@ -0,0 +1,135 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacePurgeOperations. + /// + public static partial class WorkspacePurgeOperationsExtensions + { + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace + /// + public static WorkspacePurgeResponse Purge(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body) + { + return operations.PurgeAsync(resourceGroupName, workspaceName, body).GetAwaiter().GetResult(); + } + + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace + /// + /// + /// The cancellation token. + /// + public static async Task PurgeAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PurgeWithHttpMessagesAsync(resourceGroupName, workspaceName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + public static WorkspacePurgeStatusResponse GetPurgeStatus(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId) + { + return operations.GetPurgeStatusAsync(resourceGroupName, workspaceName, purgeId).GetAwaiter().GetResult(); + } + + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// The cancellation token. + /// + public static async Task GetPurgeStatusAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPurgeStatusWithHttpMessagesAsync(resourceGroupName, workspaceName, purgeId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs new file mode 100644 index 000000000000..37ea4a2bed6a --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs @@ -0,0 +1,1413 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspacesOperations operations. + /// + internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + { + /// + /// Initializes a new instance of the WorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspacesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets the workspaces in a subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets workspaces in a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a workspace instance. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a workspace. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2021-12-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("force", force); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..360e15a73131 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs @@ -0,0 +1,369 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspacesOperations. + /// + public static partial class WorkspacesOperationsExtensions + { + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable List(this IWorkspacesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IEnumerable ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + operations.DeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to patch a workspace. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The parameters required to create or update a workspace. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + operations.BeginDeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } + + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj b/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj new file mode 100644 index 000000000000..6957308c8e65 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/OperationalInsights.Management.Sdk.csproj @@ -0,0 +1,13 @@ + + + OperationalInsights + + + + netstandard2.0 + Microsoft.Azure.PowerShell.OperationalInsights.Management.Sdk + Microsoft.Azure.Management.OperationalInsights + $(NoWarn);CS0108;CS1573 + + + \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..313990cacdbb --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Powershell - OperationalInsights Management SDK")] +[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] +[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] +[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] + +[assembly: ComVisible(false)] +[assembly: CLSCompliant(false)] +[assembly: AssemblyVersion("0.25.0.0")] +[assembly: AssemblyFileVersion("0.25.0.0")] \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md new file mode 100644 index 000000000000..cf6fcb51d72d --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md @@ -0,0 +1,95 @@ +# Overall +This directory contains management plane service clients of Az.OperationalInsights module. + +## Run Generation +In this directory, run AutoRest: +``` +autorest --reset +autorest --use:@microsoft.azure/autorest.csharp@2.3.90 +autorest.cmd README.md --version=v2 +``` + +### AutoRest Configuration +> see https://aka.ms/autorest +``` yaml +csharp: true +clear-output-folder: true +reflect-api-versions: true +openapi-type: arm +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +payload-flattening-threshold: 1 +title: OperationalInsightsManagementClient +``` + + + +### +``` yaml +commit: 9673e2239f4f8257b2e916df2d15e1ef41c5bfd1 +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Operations.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Workspaces.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Tables.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/DataExports.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/DataSources.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/IntelligencePacks.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/LinkedServices.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/LinkedStorageAccounts.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/ManagementGroups.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/OperationStatuses.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SharedKeys.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Usages.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/StorageInsightConfigs.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SavedSearches.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/AvailableServiceTiers.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Gateways.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/Schema.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SharedKeys.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/WorkspacePurge.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/Clusters.json + +output-folder: Generated + +namespace: Microsoft.Azure.Management.OperationalInsights + +directive: + - from: OperationalInsights.json + suppress: R3006 # BodyTopLevelProperties/R3006/RPCViolation + reason: properties etag defined as eTag in model + - from: Tables.json + where: $.definitions.Column.properties.dataTypeHint + transform: >- + return { + "type": "string", + "description": "Column data type logical hint.", + "enum": [ + "uri", + "guid", + "armPath", + "ip" + ], + "x-ms-enum": { + "name": "ColumnDataTypeHintEnum", + "modelAsString": true, + "values": [ + { + "value": "uri", + "description": "A string that matches the pattern of a URI, for example, scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment" + }, + { + "value": "guid", + "description": "A standard 128-bit GUID following the standard shape, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + }, + { + "value": "armPath", + "description": "An Azure Resource Model (ARM) path: /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}..." + }, + { + "value": "ip", + "description": "A standard V4/V6 ip address following the standard shape, x.x.x.x/y:y:y:y:y:y:y:y" + } + ] + } + } +``` \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.sln b/src/OperationalInsights/OperationalInsights.sln index 043698e4cafc..8052861ea419 100644 --- a/src/OperationalInsights/OperationalInsights.sln +++ b/src/OperationalInsights/OperationalInsights.sln @@ -5,46 +5,45 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Accounts", "Accounts", "{AD3998BD-3E51-44D1-A055-D7A9033ADB5D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{C893888E-9690-4DE5-9158-164C21009FB8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{C893888E-9690-4DE5-9158-164C21009FB8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{F63559FE-5FCD-440A-A685-A99438C4C31B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{F63559FE-5FCD-440A-A685-A99438C4C31B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{F3C54E60-D53B-478C-8173-BA9101AB3D58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{F3C54E60-D53B-478C-8173-BA9101AB3D58}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ED803440-AD43-4EDC-9709-CF9C467543BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{ED803440-AD43-4EDC-9709-CF9C467543BD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{8BEB7055-A642-4387-8DF2-9ED7B43FEE4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{8BEB7055-A642-4387-8DF2-9ED7B43FEE4E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{E18F35D9-2F59-4668-9F74-F8A9BC1B3AEE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{E18F35D9-2F59-4668-9F74-F8A9BC1B3AEE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{F1010D34-3CBD-4B21-96CB-6153B422A0EE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationalInsights.Test", "OperationalInsights.Test\OperationalInsights.Test.csproj", "{09EAF805-4AE7-4EC1-B76C-DD2808738AC9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights.Test", "OperationalInsights.Test\OperationalInsights.Test.csproj", "{09EAF805-4AE7-4EC1-B76C-DD2808738AC9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OperationalInsights", "OperationalInsights\OperationalInsights.csproj", "{42DF21A7-1002-488D-AE91-973EE23F3112}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights", "OperationalInsights\OperationalInsights.csproj", "{42DF21A7-1002-488D-AE91-973EE23F3112}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependentModules", "DependentModules", "{77B64301-6B96-4D75-B914-B4F3751E0F44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Storage", "..\Storage\Storage.Autorest\Az.Storage.csproj", "{185FA7C2-EDC3-458D-8C3D-DB42DBE99EBE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.Storage", "..\Storage\Storage.Autorest\Az.Storage.csproj", "{185FA7C2-EDC3-458D-8C3D-DB42DBE99EBE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Management.Sdk", "..\Storage\Storage.Management.Sdk\Storage.Management.Sdk.csproj", "{3FDF69B9-5F16-4921-AACF-ABB660040E95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Management.Sdk", "..\Storage\Storage.Management.Sdk\Storage.Management.Sdk.csproj", "{3FDF69B9-5F16-4921-AACF-ABB660040E95}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Management", "..\Storage\Storage.Management\Storage.Management.csproj", "{B6467B71-8B8E-4A29-8159-EC8DBACF4691}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.Management", "..\Storage\Storage.Management\Storage.Management.csproj", "{B6467B71-8B8E-4A29-8159-EC8DBACF4691}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage", "..\Storage\Storage\Storage.csproj", "{9938F31A-07ED-4820-9CC2-4E7CB72D306B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage", "..\Storage\Storage\Storage.csproj", "{9938F31A-07ED-4820-9CC2-4E7CB72D306B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{A3828DB6-6110-4291-A0B2-C49D379B0032}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestFx\TestFx.csproj", "{A3828DB6-6110-4291-A0B2-C49D379B0032}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.common", "..\Storage\Storage.common\Storage.common.csproj", "{7A67C3ED-5F2E-4B1A-A96A-2A0757041078}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Storage.common", "..\Storage\Storage.common\Storage.common.csproj", "{7A67C3ED-5F2E-4B1A-A96A-2A0757041078}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OperationalInsights.Management.Sdk", "OperationalInsights.Management.Sdk\OperationalInsights.Management.Sdk.csproj", "{131963B1-37FC-439C-A29A-9CC1BF264771}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C893888E-9690-4DE5-9158-164C21009FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C893888E-9690-4DE5-9158-164C21009FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -102,6 +101,13 @@ Global {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Debug|Any CPU.Build.0 = Debug|Any CPU {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Release|Any CPU.ActiveCfg = Release|Any CPU {7A67C3ED-5F2E-4B1A-A96A-2A0757041078}.Release|Any CPU.Build.0 = Release|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Debug|Any CPU.Build.0 = Debug|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Release|Any CPU.ActiveCfg = Release|Any CPU + {131963B1-37FC-439C-A29A-9CC1BF264771}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C893888E-9690-4DE5-9158-164C21009FB8} = {AD3998BD-3E51-44D1-A055-D7A9033ADB5D} diff --git a/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 b/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 index 4f41d5f956f8..69d5396ce1dd 100644 --- a/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 +++ b/src/OperationalInsights/OperationalInsights/Az.OperationalInsights.psd1 @@ -54,7 +54,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.0'; }) # Assemblies that must be loaded prior to importing this module -RequiredAssemblies = 'Microsoft.Azure.Management.OperationalInsights.dll', +RequiredAssemblies = 'Microsoft.Azure.PowerShell.OperationalInsights.Management.Sdk.dll', 'Microsoft.Azure.OperationalInsights.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. diff --git a/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj b/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj index 0a395d405caf..e95b419fccb5 100644 --- a/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj +++ b/src/OperationalInsights/OperationalInsights/OperationalInsights.csproj @@ -11,10 +11,13 @@ - + + + + True From 71ee13d77b36be88318b01b386f6dfe40b6a3c24 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:19:45 +0800 Subject: [PATCH 2/4] generate OperationalInsights by autorest.powershell --- .../AvailableServiceTiersOperations.cs | 141 +- ...ailableServiceTiersOperationsExtensions.cs | 90 +- .../Generated/ClustersOperations.cs | 865 +++++----- .../Generated/ClustersOperationsExtensions.cs | 778 +++++---- .../Generated/DataExportsOperations.cs | 493 +++--- .../DataExportsOperationsExtensions.cs | 349 ++-- .../Generated/DataSourcesOperations.cs | 607 +++---- .../DataSourcesOperationsExtensions.cs | 441 +++-- .../Generated/DeletedWorkspacesOperations.cs | 224 +-- .../DeletedWorkspacesOperationsExtensions.cs | 131 +- .../Generated/GatewaysOperations.cs | 136 +- .../Generated/GatewaysOperationsExtensions.cs | 98 +- .../IAvailableServiceTiersOperations.cs | 25 +- .../Generated/IClustersOperations.cs | 143 +- .../Generated/IDataExportsOperations.cs | 60 +- .../Generated/IDataSourcesOperations.cs | 74 +- .../Generated/IDeletedWorkspacesOperations.cs | 42 +- .../Generated/IGatewaysOperations.cs | 25 +- .../Generated/IIntelligencePacksOperations.cs | 48 +- .../Generated/ILinkedServicesOperations.cs | 70 +- .../ILinkedStorageAccountsOperations.cs | 78 +- .../Generated/IManagementGroupsOperations.cs | 25 +- .../Generated/IOperationStatusesOperations.cs | 25 +- .../IOperationalInsightsManagementClient.cs | 79 +- .../Generated/IOperations.cs | 38 +- .../Generated/ISavedSearchesOperations.cs | 52 +- .../Generated/ISchemaOperations.cs | 25 +- .../Generated/ISharedKeysOperations.cs | 40 +- .../IStorageInsightConfigsOperations.cs | 61 +- .../Generated/ITablesOperations.cs | 123 +- .../Generated/IUsagesOperations.cs | 25 +- .../Generated/IWorkspacePurgeOperations.cs | 64 +- .../Generated/IWorkspacesOperations.cs | 136 +- .../Generated/IntelligencePacksOperations.cs | 357 ++-- .../IntelligencePacksOperationsExtensions.cs | 260 ++- .../Generated/LinkedServicesOperations.cs | 530 +++--- .../LinkedServicesOperationsExtensions.cs | 527 +++--- .../LinkedStorageAccountsOperations.cs | 496 +++--- ...nkedStorageAccountsOperationsExtensions.cs | 371 ++--- .../Generated/ManagementGroupsOperations.cs | 141 +- .../ManagementGroupsOperationsExtensions.cs | 90 +- .../Generated/Models/AssociatedWorkspace.cs | 58 +- .../Generated/Models/AvailableServiceTier.cs | 106 +- .../Generated/Models/AzureEntityResource.cs | 49 +- .../Generated/Models/BillingType.cs | 13 +- .../Generated/Models/Capacity.cs | 63 + .../Models/CapacityReservationLevel.cs | 87 + .../Models/CapacityReservationProperties.cs | 42 +- .../Generated/Models/Cluster.cs | 231 +-- .../Generated/Models/ClusterEntityStatus.cs | 13 +- .../Generated/Models/ClusterPatch.cs | 99 +- .../Models/ClusterPatchProperties.cs | 58 + .../Generated/Models/ClusterProperties.cs | 149 ++ .../Generated/Models/ClusterSku.cs | 41 +- .../Generated/Models/ClusterSkuNameEnum.cs | 13 +- .../Generated/Models/Column.cs | 95 +- .../Models/ColumnDataTypeHintEnum.cs | 15 +- .../Generated/Models/ColumnTypeEnum.cs | 13 +- .../Generated/Models/CoreSummary.cs | 40 +- .../Generated/Models/CreatedByType.cs | 13 +- .../Generated/Models/DataExport.cs | 153 +- .../Generated/Models/DataExportProperties.cs | 144 ++ .../Generated/Models/DataIngestionStatus.cs | 13 +- .../Generated/Models/DataSource.cs | 143 +- .../Generated/Models/DataSourceFilter.cs | 71 +- .../Generated/Models/DataSourceKind.cs | 13 +- .../Generated/Models/DataSourceType.cs | 29 +- .../Generated/Models/Destination.cs | 89 + .../Generated/Models/DestinationMetaData.cs | 50 + .../Generated/Models/ErrorAdditionalInfo.cs | 35 +- .../Generated/Models/ErrorDetail.cs | 69 +- .../Generated/Models/ErrorResponse.cs | 35 +- .../Models/ErrorResponseException.cs | 25 +- .../Generated/Models/Identity.cs | 83 +- .../Generated/Models/IdentityType.cs | 27 +- .../Generated/Models/IntelligencePack.cs | 51 +- .../Generated/Models/KeyVaultProperties.cs | 71 +- .../Generated/Models/LinkedService.cs | 107 +- .../Models/LinkedServiceEntityStatus.cs | 13 +- .../Models/LinkedServiceProperties.cs | 75 + .../Models/LinkedStorageAccountsProperties.cs | 58 + .../Models/LinkedStorageAccountsResource.cs | 72 +- .../Generated/Models/ManagementGroup.cs | 123 +- .../Models/ManagementGroupProperties.cs | 121 ++ .../Generated/Models/MetricName.cs | 36 +- .../Generated/Models/Operation.cs | 37 +- .../Generated/Models/OperationDisplay.cs | 58 +- .../Generated/Models/OperationStatus.cs | 76 +- .../Generated/Models/Page.cs | 74 +- .../Generated/Models/Page1.cs | 74 +- .../Generated/Models/Page2.cs | 74 +- .../Models/PrivateLinkScopedResource.cs | 40 +- .../Generated/Models/ProvisioningStateEnum.cs | 24 +- .../Generated/Models/ProxyResource.cs | 36 +- .../Models/PublicNetworkAccessType.cs | 13 +- .../Generated/Models/PurgeState.cs | 13 +- .../Generated/Models/Resource.cs | 60 +- .../Generated/Models/RestoredLogs.cs | 47 +- .../Generated/Models/ResultStatistics.cs | 45 +- .../Generated/Models/SavedSearch.cs | 180 +- .../Generated/Models/SavedSearchProperties.cs | 156 ++ .../Models/SavedSearchesListResult.cs | 29 +- .../Generated/Models/Schema.cs | 173 +- .../Models/SearchGetSchemaResponse.cs | 39 +- .../Generated/Models/SearchMetadata.cs | 193 ++- .../Generated/Models/SearchMetadataSchema.cs | 35 +- .../Generated/Models/SearchResults.cs | 81 +- .../Generated/Models/SearchSchemaValue.cs | 110 +- .../Generated/Models/SearchSort.cs | 40 +- .../Generated/Models/SearchSortEnum.cs | 13 +- .../Generated/Models/SharedKeys.cs | 37 +- .../Generated/Models/SkuNameEnum.cs | 13 +- .../Generated/Models/SourceEnum.cs | 21 +- .../Generated/Models/StorageAccount.cs | 52 +- .../Generated/Models/StorageInsight.cs | 134 +- .../Models/StorageInsightProperties.cs | 102 ++ .../Generated/Models/StorageInsightState.cs | 15 +- .../Generated/Models/StorageInsightStatus.cs | 49 +- .../Generated/Models/SystemData.cs | 91 +- .../Generated/Models/Table.cs | 244 +-- .../Generated/Models/TablePlanEnum.cs | 16 +- .../Generated/Models/TableProperties.cs | 191 +++ .../Generated/Models/TableSubTypeEnum.cs | 26 +- .../Generated/Models/TableTypeEnum.cs | 13 +- .../Generated/Models/Tag.cs | 48 +- .../Generated/Models/TrackedResource.cs | 71 +- .../Generated/Models/Type.cs | 13 +- .../Generated/Models/UsageMetric.cs | 83 +- .../Models/UserIdentityProperties.cs | 37 +- .../Generated/Models/Workspace.cs | 281 ++-- .../Generated/Models/WorkspaceCapping.cs | 55 +- .../Generated/Models/WorkspaceEntityStatus.cs | 13 +- .../Generated/Models/WorkspaceFeatures.cs | 96 +- .../Generated/Models/WorkspacePatch.cs | 261 +-- .../Generated/Models/WorkspaceProperties.cs | 202 +++ .../Generated/Models/WorkspacePurgeBody.cs | 58 +- .../Models/WorkspacePurgeBodyFilters.cs | 89 +- .../Generated/Models/WorkspacePurgeHeaders.cs | 45 + .../Models/WorkspacePurgePurgeHeaders.cs | 53 - .../Models/WorkspacePurgeResponse.cs | 38 +- .../Models/WorkspacePurgeStatusResponse.cs | 44 +- .../Generated/Models/WorkspaceSku.cs | 71 +- .../Generated/Models/WorkspaceSkuNameEnum.cs | 13 +- .../Generated/OperationStatusesOperations.cs | 133 +- .../OperationStatusesOperationsExtensions.cs | 88 +- .../OperationalInsightsManagementClient.cs | 275 ++-- .../Generated/Operations.cs | 194 ++- .../Generated/OperationsExtensions.cs | 125 +- .../Generated/SavedSearchesOperations.cs | 501 +++--- .../SavedSearchesOperationsExtensions.cs | 347 ++-- .../Generated/SchemaOperations.cs | 141 +- .../Generated/SchemaOperationsExtensions.cs | 88 +- ...nfo_OperationalInsightsManagementClient.cs | 46 - .../Generated/SharedKeysOperations.cs | 254 +-- .../SharedKeysOperationsExtensions.cs | 165 +- .../StorageInsightConfigsOperations.cs | 592 ++++--- ...orageInsightConfigsOperationsExtensions.cs | 408 +++-- .../Generated/TablesOperations.cs | 743 +++++---- .../Generated/TablesOperationsExtensions.cs | 796 +++++---- .../Generated/UsagesOperations.cs | 141 +- .../Generated/UsagesOperationsExtensions.cs | 90 +- .../Generated/WorkspacePurgeOperations.cs | 284 ++-- .../WorkspacePurgeOperationsExtensions.cs | 211 ++- .../Generated/WorkspacesOperations.cs | 717 ++++---- .../WorkspacesOperationsExtensions.cs | 635 ++++---- .../README.md | 14 +- .../TestToggleSingletonDataSourceState.json | 1444 ++++++++++------- .../OperationalInsightsClient.DataSources.cs | 2 +- .../Models/PSLinkedService.cs | 2 +- 169 files changed, 12890 insertions(+), 11128 deletions(-) create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs create mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs delete mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs delete mode 100644 src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs index 03558adc50df..06b197cc8f87 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableServiceTiersOperations operations. /// - internal partial class AvailableServiceTiersOperations : IServiceOperations, IAvailableServiceTiersOperations + internal partial class AvailableServiceTiersOperations : Microsoft.Rest.IServiceOperations, IAvailableServiceTiersOperations { /// /// Initializes a new instance of the AvailableServiceTiersOperations class. @@ -36,13 +24,13 @@ internal partial class AvailableServiceTiersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AvailableServiceTiersOperations(OperationalInsightsManagementClient client) + internal AvailableServiceTiersOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +182,56 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +241,10 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,24 +255,28 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs index d55c34356b09..0981c6ee2caf 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/AvailableServiceTiersOperationsExtensions.cs @@ -1,67 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AvailableServiceTiersOperations. + /// Extension methods for AvailableServiceTiersOperations /// public static partial class AvailableServiceTiersOperationsExtensions { - /// - /// Gets the available service tiers for the workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IList ListByWorkspace(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IList ListByWorkspace(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName) + { + return ((IAvailableServiceTiersOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets the available service tiers for the workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the available service tiers for the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IAvailableServiceTiersOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs index 87d703abf18f..c3520b11f61f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ClustersOperations operations. /// - internal partial class ClustersOperations : IServiceOperations, IClustersOperations + internal partial class ClustersOperations : Microsoft.Rest.IServiceOperations, IClustersOperations { /// /// Initializes a new instance of the ClustersOperations class. @@ -36,13 +24,13 @@ internal partial class ClustersOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ClustersOperations(OperationalInsightsManagementClient client) + internal ClustersOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -62,13 +50,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -77,53 +65,61 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -133,25 +129,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -163,50 +158,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -216,9 +212,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -229,25 +226,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the Log Analytics clusters in a subscription. /// @@ -257,13 +258,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -272,36 +273,44 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -311,25 +320,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -341,50 +349,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -394,9 +403,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -407,25 +417,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a Log Analytics cluster. /// @@ -439,16 +453,16 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// The parameters required to create or update a Log Analytics cluster. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -461,16 +475,16 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// Name of the Log Analytics Cluster. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -488,13 +502,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -503,59 +517,68 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); } + string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -565,25 +588,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -595,50 +617,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -648,9 +671,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -661,25 +685,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a Log Analytics cluster. /// @@ -693,16 +721,16 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// The parameters required to patch a Log Analytics cluster. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -723,13 +751,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -738,83 +766,91 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); } if (clusterName != null) { if (clusterName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "clusterName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "clusterName", 63); } if (clusterName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "clusterName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "clusterName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(clusterName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -824,25 +860,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -854,56 +889,57 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -913,9 +949,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -926,16 +963,16 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -944,25 +981,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a cluster instance. /// @@ -978,10 +1019,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -990,59 +1031,68 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1052,25 +1102,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1082,50 +1131,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1135,20 +1185,25 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a Log Analytics cluster. /// @@ -1167,13 +1222,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1182,64 +1237,73 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (clusterName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clusterName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-06-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1249,25 +1313,24 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1279,56 +1342,57 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1338,9 +1402,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1351,25 +1416,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets Log Analytics clusters in a resource group. /// @@ -1382,13 +1451,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1397,51 +1466,54 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1453,50 +1525,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1506,9 +1579,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1519,25 +1593,29 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the Log Analytics clusters in a subscription. /// @@ -1550,13 +1628,13 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1565,51 +1643,54 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1621,50 +1702,51 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1674,9 +1756,10 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1687,24 +1770,28 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs index d999fd7ef830..8c1ffccdc97d 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ClustersOperationsExtensions.cs @@ -1,453 +1,409 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ClustersOperations. + /// Extension methods for ClustersOperations /// public static partial class ClustersOperationsExtensions { - /// - /// Gets Log Analytics clusters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IPage ListByResourceGroup(this IClustersOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets Log Analytics clusters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IClustersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Log Analytics clusters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IClustersOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the Log Analytics clusters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IClustersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Log Analytics cluster. - /// - /// - /// The parameters required to create or update a Log Analytics cluster. - /// - public static Cluster CreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Log Analytics cluster. - /// - /// - /// The parameters required to create or update a Log Analytics cluster. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - public static void Delete(this IClustersOperations operations, string resourceGroupName, string clusterName) - { - operations.DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IClustersOperations operations, string resourceGroupName) + { + return ((IClustersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets a Log Analytics cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string clusterName) + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IClustersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IClustersOperations operations) + { + return ((IClustersOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets a Log Analytics cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IClustersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + public static Cluster CreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return ((IClustersOperations)operations).CreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The parameters required to patch a Log Analytics cluster. - /// - public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.UpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void Delete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + ((IClustersOperations)operations).DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } - /// - /// Updates a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The parameters required to patch a Log Analytics cluster. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster Get(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + return ((IClustersOperations)operations).GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } - /// - /// Create or update a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Log Analytics cluster. - /// - /// - /// The parameters required to create or update a Log Analytics cluster. - /// - public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + /// + /// Gets a Log Analytics cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster Update(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return ((IClustersOperations)operations).UpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Create or update a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the Log Analytics cluster. - /// - /// - /// The parameters required to create or update a Log Analytics cluster. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + public static Cluster BeginCreateOrUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters) + { + return ((IClustersOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string clusterName) + /// + /// Create or update a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Log Analytics cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, Cluster parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static void BeginDelete(this IClustersOperations operations, string resourceGroupName, string clusterName) + { + ((IClustersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } - /// - /// Deletes a cluster instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes a cluster instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + { + return ((IClustersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } - /// - /// Updates a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The parameters required to patch a Log Analytics cluster. - /// - public static Cluster BeginUpdate(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters) + /// + /// Updates a Log Analytics cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Name of the Log Analytics Cluster. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IClustersOperations operations, string nextPageLink) + { + return ((IClustersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Updates a Log Analytics cluster. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Name of the Log Analytics Cluster. - /// - /// - /// The parameters required to patch a Log Analytics cluster. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, ClusterPatch parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets Log Analytics clusters in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IClustersOperations operations, string nextPageLink) + { + return ((IClustersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets Log Analytics clusters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IClustersOperations operations, string nextPageLink) + /// + /// Gets the Log Analytics clusters in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets Log Analytics clusters in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Log Analytics clusters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IClustersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the Log Analytics clusters in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs index 9171c0ad1109..372c551b5def 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DataExportsOperations operations. /// - internal partial class DataExportsOperations : IServiceOperations, IDataExportsOperations + internal partial class DataExportsOperations : Microsoft.Rest.IServiceOperations, IDataExportsOperations { /// /// Initializes a new instance of the DataExportsOperations class. @@ -36,13 +24,13 @@ internal partial class DataExportsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DataExportsOperations(OperationalInsightsManagementClient client) + internal DataExportsOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,50 +182,51 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -240,9 +236,10 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -253,25 +250,29 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a data export. /// @@ -293,13 +294,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -308,104 +309,109 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataExportName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); } if (dataExportName != null) { if (dataExportName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "dataExportName", 63); } if (dataExportName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "dataExportName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -415,25 +421,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -445,56 +450,57 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -504,9 +510,10 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -517,16 +524,16 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -535,25 +542,29 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a data export instance. /// @@ -572,13 +583,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -587,80 +598,89 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataExportName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -670,25 +690,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -700,50 +719,51 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -753,9 +773,10 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -766,25 +787,29 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes the specified data export in a given workspace.. /// @@ -803,10 +828,10 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -815,80 +840,89 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataExportName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataExportName"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -898,25 +932,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -928,50 +961,51 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 404) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -981,19 +1015,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs index 579f127cfcb6..a1a2420ec6f8 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataExportsOperationsExtensions.cs @@ -1,208 +1,187 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DataExportsOperations. + /// Extension methods for DataExportsOperations /// public static partial class DataExportsOperationsExtensions { - /// - /// Lists the data export instances within a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable ListByWorkspace(this IDataExportsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Lists the data export instances within a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a data export. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The parameters required to create or update a data export. - /// - public static DataExport CreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataExportName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a data export. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The parameters required to create or update a data export. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a data export instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - public static DataExport Get(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) - { - return operations.GetAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); - } + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this IDataExportsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IDataExportsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets a data export instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists the data export instances within a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static DataExport CreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) + { + return ((IDataExportsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataExportName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified data export in a given workspace.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - public static void Delete(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + /// + /// Create or update a data export. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static DataExport Get(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + return ((IDataExportsOperations)operations).GetAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } - /// - /// Deletes the specified data export in a given workspace.. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a data export instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + public static void Delete(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName) + { + ((IDataExportsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataExportName).GetAwaiter().GetResult(); + } + /// + /// Deletes the specified data export in a given workspace.. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The data export rule name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs index c5e7fea9eff7..7e0fbdf60290 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperations.cs @@ -1,32 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DataSourcesOperations operations. /// - internal partial class DataSourcesOperations : IServiceOperations, IDataSourcesOperations + internal partial class DataSourcesOperations : Microsoft.Rest.IServiceOperations, IDataSourcesOperations { /// /// Initializes a new instance of the DataSourcesOperations class. @@ -37,13 +24,13 @@ internal partial class DataSourcesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DataSourcesOperations(OperationalInsightsManagementClient client) + internal DataSourcesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -72,13 +59,13 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -87,89 +74,98 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -179,25 +175,24 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -209,61 +204,62 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -273,9 +269,10 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -286,16 +283,16 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -304,25 +301,29 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a data source instance. /// @@ -341,10 +342,10 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -353,80 +354,89 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -436,25 +446,24 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -466,55 +475,56 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -524,20 +534,25 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a datasource instance. /// @@ -556,13 +571,13 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -571,80 +586,89 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (dataSourceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "dataSourceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -654,25 +678,24 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -684,55 +707,56 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -742,9 +766,10 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -755,31 +780,35 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the first page of data source instances in a workspace with the link /// to the next page. /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The name of the resource group. The name is case insensitive. @@ -796,13 +825,13 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -811,86 +840,92 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (odataQuery == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "odataQuery"); - } + + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("skiptoken", skiptoken); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + var _dataSourceFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_dataSourceFilter)) { - _queryParameters.Add(_odataFilter); + _queryParameters.Add(_dataSourceFilter); } } if (skiptoken != null) @@ -906,25 +941,24 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -936,55 +970,56 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -994,9 +1029,10 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1007,25 +1043,29 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the first page of data source instances in a workspace with the link /// to the next page. @@ -1039,13 +1079,13 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1054,51 +1094,54 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1110,55 +1153,56 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1168,9 +1212,10 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1181,24 +1226,28 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs index 0ad7d1378c83..368186830a15 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DataSourcesOperationsExtensions.cs @@ -1,257 +1,236 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DataSourcesOperations. + /// Extension methods for DataSourcesOperations /// public static partial class DataSourcesOperationsExtensions { - /// - /// Create or update a data source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the datasource resource. - /// - /// - /// The parameters required to create or update a datasource. - /// - public static DataSource CreateOrUpdate(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a data source. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the datasource resource. - /// - /// - /// The parameters required to create or update a datasource. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a data source instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the datasource. - /// - public static void Delete(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); - } + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + public static DataSource CreateOrUpdate(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters) + { + return ((IDataSourcesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a data source instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the datasource. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a data source. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the datasource resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + public static void Delete(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + ((IDataSourcesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } - /// - /// Gets a datasource instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the datasource - /// - public static DataSource Get(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) - { - return operations.GetAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a datasource instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the datasource - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Deletes a data source instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + public static DataSource Get(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName) + { + return ((IDataSourcesOperations)operations).GetAsync(resourceGroupName, workspaceName, dataSourceName).GetAwaiter().GetResult(); + } - /// - /// Gets the first page of data source instances in a workspace with the link - /// to the next page. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Starting point of the collection of data source instances. - /// - public static IPage ListByWorkspace(this IDataSourcesOperations operations, ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string)) + /// + /// Gets a datasource instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the datasource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, string dataSourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByWorkspaceAsync(odataQuery, resourceGroupName, workspaceName, skiptoken).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspace(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string)) + { + return ((IDataSourcesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName, odataQuery, skiptoken).GetAwaiter().GetResult(); + } - /// - /// Gets the first page of data source instances in a workspace with the link - /// to the next page. - /// - /// - /// The operations group for this extension method. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Starting point of the collection of data source instances. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this IDataSourcesOperations operations, ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Starting point of the collection of data source instances. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IDataSourcesOperations operations, string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, odataQuery, skiptoken, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(odataQuery, resourceGroupName, workspaceName, skiptoken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspaceNext(this IDataSourcesOperations operations, string nextPageLink) + { + return ((IDataSourcesOperations)operations).ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Gets the first page of data source instances in a workspace with the link - /// to the next page. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByWorkspaceNext(this IDataSourcesOperations operations, string nextPageLink) + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceNextAsync(this IDataSourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets the first page of data source instances in a workspace with the link - /// to the next page. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceNextAsync(this IDataSourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs index b042bc8bf45e..8b664dea86fe 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// DeletedWorkspacesOperations operations. /// - internal partial class DeletedWorkspacesOperations : IServiceOperations, IDeletedWorkspacesOperations + internal partial class DeletedWorkspacesOperations : Microsoft.Rest.IServiceOperations, IDeletedWorkspacesOperations { /// /// Initializes a new instance of the DeletedWorkspacesOperations class. @@ -36,13 +24,13 @@ internal partial class DeletedWorkspacesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) + internal DeletedWorkspacesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,36 +62,44 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -113,25 +109,24 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -143,50 +138,51 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +192,10 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,25 +206,29 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets recently deleted workspaces in a resource group, available for /// recovery. @@ -241,13 +242,13 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -256,53 +257,61 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -312,25 +321,24 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -342,50 +350,51 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -395,9 +404,10 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -408,24 +418,28 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs index 88d91dd2e860..fa23cb67d284 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/DeletedWorkspacesOperationsExtensions.cs @@ -1,91 +1,78 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for DeletedWorkspacesOperations. + /// Extension methods for DeletedWorkspacesOperations /// public static partial class DeletedWorkspacesOperationsExtensions { - /// - /// Gets recently deleted workspaces in a subscription, available for recovery. - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable List(this IDeletedWorkspacesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IDeletedWorkspacesOperations operations) + { + return ((IDeletedWorkspacesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Gets recently deleted workspaces in a subscription, available for recovery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IDeletedWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDeletedWorkspacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IDeletedWorkspacesOperations operations, string resourceGroupName) + { + return ((IDeletedWorkspacesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Gets recently deleted workspaces in a resource group, available for - /// recovery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IEnumerable ListByResourceGroup(this IDeletedWorkspacesOperations operations, string resourceGroupName) + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDeletedWorkspacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets recently deleted workspaces in a resource group, available for - /// recovery. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDeletedWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs index f924b670b9d7..ce595492638e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// GatewaysOperations operations. /// - internal partial class GatewaysOperations : IServiceOperations, IGatewaysOperations + internal partial class GatewaysOperations : Microsoft.Rest.IServiceOperations, IGatewaysOperations { /// /// Initializes a new instance of the GatewaysOperations class. @@ -36,13 +24,13 @@ internal partial class GatewaysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal GatewaysOperations(OperationalInsightsManagementClient client) + internal GatewaysOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,10 +56,10 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,80 +68,89 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (gatewayId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "gatewayId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "gatewayId"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("gatewayId", gatewayId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -163,25 +160,24 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -193,55 +189,56 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -251,19 +248,24 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs index 16311bb1f6b4..9e2210a53cca 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/GatewaysOperationsExtensions.cs @@ -1,68 +1,58 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for GatewaysOperations. + /// Extension methods for GatewaysOperations /// public static partial class GatewaysOperationsExtensions { - /// - /// Delete a Log Analytics gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Log Analytics gateway Id. - /// - public static void Delete(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, gatewayId).GetAwaiter().GetResult(); - } - - /// - /// Delete a Log Analytics gateway. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Log Analytics gateway Id. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, gatewayId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + public static void Delete(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId) + { + ((IGatewaysOperations)operations).DeleteAsync(resourceGroupName, workspaceName, gatewayId).GetAwaiter().GetResult(); + } + /// + /// Delete a Log Analytics gateway. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The Log Analytics gateway Id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IGatewaysOperations operations, string resourceGroupName, string workspaceName, string gatewayId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, gatewayId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs index e10add9d9636..7b402be0a3b2 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IAvailableServiceTiersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AvailableServiceTiersOperations operations. @@ -26,6 +16,9 @@ public partial interface IAvailableServiceTiersOperations /// /// Gets the available service tiers for the workspace. /// + /// + /// Gets the available service tiers for the workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,9 +37,7 @@ public partial interface IAvailableServiceTiersOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs index 595be09e83b2..5768e4342178 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IClustersOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ClustersOperations operations. @@ -26,6 +16,9 @@ public partial interface IClustersOperations /// /// Gets Log Analytics clusters in a resource group. /// + /// + /// Gets Log Analytics clusters in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -35,38 +28,40 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the Log Analytics clusters in a subscription. /// + /// + /// Gets the Log Analytics clusters in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a Log Analytics cluster. /// + /// + /// Create or update a Log Analytics cluster. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -74,8 +69,7 @@ public partial interface IClustersOperations /// The name of the Log Analytics cluster. /// /// - /// The parameters required to create or update a Log Analytics - /// cluster. + /// The parameters required to create or update a Log Analytics cluster. /// /// /// The headers that will be added to request. @@ -83,19 +77,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a cluster instance. /// + /// + /// Deletes a cluster instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -108,16 +103,17 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Log Analytics cluster instance. /// + /// + /// Gets a Log Analytics cluster instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -130,19 +126,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a Log Analytics cluster. /// + /// + /// Updates a Log Analytics cluster. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -158,19 +155,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a Log Analytics cluster. /// + /// + /// Create or update a Log Analytics cluster. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -178,8 +176,7 @@ public partial interface IClustersOperations /// The name of the Log Analytics cluster. /// /// - /// The parameters required to create or update a Log Analytics - /// cluster. + /// The parameters required to create or update a Log Analytics cluster. /// /// /// The headers that will be added to request. @@ -187,19 +184,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, Cluster parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a cluster instance. /// + /// + /// Deletes a cluster instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -212,16 +210,17 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a Log Analytics cluster. /// + /// + /// Updates a Log Analytics cluster. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -237,19 +236,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterPatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets Log Analytics clusters in a resource group. /// + /// + /// Gets Log Analytics clusters in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -259,19 +259,20 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the Log Analytics clusters in a subscription. /// + /// + /// Gets the Log Analytics clusters in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -281,15 +282,13 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs index 32d52702e7e8..4838e28c3c52 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataExportsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DataExportsOperations operations. @@ -26,6 +16,9 @@ public partial interface IDataExportsOperations /// /// Lists the data export instances within a workspace. /// + /// + /// Lists the data export instances within a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -38,19 +31,20 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a data export. /// + /// + /// Create or update a data export. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,19 +63,20 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a data export instance. /// + /// + /// Gets a data export instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -97,19 +92,20 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes the specified data export in a given workspace.. /// + /// + /// Deletes the specified data export in a given workspace.. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -125,12 +121,10 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs index 50c3c802a999..2abfe5e2ab2a 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDataSourcesOperations.cs @@ -1,23 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DataSourcesOperations operations. @@ -27,6 +16,9 @@ public partial interface IDataSourcesOperations /// /// Create or update a data source. /// + /// + /// Create or update a data source. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -51,13 +43,14 @@ public partial interface IDataSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, DataSource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a data source instance. /// + /// + /// Deletes a data source instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -76,13 +69,14 @@ public partial interface IDataSourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a datasource instance. /// + /// + /// Gets a datasource instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -104,16 +98,18 @@ public partial interface IDataSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataSourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the first page of data source instances in a workspace with - /// the link to the next page. + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. /// + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// /// - /// OData parameters to apply to the operation. + /// /// /// /// The name of the resource group. The name is case insensitive. @@ -136,14 +132,16 @@ public partial interface IDataSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(ODataQuery odataQuery, string resourceGroupName, string workspaceName, string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skiptoken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets the first page of data source instances in a workspace with - /// the link to the next page. + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. /// + /// + /// Gets the first page of data source instances in a workspace with the link + /// to the next page. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -159,9 +157,7 @@ public partial interface IDataSourcesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs index 5db749e7c2c2..4b753807c94a 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IDeletedWorkspacesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// DeletedWorkspacesOperations operations. @@ -24,29 +14,33 @@ namespace Microsoft.Azure.Management.OperationalInsights public partial interface IDeletedWorkspacesOperations { /// - /// Gets recently deleted workspaces in a subscription, available for - /// recovery. + /// Gets recently deleted workspaces in a subscription, available for recovery. /// + /// + /// Gets recently deleted workspaces in a subscription, available for recovery. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets recently deleted workspaces in a resource group, available for /// recovery. /// + /// + /// Gets recently deleted workspaces in a resource group, available for + /// recovery. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -56,15 +50,13 @@ public partial interface IDeletedWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs index 79ccee746650..864cf8b8a933 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IGatewaysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// GatewaysOperations operations. @@ -26,6 +16,9 @@ public partial interface IGatewaysOperations /// /// Delete a Log Analytics gateway. /// + /// + /// Delete a Log Analytics gateway. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,9 +37,7 @@ public partial interface IGatewaysOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string gatewayId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs index b3eae4d089bb..355ce492af6c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IIntelligencePacksOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// IntelligencePacksOperations operations. @@ -26,6 +16,9 @@ public partial interface IIntelligencePacksOperations /// /// Disables an intelligence pack for a given workspace. /// + /// + /// Disables an intelligence pack for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface IIntelligencePacksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Enables an intelligence pack for a given workspace. /// + /// + /// Enables an intelligence pack for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,14 +63,16 @@ public partial interface IIntelligencePacksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Lists all the intelligence packs possible and whether they are - /// enabled or disabled for a given workspace. + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. /// + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -95,9 +91,7 @@ public partial interface IIntelligencePacksOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs index b5f8a401408f..94466dcab37f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedServicesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LinkedServicesOperations operations. @@ -26,6 +16,9 @@ public partial interface ILinkedServicesOperations /// /// Create or update a linked service. /// + /// + /// Create or update a linked service. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -50,13 +43,14 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a linked service instance. /// + /// + /// Deletes a linked service instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -78,13 +72,14 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a linked service instance. /// + /// + /// Gets a linked service instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -106,13 +101,14 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the linked services instances in a workspace. /// + /// + /// Gets the linked services instances in a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -131,13 +127,14 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a linked service. /// + /// + /// Create or update a linked service. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -162,13 +159,14 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a linked service instance. /// + /// + /// Deletes a linked service instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -190,9 +188,7 @@ public partial interface ILinkedServicesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs index d87630e84e72..5f06d75b07f7 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ILinkedStorageAccountsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// LinkedStorageAccountsOperations operations. @@ -24,9 +14,13 @@ namespace Microsoft.Azure.Management.OperationalInsights public partial interface ILinkedStorageAccountsOperations { /// - /// Create or Update a link relation between current workspace and a - /// group of storage accounts of a specific data source type. + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. /// + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -34,8 +28,7 @@ public partial interface ILinkedStorageAccountsOperations /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// Linked storage accounts resources ids. @@ -52,14 +45,16 @@ public partial interface ILinkedStorageAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes all linked storage accounts of a specific data source type /// associated with the specified workspace. /// + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -67,8 +62,7 @@ public partial interface ILinkedStorageAccountsOperations /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// The headers that will be added to request. @@ -79,14 +73,16 @@ public partial interface ILinkedStorageAccountsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all linked storage account of a specific data source type - /// associated with the specified workspace. + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. /// + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -94,8 +90,7 @@ public partial interface ILinkedStorageAccountsOperations /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// The headers that will be added to request. @@ -109,15 +104,16 @@ public partial interface ILinkedStorageAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Gets all linked storage accounts associated with the specified - /// workspace, storage accounts will be sorted by their data source - /// type. + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. /// + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -136,9 +132,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs index 94bf0bf98415..a8d79dec31ad 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IManagementGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// ManagementGroupsOperations operations. @@ -26,6 +16,9 @@ public partial interface IManagementGroupsOperations /// /// Gets a list of management groups connected to a workspace. /// + /// + /// Gets a list of management groups connected to a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,9 +37,7 @@ public partial interface IManagementGroupsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs index c0ccc2341f24..d1d341679ba2 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationStatusesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// OperationStatusesOperations operations. @@ -26,6 +16,9 @@ public partial interface IOperationStatusesOperations /// /// Get the status of a long running azure asynchronous operation. /// + /// + /// Get the status of a long running azure asynchronous operation. + /// /// /// The region name of operation. /// @@ -44,9 +37,7 @@ public partial interface IOperationStatusesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs index 8408006cfe96..41d734efaa4c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperationalInsightsManagementClient.cs @@ -1,23 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// + /// Azure Log Analytics API reference /// - public partial interface IOperationalInsightsManagementClient : System.IDisposable + public partial interface IOperationalInsightsManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -27,141 +22,145 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// The ID of the target subscription. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. + /// /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IWorkspacesOperations. + /// Gets the IWorkspacesOperations /// IWorkspacesOperations Workspaces { get; } /// - /// Gets the IDeletedWorkspacesOperations. + /// Gets the IDeletedWorkspacesOperations /// IDeletedWorkspacesOperations DeletedWorkspaces { get; } /// - /// Gets the ITablesOperations. + /// Gets the ITablesOperations /// ITablesOperations Tables { get; } /// - /// Gets the IDataExportsOperations. + /// Gets the IDataExportsOperations /// IDataExportsOperations DataExports { get; } /// - /// Gets the IDataSourcesOperations. + /// Gets the IDataSourcesOperations /// IDataSourcesOperations DataSources { get; } /// - /// Gets the IIntelligencePacksOperations. + /// Gets the IIntelligencePacksOperations /// IIntelligencePacksOperations IntelligencePacks { get; } /// - /// Gets the ILinkedServicesOperations. + /// Gets the ILinkedServicesOperations /// ILinkedServicesOperations LinkedServices { get; } /// - /// Gets the ILinkedStorageAccountsOperations. + /// Gets the ILinkedStorageAccountsOperations /// ILinkedStorageAccountsOperations LinkedStorageAccounts { get; } /// - /// Gets the IManagementGroupsOperations. + /// Gets the IManagementGroupsOperations /// IManagementGroupsOperations ManagementGroups { get; } /// - /// Gets the IOperationStatusesOperations. + /// Gets the IOperationStatusesOperations /// IOperationStatusesOperations OperationStatuses { get; } /// - /// Gets the ISharedKeysOperations. + /// Gets the ISharedKeysOperations /// ISharedKeysOperations SharedKeys { get; } /// - /// Gets the IUsagesOperations. + /// Gets the IUsagesOperations /// IUsagesOperations Usages { get; } /// - /// Gets the IStorageInsightConfigsOperations. + /// Gets the IStorageInsightConfigsOperations /// IStorageInsightConfigsOperations StorageInsightConfigs { get; } /// - /// Gets the ISavedSearchesOperations. + /// Gets the ISavedSearchesOperations /// ISavedSearchesOperations SavedSearches { get; } /// - /// Gets the IAvailableServiceTiersOperations. + /// Gets the IAvailableServiceTiersOperations /// IAvailableServiceTiersOperations AvailableServiceTiers { get; } /// - /// Gets the IGatewaysOperations. + /// Gets the IGatewaysOperations /// IGatewaysOperations Gateways { get; } /// - /// Gets the ISchemaOperations. + /// Gets the ISchemaOperations /// ISchemaOperations Schema { get; } /// - /// Gets the IWorkspacePurgeOperations. + /// Gets the IWorkspacePurgeOperations /// IWorkspacePurgeOperations WorkspacePurge { get; } /// - /// Gets the IClustersOperations. + /// Gets the IClustersOperations /// IClustersOperations Clusters { get; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs index 104d5efc6eb2..7aea452a6aba 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -26,25 +16,29 @@ public partial interface IOperations /// /// Lists all of the available OperationalInsights Rest API operations. /// + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists all of the available OperationalInsights Rest API operations. /// + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -54,15 +48,13 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs index 61aba8e7e7c9..4a6878a5b8e0 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISavedSearchesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SavedSearchesOperations operations. @@ -26,6 +16,9 @@ public partial interface ISavedSearchesOperations /// /// Deletes the specified saved search in a given workspace. /// + /// + /// Deletes the specified saved search in a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,13 +37,14 @@ public partial interface ISavedSearchesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Creates or updates a saved search for a given workspace. /// + /// + /// Creates or updates a saved search for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -75,13 +69,14 @@ public partial interface ISavedSearchesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the specified saved search for a given workspace. /// + /// + /// Gets the specified saved search for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,13 +98,14 @@ public partial interface ISavedSearchesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the saved searches for a given Log Analytics Workspace /// + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -128,9 +124,7 @@ public partial interface ISavedSearchesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs index e2c367d0a724..44a9023b8977 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISchemaOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SchemaOperations operations. @@ -26,6 +16,9 @@ public partial interface ISchemaOperations /// /// Gets the schema for a given workspace. /// + /// + /// Gets the schema for a given workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,9 +37,7 @@ public partial interface ISchemaOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs index 49ff9cd92c01..f59c70bbb8d7 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ISharedKeysOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SharedKeysOperations operations. @@ -26,6 +16,9 @@ public partial interface ISharedKeysOperations /// /// Gets the shared keys for a workspace. /// + /// + /// Gets the shared keys for a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,15 +37,16 @@ public partial interface ISharedKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Regenerates the shared keys for a Log Analytics Workspace. These - /// keys are used to connect Microsoft Operational Insights agents to - /// the workspace. + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. /// + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -71,9 +65,7 @@ public partial interface ISharedKeysOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs index 45ddb1077518..90dda555a300 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IStorageInsightConfigsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// StorageInsightConfigsOperations operations. @@ -26,6 +16,9 @@ public partial interface IStorageInsightConfigsOperations /// /// Create or update a storage insight. /// + /// + /// Create or update a storage insight. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -50,13 +43,14 @@ public partial interface IStorageInsightConfigsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a storage insight instance. /// + /// + /// Gets a storage insight instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -78,13 +72,14 @@ public partial interface IStorageInsightConfigsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Deletes a storageInsightsConfigs resource /// + /// + /// Deletes a storageInsightsConfigs resource + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -103,13 +98,14 @@ public partial interface IStorageInsightConfigsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the storage insight instances within a workspace /// + /// + /// Lists the storage insight instances within a workspace + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -128,13 +124,14 @@ public partial interface IStorageInsightConfigsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Lists the storage insight instances within a workspace /// + /// + /// Lists the storage insight instances within a workspace + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -150,9 +147,7 @@ public partial interface IStorageInsightConfigsOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs index 4b2e43bd9240..353c2c5940bb 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ITablesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// TablesOperations operations. @@ -26,6 +16,9 @@ public partial interface ITablesOperations /// /// Gets all the tables for the specified Log Analytics workspace. /// + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -38,19 +31,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update or Create a Log Analytics workspace table. /// + /// + /// Update or Create a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -69,19 +63,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a Log Analytics workspace table. /// + /// + /// Update a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -100,19 +95,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a Log Analytics workspace table. /// + /// + /// Gets a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -128,19 +124,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Log Analytics workspace table. /// + /// + /// Delete a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -156,18 +153,21 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Migrate a Log Analytics table from support of the Data Collector - /// API and Custom Fields features to support of Data Collection - /// Rule-based Custom Logs. + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. /// + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -183,16 +183,17 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update or Create a Log Analytics workspace table. /// + /// + /// Update or Create a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -211,19 +212,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Update a Log Analytics workspace table. /// + /// + /// Update a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -242,19 +244,20 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete a Log Analytics workspace table. /// + /// + /// Delete a Log Analytics workspace table. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -270,12 +273,10 @@ public partial interface ITablesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs index abb9df1e8c13..035640958713 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IUsagesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// UsagesOperations operations. @@ -26,6 +16,9 @@ public partial interface IUsagesOperations /// /// Gets a list of usage metrics for a workspace. /// + /// + /// Gets a list of usage metrics for a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -44,9 +37,7 @@ public partial interface IUsagesOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs index d1cc6e003a36..ecb0237ee47c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacePurgeOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacePurgeOperations operations. @@ -24,16 +14,23 @@ namespace Microsoft.Azure.Management.OperationalInsights public partial interface IWorkspacePurgeOperations { /// - /// Purges data in an Log Analytics workspace by a set of user-defined - /// filters. - /// - /// In order to manage system resources, purge requests are throttled - /// at 50 requests per hour. You should batch the execution of purge - /// requests by sending a single command whose predicate includes all - /// user identities that require purging. Use the in operator to - /// specify multiple identities. You should run the query prior to - /// using for a purge request to verify that the results are expected. + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. /// + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -41,8 +38,8 @@ public partial interface IWorkspacePurgeOperations /// The name of the workspace. /// /// - /// Describes the body of a request to purge data in a single table of - /// an Log Analytics Workspace + /// Describes the body of a request to purge data in a single table of an Log + /// Analytics Workspace /// /// /// The headers that will be added to request. @@ -56,13 +53,14 @@ public partial interface IWorkspacePurgeOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets status of an ongoing purge operation. /// + /// + /// Gets status of an ongoing purge operation. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -70,8 +68,8 @@ public partial interface IWorkspacePurgeOperations /// The name of the workspace. /// /// - /// In a purge status request, this is the Id of the operation the - /// status of which is returned. + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. /// /// /// The headers that will be added to request. @@ -85,9 +83,7 @@ public partial interface IWorkspacePurgeOperations /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs index b200f6dea07e..235fb73d7e84 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IWorkspacesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacesOperations operations. @@ -26,25 +16,29 @@ public partial interface IWorkspacesOperations /// /// Gets the workspaces in a subscription. /// + /// + /// Gets the workspaces in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets workspaces in a resource group. /// + /// + /// Gets workspaces in a resource group. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -54,19 +48,20 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a workspace. /// + /// + /// Create or update a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -82,23 +77,26 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a workspace resource. To recover the workspace, create it - /// again with the same name, in the same subscription, resource group - /// and location. The name is kept for 14 days and cannot be used for - /// another workspace. To remove the workspace completely and release - /// the name, use the force flag. + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. /// + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -106,8 +104,8 @@ public partial interface IWorkspacesOperations /// The name of the workspace. /// /// - /// Deletes the workspace without the recovery option. A workspace that - /// was deleted with this flag cannot be recovered. + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. /// /// /// The headers that will be added to request. @@ -115,16 +113,17 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets a workspace instance. /// + /// + /// Gets a workspace instance. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -137,19 +136,20 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Updates a workspace. /// + /// + /// Updates a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -165,19 +165,20 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update a workspace. /// + /// + /// Create or update a workspace. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -193,23 +194,26 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Deletes a workspace resource. To recover the workspace, create it - /// again with the same name, in the same subscription, resource group - /// and location. The name is kept for 14 days and cannot be used for - /// another workspace. To remove the workspace completely and release - /// the name, use the force flag. + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. /// + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -217,8 +221,8 @@ public partial interface IWorkspacesOperations /// The name of the workspace. /// /// - /// Deletes the workspace without the recovery option. A workspace that - /// was deleted with this flag cannot be recovered. + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. /// /// /// The headers that will be added to request. @@ -226,12 +230,10 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs index 6565939cc189..d7a6e7ac35b0 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// IntelligencePacksOperations operations. /// - internal partial class IntelligencePacksOperations : IServiceOperations, IIntelligencePacksOperations + internal partial class IntelligencePacksOperations : Microsoft.Rest.IServiceOperations, IIntelligencePacksOperations { /// /// Initializes a new instance of the IntelligencePacksOperations class. @@ -36,13 +24,13 @@ internal partial class IntelligencePacksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IntelligencePacksOperations(OperationalInsightsManagementClient client) + internal IntelligencePacksOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,10 +56,10 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,80 +68,89 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DisableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (intelligencePackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "intelligencePackName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("intelligencePackName", intelligencePackName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -163,25 +160,24 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -193,55 +189,56 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -251,20 +248,25 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Enables an intelligence pack for a given workspace. /// @@ -283,10 +285,10 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -295,80 +297,89 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task EnableWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string intelligencePackName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (intelligencePackName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "intelligencePackName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("intelligencePackName", intelligencePackName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -378,25 +389,24 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -408,55 +418,56 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -466,20 +477,25 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all the intelligence packs possible and whether they are enabled or /// disabled for a given workspace. @@ -496,13 +512,13 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -511,74 +527,82 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -588,25 +612,24 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -618,55 +641,56 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -676,9 +700,10 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -689,24 +714,28 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs index 20d3824e2cb5..df7281e57685 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/IntelligencePacksOperationsExtensions.cs @@ -1,155 +1,141 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for IntelligencePacksOperations. + /// Extension methods for IntelligencePacksOperations /// public static partial class IntelligencePacksOperationsExtensions { - /// - /// Disables an intelligence pack for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the intelligence pack to be disabled. - /// - public static void Disable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) - { - operations.DisableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); - } - - /// - /// Disables an intelligence pack for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the intelligence pack to be disabled. - /// - /// - /// The cancellation token. - /// - public static async Task DisableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DisableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Enables an intelligence pack for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the intelligence pack to be enabled. - /// - public static void Enable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) - { - operations.EnableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); - } + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + public static void Disable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + ((IIntelligencePacksOperations)operations).DisableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } - /// - /// Enables an intelligence pack for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the intelligence pack to be enabled. - /// - /// - /// The cancellation token. - /// - public static async Task EnableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.EnableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Disables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be disabled. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DisableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DisableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + public static void Enable(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName) + { + ((IIntelligencePacksOperations)operations).EnableAsync(resourceGroupName, workspaceName, intelligencePackName).GetAwaiter().GetResult(); + } - /// - /// Lists all the intelligence packs possible and whether they are enabled or - /// disabled for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IList List(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Enables an intelligence pack for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the intelligence pack to be enabled. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task EnableAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.EnableWithHttpMessagesAsync(resourceGroupName, workspaceName, intelligencePackName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IList List(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName) + { + return ((IIntelligencePacksOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Lists all the intelligence packs possible and whether they are enabled or - /// disabled for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all the intelligence packs possible and whether they are enabled or + /// disabled for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IIntelligencePacksOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs index 45807f9649f1..80e0be55f255 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LinkedServicesOperations operations. /// - internal partial class LinkedServicesOperations : IServiceOperations, ILinkedServicesOperations + internal partial class LinkedServicesOperations : Microsoft.Rest.IServiceOperations, ILinkedServicesOperations { /// /// Initializes a new instance of the LinkedServicesOperations class. @@ -36,13 +24,13 @@ internal partial class LinkedServicesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LinkedServicesOperations(OperationalInsightsManagementClient client) + internal LinkedServicesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -66,16 +54,16 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// The parameters required to create or update a linked service. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -91,16 +79,16 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// Name of the linked service. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -121,13 +109,13 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -136,80 +124,89 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (linkedServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -219,25 +216,24 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -249,55 +245,56 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -307,9 +304,10 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -320,25 +318,29 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the linked services instances in a workspace. /// @@ -354,13 +356,13 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -369,74 +371,82 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -446,25 +456,24 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -476,55 +485,56 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -534,9 +544,10 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -547,25 +558,29 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a linked service. /// @@ -587,13 +602,13 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -602,85 +617,95 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (linkedServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -690,25 +715,24 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -720,61 +744,62 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -784,9 +809,10 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -797,16 +823,16 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -815,25 +841,29 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a linked service instance. /// @@ -852,13 +882,13 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -867,80 +897,89 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string linkedServiceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (linkedServiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "linkedServiceName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -950,25 +989,24 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -980,55 +1018,56 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1038,9 +1077,10 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1051,24 +1091,28 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs index 3fe9f50940df..9a2598920f17 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedServicesOperationsExtensions.cs @@ -1,309 +1,280 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LinkedServicesOperations. + /// Extension methods for LinkedServicesOperations /// public static partial class LinkedServicesOperationsExtensions { - /// - /// Create or update a linked service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linkedServices resource - /// - /// - /// The parameters required to create or update a linked service. - /// - public static LinkedService CreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a linked service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linkedServices resource - /// - /// - /// The parameters required to create or update a linked service. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + public static LinkedService CreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return ((ILinkedServicesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - public static LinkedService Delete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Delete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } - /// - /// Deletes a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService Get(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).GetAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } - /// - /// Gets a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - public static LinkedService Get(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + /// + /// Gets a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ILinkedServicesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the linked services instances in a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + public static LinkedService BeginCreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) + { + return ((ILinkedServicesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets the linked services instances in a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable ListByWorkspace(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName) + /// + /// Create or update a linked service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linkedServices resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + public static LinkedService BeginDelete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) + { + return ((ILinkedServicesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); + } - /// - /// Gets the linked services instances in a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Deletes a linked service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the linked service. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Create or update a linked service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linkedServices resource - /// - /// - /// The parameters required to create or update a linked service. - /// - public static LinkedService BeginCreateOrUpdate(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a linked service. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linkedServices resource - /// - /// - /// The parameters required to create or update a linked service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, LinkedService parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - public static LinkedService BeginDelete(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName) - { - return operations.BeginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a linked service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the linked service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILinkedServicesOperations operations, string resourceGroupName, string workspaceName, string linkedServiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, linkedServiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs index c90001a1a49f..f8a200ca786f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// LinkedStorageAccountsOperations operations. /// - internal partial class LinkedStorageAccountsOperations : IServiceOperations, ILinkedStorageAccountsOperations + internal partial class LinkedStorageAccountsOperations : Microsoft.Rest.IServiceOperations, ILinkedStorageAccountsOperations { /// /// Initializes a new instance of the LinkedStorageAccountsOperations class. @@ -36,13 +24,13 @@ internal partial class LinkedStorageAccountsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient client) + internal LinkedStorageAccountsOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -61,8 +49,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// Linked storage accounts resources ids. @@ -73,13 +60,13 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -88,82 +75,91 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; LinkedStorageAccountsResource parameters = new LinkedStorageAccountsResource(); - if (storageAccountIds != null) + if(storageAccountIds != null) { parameters.StorageAccountIds = storageAccountIds; } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -173,25 +169,24 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -203,61 +198,62 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -267,9 +263,10 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -280,25 +277,29 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes all linked storage accounts of a specific data source type /// associated with the specified workspace. @@ -310,8 +311,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// Headers that will be added to request. @@ -319,10 +319,10 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -331,76 +331,85 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -410,25 +419,24 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -440,55 +448,56 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -498,20 +507,25 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all linked storage account of a specific data source type associated /// with the specified workspace. @@ -523,8 +537,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// The name of the workspace. /// /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' + /// Linked storage accounts type. /// /// /// Headers that will be added to request. @@ -532,13 +545,13 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -547,76 +560,85 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -626,25 +648,24 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -656,55 +677,56 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -714,9 +736,10 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -727,25 +750,29 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets all linked storage accounts associated with the specified workspace, /// storage accounts will be sorted by their data source type. @@ -762,13 +789,13 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -777,74 +804,82 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -854,25 +889,24 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -884,55 +918,56 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -942,9 +977,10 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -955,24 +991,28 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs index 327017b8e9b2..799574fe7c81 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/LinkedStorageAccountsOperationsExtensions.cs @@ -1,222 +1,195 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for LinkedStorageAccountsOperations. + /// Extension methods for LinkedStorageAccountsOperations /// public static partial class LinkedStorageAccountsOperationsExtensions { - /// - /// Create or Update a link relation between current workspace and a group of - /// storage accounts of a specific data source type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - /// - /// Linked storage accounts resources ids. - /// - public static LinkedStorageAccountsResource CreateOrUpdate(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).GetAwaiter().GetResult(); - } - - /// - /// Create or Update a link relation between current workspace and a group of - /// storage accounts of a specific data source type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - /// - /// Linked storage accounts resources ids. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, IList storageAccountIds = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static LinkedStorageAccountsResource CreateOrUpdate(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + { + return ((ILinkedStorageAccountsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).GetAwaiter().GetResult(); + } - /// - /// Deletes all linked storage accounts of a specific data source type - /// associated with the specified workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + /// + /// Create or Update a link relation between current workspace and a group of + /// storage accounts of a specific data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + ((ILinkedStorageAccountsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } - /// - /// Deletes all linked storage accounts of a specific data source type - /// associated with the specified workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes all linked storage accounts of a specific data source type + /// associated with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + { + return ((ILinkedStorageAccountsOperations)operations).GetAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + } - /// - /// Gets all linked storage account of a specific data source type associated - /// with the specified workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) + /// + /// Gets all linked storage account of a specific data source type associated + /// with the specified workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Linked storage accounts type. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, workspaceName, dataSourceType).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable ListByWorkspace(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName) + { + return ((ILinkedStorageAccountsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets all linked storage account of a specific data source type associated - /// with the specified workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson', 'Query', 'Alerts' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets all linked storage accounts associated with the specified workspace, + /// storage accounts will be sorted by their data source type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, dataSourceType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets all linked storage accounts associated with the specified workspace, - /// storage accounts will be sorted by their data source type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable ListByWorkspace(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all linked storage accounts associated with the specified workspace, - /// storage accounts will be sorted by their data source type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs index 2f2228980c0e..4db124842ef4 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// ManagementGroupsOperations operations. /// - internal partial class ManagementGroupsOperations : IServiceOperations, IManagementGroupsOperations + internal partial class ManagementGroupsOperations : Microsoft.Rest.IServiceOperations, IManagementGroupsOperations { /// /// Initializes a new instance of the ManagementGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class ManagementGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ManagementGroupsOperations(OperationalInsightsManagementClient client) + internal ManagementGroupsOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +182,56 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +241,10 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,24 +255,28 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs index 31af29056e93..eff893f6c58c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/ManagementGroupsOperationsExtensions.cs @@ -1,67 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for ManagementGroupsOperations. + /// Extension methods for ManagementGroupsOperations /// public static partial class ManagementGroupsOperationsExtensions { - /// - /// Gets a list of management groups connected to a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable List(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable List(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IManagementGroupsOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of management groups connected to a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of management groups connected to a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IManagementGroupsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs index 6f79ee6ac743..6378b4b2433e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AssociatedWorkspace.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,25 @@ public AssociatedWorkspace() /// /// Initializes a new instance of the AssociatedWorkspace class. /// - /// The id of the assigned workspace. - /// The name id the assigned - /// workspace. - /// The ResourceId id the assigned - /// workspace. - /// The time of workspace - /// association. + + /// The id of the assigned workspace. + /// + + /// The name id the assigned workspace. + /// + + /// The ResourceId id the assigned workspace. + /// + + /// The time of workspace association. + /// public AssociatedWorkspace(string workspaceId = default(string), string workspaceName = default(string), string resourceId = default(string), string associateDate = default(string)) + { - WorkspaceId = workspaceId; - WorkspaceName = workspaceName; - ResourceId = resourceId; - AssociateDate = associateDate; + this.WorkspaceId = workspaceId; + this.WorkspaceName = workspaceName; + this.ResourceId = resourceId; + this.AssociateDate = associateDate; CustomInit(); } @@ -50,29 +50,29 @@ public AssociatedWorkspace() /// partial void CustomInit(); + /// /// Gets the id of the assigned workspace. /// - [JsonProperty(PropertyName = "workspaceId")] - public string WorkspaceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId {get; private set; } /// /// Gets the name id the assigned workspace. /// - [JsonProperty(PropertyName = "workspaceName")] - public string WorkspaceName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceName")] + public string WorkspaceName {get; private set; } /// /// Gets the ResourceId id the assigned workspace. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; private set; } /// /// Gets the time of workspace association. /// - [JsonProperty(PropertyName = "associateDate")] - public string AssociateDate { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "associateDate")] + public string AssociateDate {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs index 1c2618c5baeb..2f568ff134c2 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AvailableServiceTier.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,32 +23,40 @@ public AvailableServiceTier() /// /// Initializes a new instance of the AvailableServiceTier class. /// - /// The name of the Service Tier. Possible - /// values include: 'Free', 'Standard', 'Premium', 'PerNode', - /// 'PerGB2018', 'Standalone', 'CapacityReservation' - /// True if the Service Tier is enabled for the - /// workspace. - /// The minimum retention for the - /// Service Tier, in days. - /// The maximum retention for the - /// Service Tier, in days. - /// The default retention for the - /// Service Tier, in days. - /// The capacity reservation - /// level in GB per day. Returned for the Capacity Reservation Service - /// Tier. - /// Time when the sku was last updated for - /// the workspace. Returned for the Capacity Reservation Service - /// Tier. + + /// The name of the Service Tier. + /// Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', + /// 'PerGB2018', 'Standalone', 'CapacityReservation' + + /// True if the Service Tier is enabled for the workspace. + /// + + /// The minimum retention for the Service Tier, in days. + /// + + /// The maximum retention for the Service Tier, in days. + /// + + /// The default retention for the Service Tier, in days. + /// + + /// The capacity reservation level in GB per day. Returned for the Capacity + /// Reservation Service Tier. + /// + + /// Time when the sku was last updated for the workspace. Returned for the + /// Capacity Reservation Service Tier. + /// public AvailableServiceTier(string serviceTier = default(string), bool? enabled = default(bool?), long? minimumRetention = default(long?), long? maximumRetention = default(long?), long? defaultRetention = default(long?), long? capacityReservationLevel = default(long?), string lastSkuUpdate = default(string)) + { - ServiceTier = serviceTier; - Enabled = enabled; - MinimumRetention = minimumRetention; - MaximumRetention = maximumRetention; - DefaultRetention = defaultRetention; - CapacityReservationLevel = capacityReservationLevel; - LastSkuUpdate = lastSkuUpdate; + this.ServiceTier = serviceTier; + this.Enabled = enabled; + this.MinimumRetention = minimumRetention; + this.MaximumRetention = maximumRetention; + this.DefaultRetention = defaultRetention; + this.CapacityReservationLevel = capacityReservationLevel; + this.LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -63,51 +65,49 @@ public AvailableServiceTier() /// partial void CustomInit(); + /// - /// Gets the name of the Service Tier. Possible values include: 'Free', - /// 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', - /// 'CapacityReservation' + /// Gets the name of the Service Tier. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation' /// - [JsonProperty(PropertyName = "serviceTier")] - public string ServiceTier { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceTier")] + public string ServiceTier {get; private set; } /// /// Gets true if the Service Tier is enabled for the workspace. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; private set; } /// /// Gets the minimum retention for the Service Tier, in days. /// - [JsonProperty(PropertyName = "minimumRetention")] - public long? MinimumRetention { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimumRetention")] + public long? MinimumRetention {get; private set; } /// /// Gets the maximum retention for the Service Tier, in days. /// - [JsonProperty(PropertyName = "maximumRetention")] - public long? MaximumRetention { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "maximumRetention")] + public long? MaximumRetention {get; private set; } /// /// Gets the default retention for the Service Tier, in days. /// - [JsonProperty(PropertyName = "defaultRetention")] - public long? DefaultRetention { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultRetention")] + public long? DefaultRetention {get; private set; } /// /// Gets the capacity reservation level in GB per day. Returned for the /// Capacity Reservation Service Tier. /// - [JsonProperty(PropertyName = "capacityReservationLevel")] - public long? CapacityReservationLevel { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationLevel")] + public long? CapacityReservationLevel {get; private set; } /// - /// Gets time when the sku was last updated for the workspace. Returned - /// for the Capacity Reservation Service Tier. + /// Gets time when the sku was last updated for the workspace. Returned for the + /// Capacity Reservation Service Tier. /// - [JsonProperty(PropertyName = "lastSkuUpdate")] - public string LastSkuUpdate { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs index 4923d59a4ac3..56cdf84d3ec9 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/AzureEntityResource.cs @@ -1,24 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Entity Resource + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. /// /// - /// The resource model definition for an Azure Resource Manager resource - /// with an etag. + /// The resource model definition for an Azure Resource Manager resource with + /// an etag. /// public partial class AzureEntityResource : Resource { @@ -33,17 +28,25 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Resource Etag. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource Etag. + /// public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type) + + : base(id, name, type) { - Etag = etag; + this.Etag = etag; CustomInit(); } @@ -52,11 +55,11 @@ public AzureEntityResource() /// partial void CustomInit(); + /// /// Gets resource Etag. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs index 4cece2a8e88f..b464f3459d5b 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/BillingType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for BillingType. /// + + public static class BillingType { public const string Cluster = "Cluster"; public const string Workspaces = "Workspaces"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs new file mode 100644 index 000000000000..9dcaada10106 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Capacity.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for Capacity. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum Capacity + { + [System.Runtime.Serialization.EnumMember(Value = "500")] + FiveHundred, + [System.Runtime.Serialization.EnumMember(Value = "1000")] + TenHundred, + [System.Runtime.Serialization.EnumMember(Value = "2000")] + TwoThousand, + [System.Runtime.Serialization.EnumMember(Value = "5000")] + FiveThousand + } + internal static class CapacityEnumExtension + { + internal static string ToSerializedValue(this Capacity? value) + { + return value == null ? null : ((Capacity)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this Capacity value) + { + switch( value ) + { + case Capacity.FiveHundred: + return "500"; + case Capacity.TenHundred: + return "1000"; + case Capacity.TwoThousand: + return "2000"; + case Capacity.FiveThousand: + return "5000"; + } + return null; + } + internal static Capacity? ParseCapacity(this string value) + { + switch( value ) + { + case "500": + return Capacity.FiveHundred; + case "1000": + return Capacity.TenHundred; + case "2000": + return Capacity.TwoThousand; + case "5000": + return Capacity.FiveThousand; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs new file mode 100644 index 000000000000..a69b71472f27 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationLevel.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for CapacityReservationLevel. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum CapacityReservationLevel + { + [System.Runtime.Serialization.EnumMember(Value = "100")] + OneHundred, + [System.Runtime.Serialization.EnumMember(Value = "200")] + TwoHundred, + [System.Runtime.Serialization.EnumMember(Value = "300")] + ThreeHundred, + [System.Runtime.Serialization.EnumMember(Value = "400")] + FourHundred, + [System.Runtime.Serialization.EnumMember(Value = "500")] + FiveHundred, + [System.Runtime.Serialization.EnumMember(Value = "1000")] + TenHundred, + [System.Runtime.Serialization.EnumMember(Value = "2000")] + TwoThousand, + [System.Runtime.Serialization.EnumMember(Value = "5000")] + FiveThousand + } + internal static class CapacityReservationLevelEnumExtension + { + internal static string ToSerializedValue(this CapacityReservationLevel? value) + { + return value == null ? null : ((CapacityReservationLevel)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this CapacityReservationLevel value) + { + switch( value ) + { + case CapacityReservationLevel.OneHundred: + return "100"; + case CapacityReservationLevel.TwoHundred: + return "200"; + case CapacityReservationLevel.ThreeHundred: + return "300"; + case CapacityReservationLevel.FourHundred: + return "400"; + case CapacityReservationLevel.FiveHundred: + return "500"; + case CapacityReservationLevel.TenHundred: + return "1000"; + case CapacityReservationLevel.TwoThousand: + return "2000"; + case CapacityReservationLevel.FiveThousand: + return "5000"; + } + return null; + } + internal static CapacityReservationLevel? ParseCapacityReservationLevel(this string value) + { + switch( value ) + { + case "100": + return CapacityReservationLevel.OneHundred; + case "200": + return CapacityReservationLevel.TwoHundred; + case "300": + return CapacityReservationLevel.ThreeHundred; + case "400": + return CapacityReservationLevel.FourHundred; + case "500": + return CapacityReservationLevel.FiveHundred; + case "1000": + return CapacityReservationLevel.TenHundred; + case "2000": + return CapacityReservationLevel.TwoThousand; + case "5000": + return CapacityReservationLevel.FiveThousand; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs index 18d66429ce55..a2e3dbb4dc3f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CapacityReservationProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models public partial class CapacityReservationProperties { /// - /// Initializes a new instance of the CapacityReservationProperties - /// class. + /// Initializes a new instance of the CapacityReservationProperties class. /// public CapacityReservationProperties() { @@ -28,16 +21,19 @@ public CapacityReservationProperties() } /// - /// Initializes a new instance of the CapacityReservationProperties - /// class. + /// Initializes a new instance of the CapacityReservationProperties class. /// - /// The last time Sku was updated. - /// Minimum CapacityReservation value in - /// GB. + + /// The last time Sku was updated. + /// + + /// Minimum CapacityReservation value in GB. + /// public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?)) + { - LastSkuUpdate = lastSkuUpdate; - MinCapacity = minCapacity; + this.LastSkuUpdate = lastSkuUpdate; + this.MinCapacity = minCapacity; CustomInit(); } @@ -46,17 +42,17 @@ public CapacityReservationProperties() /// partial void CustomInit(); + /// /// Gets the last time Sku was updated. /// - [JsonProperty(PropertyName = "lastSkuUpdate")] - public string LastSkuUpdate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } /// /// Gets minimum CapacityReservation value in GB. /// - [JsonProperty(PropertyName = "minCapacity")] - public long? MinCapacity { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "minCapacity")] + public long? MinCapacity {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs index 0afe9167ade2..87354a89c386 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Cluster.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level Log Analytics cluster resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Cluster : TrackedResource { /// @@ -34,56 +24,80 @@ public Cluster() /// /// Initializes a new instance of the Cluster class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Resource tags. - /// The identity of the resource. - /// The sku properties. - /// The ID associated with the cluster. - /// The provisioning state of the - /// cluster. Possible values include: 'Creating', 'Succeeded', - /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', - /// 'Updating' - /// Configures whether cluster - /// will use double encryption. This Property can not be modified after - /// cluster creation. Default value is 'true' - /// Sets whether the cluster - /// will support availability zones. This can be set as true only in - /// regions where Azure Data Explorer support Availability Zones. This - /// Property can not be modified after cluster creation. Default value - /// is 'true' if region supports Availability Zones. - /// The cluster's billing type. Possible - /// values include: 'Cluster', 'Workspaces' - /// The associated key - /// properties. - /// The last time the cluster was - /// updated. - /// The cluster creation time - /// The list of Log Analytics - /// workspaces associated with the cluster - /// Additional properties - /// for capacity reservation - public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), IList associatedWorkspaces = default(IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) - : base(location, id, name, type, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// The identity of the resource. + /// + + /// The sku properties. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The ID associated with the cluster. + /// + + /// The provisioning state of the cluster. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// Configures whether cluster will use double encryption. This Property can + /// not be modified after cluster creation. Default value is 'true' + /// + + /// Sets whether the cluster will support availability zones. This can be set + /// as true only in regions where Azure Data Explorer support Availability + /// Zones. This Property can not be modified after cluster creation. Default + /// value is 'true' if region supports Availability Zones. + /// + + /// The associated key properties. + /// + + /// The last time the cluster was updated. + /// + + /// The cluster creation time + /// + + /// The list of Log Analytics workspaces associated with the cluster + /// + + /// Additional properties for capacity reservation + /// + public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string billingType = default(string), string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), System.Collections.Generic.IList associatedWorkspaces = default(System.Collections.Generic.IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) + + : base(location, id, name, type, tags) { - Identity = identity; - Sku = sku; - ClusterId = clusterId; - ProvisioningState = provisioningState; - IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; - IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; - BillingType = billingType; - KeyVaultProperties = keyVaultProperties; - LastModifiedDate = lastModifiedDate; - CreatedDate = createdDate; - AssociatedWorkspaces = associatedWorkspaces; - CapacityReservationProperties = capacityReservationProperties; + this.Identity = identity; + this.Sku = sku; + this.BillingType = billingType; + this.ClusterId = clusterId; + this.ProvisioningState = provisioningState; + this.IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + this.IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + this.KeyVaultProperties = keyVaultProperties; + this.LastModifiedDate = lastModifiedDate; + this.CreatedDate = createdDate; + this.AssociatedWorkspaces = associatedWorkspaces; + this.CapacityReservationProperties = capacityReservationProperties; CustomInit(); } @@ -92,101 +106,106 @@ public Cluster() /// partial void CustomInit(); + /// /// Gets or sets the identity of the resource. /// - [JsonProperty(PropertyName = "identity")] - public Identity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public Identity Identity {get; set; } /// /// Gets or sets the sku properties. /// - [JsonProperty(PropertyName = "sku")] - public ClusterSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ClusterSku Sku {get; set; } /// - /// Gets the ID associated with the cluster. + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' /// - [JsonProperty(PropertyName = "properties.clusterId")] - public string ClusterId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingType")] + public string BillingType {get; set; } /// - /// Gets the provisioning state of the cluster. Possible values - /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', - /// 'ProvisioningAccount', 'Updating' + /// Gets the ID associated with the cluster. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.clusterId")] + public string ClusterId {get; private set; } /// - /// Gets or sets configures whether cluster will use double encryption. - /// This Property can not be modified after cluster creation. Default - /// value is 'true' + /// Gets the provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' /// - [JsonProperty(PropertyName = "properties.isDoubleEncryptionEnabled")] - public bool? IsDoubleEncryptionEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets sets whether the cluster will support availability - /// zones. This can be set as true only in regions where Azure Data - /// Explorer support Availability Zones. This Property can not be - /// modified after cluster creation. Default value is 'true' if region - /// supports Availability Zones. + /// Gets or sets configures whether cluster will use double encryption. This + /// Property can not be modified after cluster creation. Default value is + /// 'true' /// - [JsonProperty(PropertyName = "properties.isAvailabilityZonesEnabled")] - public bool? IsAvailabilityZonesEnabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled {get; set; } /// - /// Gets or sets the cluster's billing type. Possible values include: - /// 'Cluster', 'Workspaces' + /// Gets or sets sets whether the cluster will support availability zones. This + /// can be set as true only in regions where Azure Data Explorer support + /// Availability Zones. This Property can not be modified after cluster + /// creation. Default value is 'true' if region supports Availability Zones. /// - [JsonProperty(PropertyName = "properties.billingType")] - public string BillingType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled {get; set; } /// /// Gets or sets the associated key properties. /// - [JsonProperty(PropertyName = "properties.keyVaultProperties")] - public KeyVaultProperties KeyVaultProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } /// /// Gets the last time the cluster was updated. /// - [JsonProperty(PropertyName = "properties.lastModifiedDate")] - public string LastModifiedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate {get; private set; } /// /// Gets the cluster creation time /// - [JsonProperty(PropertyName = "properties.createdDate")] - public string CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } /// - /// Gets or sets the list of Log Analytics workspaces associated with - /// the cluster + /// Gets or sets the list of Log Analytics workspaces associated with the + /// cluster /// - [JsonProperty(PropertyName = "properties.associatedWorkspaces")] - public IList AssociatedWorkspaces { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.associatedWorkspaces")] + public System.Collections.Generic.IList AssociatedWorkspaces {get; set; } /// /// Gets or sets additional properties for capacity reservation /// - [JsonProperty(PropertyName = "properties.capacityReservationProperties")] - public CapacityReservationProperties CapacityReservationProperties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Identity != null) + if (this.Identity != null) { - Identity.Validate(); + this.Identity.Validate(); } + + + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs index 805e81dce682..e04075993f8e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterEntityStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for ClusterEntityStatus. /// + + public static class ClusterEntityStatus { public const string Creating = "Creating"; @@ -24,4 +21,4 @@ public static class ClusterEntityStatus public const string ProvisioningAccount = "ProvisioningAccount"; public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs index fdc2e62fcc8a..5c42d788817b 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatch.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level Log Analytics cluster resource container. /// - [Rest.Serialization.JsonTransformation] - public partial class ClusterPatch : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ClusterPatch : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the ClusterPatch class. @@ -35,20 +24,29 @@ public ClusterPatch() /// /// Initializes a new instance of the ClusterPatch class. /// - /// The associated key - /// properties. - /// The cluster's billing type. Possible - /// values include: 'Cluster', 'Workspaces' - /// The identity of the resource. - /// The sku properties. - /// Resource tags. - public ClusterPatch(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string billingType = default(string), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), IDictionary tags = default(IDictionary)) + + /// The identity of the resource. + /// + + /// The sku properties. + /// + + /// Resource tags. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The associated key properties. + /// + public ClusterPatch(Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + { - KeyVaultProperties = keyVaultProperties; - BillingType = billingType; - Identity = identity; - Sku = sku; - Tags = tags; + this.Identity = identity; + this.Sku = sku; + this.Tags = tags; + this.BillingType = billingType; + this.KeyVaultProperties = keyVaultProperties; CustomInit(); } @@ -57,49 +55,52 @@ public ClusterPatch() /// partial void CustomInit(); + /// - /// Gets or sets the associated key properties. + /// Gets or sets the identity of the resource. /// - [JsonProperty(PropertyName = "properties.keyVaultProperties")] - public KeyVaultProperties KeyVaultProperties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public Identity Identity {get; set; } /// - /// Gets or sets the cluster's billing type. Possible values include: - /// 'Cluster', 'Workspaces' + /// Gets or sets the sku properties. /// - [JsonProperty(PropertyName = "properties.billingType")] - public string BillingType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public ClusterSku Sku {get; set; } /// - /// Gets or sets the identity of the resource. + /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "identity")] - public Identity Identity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets the sku properties. + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' /// - [JsonProperty(PropertyName = "sku")] - public ClusterSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.billingType")] + public string BillingType {get; set; } /// - /// Gets or sets resource tags. + /// Gets or sets the associated key properties. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Identity != null) + if (this.Identity != null) { - Identity.Validate(); + this.Identity.Validate(); } + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs new file mode 100644 index 000000000000..a695bfabfaad --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterPatchProperties.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Log Analytics cluster patch properties. + /// + public partial class ClusterPatchProperties + { + /// + /// Initializes a new instance of the ClusterPatchProperties class. + /// + public ClusterPatchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterPatchProperties class. + /// + + /// The associated key properties. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + public ClusterPatchProperties(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string billingType = default(string)) + + { + this.KeyVaultProperties = keyVaultProperties; + this.BillingType = billingType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingType")] + public string BillingType {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs new file mode 100644 index 000000000000..d499634b2cd7 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterProperties.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Cluster properties. + /// + public partial class ClusterProperties + { + /// + /// Initializes a new instance of the ClusterProperties class. + /// + public ClusterProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClusterProperties class. + /// + + /// The ID associated with the cluster. + /// + + /// The provisioning state of the cluster. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// Configures whether cluster will use double encryption. This Property can + /// not be modified after cluster creation. Default value is 'true' + /// + + /// Sets whether the cluster will support availability zones. This can be set + /// as true only in regions where Azure Data Explorer support Availability + /// Zones. This Property can not be modified after cluster creation. Default + /// value is 'true' if region supports Availability Zones. + /// + + /// The cluster's billing type. + /// Possible values include: 'Cluster', 'Workspaces' + + /// The associated key properties. + /// + + /// The last time the cluster was updated. + /// + + /// The cluster creation time + /// + + /// The list of Log Analytics workspaces associated with the cluster + /// + + /// Additional properties for capacity reservation + /// + public ClusterProperties(string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), System.Collections.Generic.IList associatedWorkspaces = default(System.Collections.Generic.IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) + + { + this.ClusterId = clusterId; + this.ProvisioningState = provisioningState; + this.IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + this.IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + this.BillingType = billingType; + this.KeyVaultProperties = keyVaultProperties; + this.LastModifiedDate = lastModifiedDate; + this.CreatedDate = createdDate; + this.AssociatedWorkspaces = associatedWorkspaces; + this.CapacityReservationProperties = capacityReservationProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the ID associated with the cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clusterId")] + public string ClusterId {get; private set; } + + /// + /// Gets the provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets or sets configures whether cluster will use double encryption. This + /// Property can not be modified after cluster creation. Default value is + /// 'true' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled {get; set; } + + /// + /// Gets or sets sets whether the cluster will support availability zones. This + /// can be set as true only in regions where Azure Data Explorer support + /// Availability Zones. This Property can not be modified after cluster + /// creation. Default value is 'true' if region supports Availability Zones. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled {get; set; } + + /// + /// Gets or sets the cluster's billing type. Possible values include: 'Cluster', 'Workspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "billingType")] + public string BillingType {get; set; } + + /// + /// Gets or sets the associated key properties. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties {get; set; } + + /// + /// Gets the last time the cluster was updated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDate")] + public string LastModifiedDate {get; private set; } + + /// + /// Gets the cluster creation time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets or sets the list of Log Analytics workspaces associated with the + /// cluster + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "associatedWorkspaces")] + public System.Collections.Generic.IList AssociatedWorkspaces {get; set; } + + /// + /// Gets or sets additional properties for capacity reservation + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs index 78d93195bedc..44d2feee6924 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSku.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public ClusterSku() /// /// Initializes a new instance of the ClusterSku class. /// - /// The capacity value - /// The name of the SKU. Possible values include: - /// 'CapacityReservation' + + /// The capacity value + /// Possible values include: '500', '1000', '2000', '5000' + + /// The name of the SKU. + /// Possible values include: 'CapacityReservation' public ClusterSku(long? capacity = default(long?), string name = default(string)) + { - Capacity = capacity; - Name = name; + this.Capacity = capacity; + this.Name = name; CustomInit(); } @@ -44,18 +42,17 @@ public ClusterSku() /// partial void CustomInit(); + /// - /// Gets or sets the capacity value + /// Gets or sets the capacity value Possible values include: '500', '1000', '2000', '5000' /// - [JsonProperty(PropertyName = "capacity")] - public long? Capacity { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public long? Capacity {get; set; } /// - /// Gets or sets the name of the SKU. Possible values include: - /// 'CapacityReservation' + /// Gets or sets the name of the SKU. Possible values include: 'CapacityReservation' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs index a34fc481db8b..6d2f709417b0 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ClusterSkuNameEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,8 +9,10 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for ClusterSkuNameEnum. /// + + public static class ClusterSkuNameEnum { public const string CapacityReservation = "CapacityReservation"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs index 93c8f432af90..d0535f1c8a12 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Column.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,25 +23,38 @@ public Column() /// /// Initializes a new instance of the Column class. /// - /// Column name. - /// Column data type. Possible values include: - /// 'string', 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', - /// 'dynamic' - /// Column data type logical hint. Possible - /// values include: 'uri', 'guid', 'armPath', 'ip' - /// Column display name. - /// Column description. - /// Is displayed by default. - /// Is column hidden. + + /// Column name. + /// + + /// Column data type. + /// Possible values include: 'string', 'int', 'long', 'real', 'boolean', + /// 'dateTime', 'guid', 'dynamic' + + /// Column data type logical hint. + /// Possible values include: 'uri', 'guid', 'armPath', 'ip' + + /// Column display name. + /// + + /// Column description. + /// + + /// Is displayed by default. + /// + + /// Is column hidden. + /// public Column(string name = default(string), string type = default(string), string dataTypeHint = default(string), string displayName = default(string), string description = default(string), bool? isDefaultDisplay = default(bool?), bool? isHidden = default(bool?)) + { - Name = name; - Type = type; - DataTypeHint = dataTypeHint; - DisplayName = displayName; - Description = description; - IsDefaultDisplay = isDefaultDisplay; - IsHidden = isHidden; + this.Name = name; + this.Type = type; + this.DataTypeHint = dataTypeHint; + this.DisplayName = displayName; + this.Description = description; + this.IsDefaultDisplay = isDefaultDisplay; + this.IsHidden = isHidden; CustomInit(); } @@ -56,49 +63,47 @@ public Column() /// partial void CustomInit(); + /// /// Gets or sets column name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets column data type. Possible values include: 'string', - /// 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', 'dynamic' + /// Gets or sets column data type. Possible values include: 'string', 'int', 'long', 'real', 'boolean', 'dateTime', 'guid', 'dynamic' /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets column data type logical hint. Possible values - /// include: 'uri', 'guid', 'armPath', 'ip' + /// Gets or sets column data type logical hint. Possible values include: 'uri', 'guid', 'armPath', 'ip' /// - [JsonProperty(PropertyName = "dataTypeHint")] - public string DataTypeHint { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dataTypeHint")] + public string DataTypeHint {get; set; } /// /// Gets or sets column display name. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets column description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets is displayed by default. /// - [JsonProperty(PropertyName = "isDefaultDisplay")] - public bool? IsDefaultDisplay { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isDefaultDisplay")] + public bool? IsDefaultDisplay {get; private set; } /// /// Gets is column hidden. /// - [JsonProperty(PropertyName = "isHidden")] - public bool? IsHidden { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isHidden")] + public bool? IsHidden {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs index 87c5db388a9d..ae8f450cf6d3 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnDataTypeHintEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for ColumnDataTypeHintEnum. /// + + public static class ColumnDataTypeHintEnum { /// /// A string that matches the pattern of a URI, for example, - /// scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment + /// scheme://username:password@host:1234/this/is/a/path?k1=v1&amp;k2=v2#fragment /// public const string Uri = "uri"; /// @@ -37,4 +34,4 @@ public static class ColumnDataTypeHintEnum /// public const string Ip = "ip"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs index dec674236591..af3e1845f27f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ColumnTypeEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for ColumnTypeEnum. /// + + public static class ColumnTypeEnum { public const string String = "string"; @@ -25,4 +22,4 @@ public static class ColumnTypeEnum public const string Guid = "guid"; public const string Dynamic = "dynamic"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs index 736000ddffc2..97404a5ecc84 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CoreSummary.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public CoreSummary() /// /// Initializes a new instance of the CoreSummary class. /// - /// The number of documents of a core - /// summary. - /// The status of a core summary. + + /// The status of a core summary. + /// + + /// The number of documents of a core summary. + /// public CoreSummary(long numberOfDocuments, string status = default(string)) + { - Status = status; - NumberOfDocuments = numberOfDocuments; + this.Status = status; + this.NumberOfDocuments = numberOfDocuments; CustomInit(); } @@ -44,27 +42,27 @@ public CoreSummary() /// partial void CustomInit(); + /// /// Gets or sets the status of a core summary. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the number of documents of a core summary. /// - [JsonProperty(PropertyName = "numberOfDocuments")] - public long NumberOfDocuments { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "numberOfDocuments")] + public long NumberOfDocuments {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - //Nothing to validate + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs index c2d6149cd9ce..130114c54ac7 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs index 22c7831f8f9e..2a0d32b18295 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExport.cs @@ -1,28 +1,17 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level data export resource container. /// - [Rest.Serialization.JsonTransformation] - public partial class DataExport : IResource + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DataExport : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the DataExport class. @@ -35,31 +24,43 @@ public DataExport() /// /// Initializes a new instance of the DataExport class. /// - /// An array of tables to export, for example: - /// [“Heartbeat, SecurityEvent”]. - /// The destination resource ID. This can be - /// copied from the Properties entry of the destination resource in - /// Azure. - /// The data export rule ID. - /// The type of the destination resource. - /// Possible values include: 'StorageAccount', 'EventHub' - /// Optional. Allows to define an Event Hub - /// name. Not applicable when destination is Storage Account. - /// Active when enabled. - /// The latest data export rule modification - /// time. - /// Date and time when the export was - /// last modified. - public DataExport(IList tableNames, string resourceId, string dataExportId = default(string), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) + + /// The data export rule ID. + /// + + /// An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + /// + + /// Active when enabled. + /// + + /// The latest data export rule modification time. + /// + + /// Date and time when the export was last modified. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DataExport(string dataExportId = default(string), System.Collections.Generic.IList tableNames = default(System.Collections.Generic.IList), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string), string resourceId = default(string), string dataExportType = default(string), string eventHubName = default(string)) + { - DataExportId = dataExportId; - TableNames = tableNames; - ResourceId = resourceId; - DataExportType = dataExportType; - EventHubName = eventHubName; - Enable = enable; - CreatedDate = createdDate; - LastModifiedDate = lastModifiedDate; + this.DataExportId = dataExportId; + this.TableNames = tableNames; + this.Enable = enable; + this.CreatedDate = createdDate; + this.LastModifiedDate = lastModifiedDate; + this.ResourceId = resourceId; + this.DataExportType = dataExportType; + this.EventHubName = eventHubName; CustomInit(); } @@ -68,74 +69,56 @@ public DataExport() /// partial void CustomInit(); - /// - /// Gets or sets the data export rule ID. - /// - [JsonProperty(PropertyName = "properties.dataExportId")] - public string DataExportId { get; set; } /// - /// Gets or sets an array of tables to export, for example: - /// [“Heartbeat, SecurityEvent”]. + /// Gets or sets the data export rule ID. /// - [JsonProperty(PropertyName = "properties.tableNames")] - public IList TableNames { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataExportId")] + public string DataExportId {get; set; } /// - /// Gets or sets the destination resource ID. This can be copied from - /// the Properties entry of the destination resource in Azure. + /// Gets or sets an array of tables to export, for example: [“Heartbeat, + /// SecurityEvent”]. /// - [JsonProperty(PropertyName = "properties.destination.resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tableNames")] + public System.Collections.Generic.IList TableNames {get; set; } /// - /// Gets the type of the destination resource. Possible values include: - /// 'StorageAccount', 'EventHub' + /// Gets or sets active when enabled. /// - [JsonProperty(PropertyName = "properties.destination.type")] - public string DataExportType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enable")] + public bool? Enable {get; set; } /// - /// Gets or sets optional. Allows to define an Event Hub name. Not - /// applicable when destination is Storage Account. + /// Gets or sets the latest data export rule modification time. /// - [JsonProperty(PropertyName = "properties.destination.metaData.eventHubName")] - public string EventHubName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; set; } /// - /// Gets or sets active when enabled. + /// Gets or sets date and time when the export was last modified. /// - [JsonProperty(PropertyName = "properties.enable")] - public bool? Enable { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate {get; set; } /// - /// Gets or sets the latest data export rule modification time. + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public string CreatedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets date and time when the export was last modified. + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' /// - [JsonProperty(PropertyName = "properties.lastModifiedDate")] - public string LastModifiedDate { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.type")] + public string DataExportType {get; private set; } /// - /// Validate the object. + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TableNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TableNames"); - } - if (ResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); - } - } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.destination.metaData.eventHubName")] + public string EventHubName {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs new file mode 100644 index 000000000000..2aa32eb0d491 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataExportProperties.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Data Export properties. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class DataExportProperties + { + /// + /// Initializes a new instance of the DataExportProperties class. + /// + public DataExportProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataExportProperties class. + /// + + /// The data export rule ID. + /// + + /// An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + /// + + /// Active when enabled. + /// + + /// The latest data export rule modification time. + /// + + /// Date and time when the export was last modified. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DataExportProperties(System.Collections.Generic.IList tableNames, string dataExportId = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string), string resourceId = default(string), string type = default(string), string eventHubName = default(string)) + + { + this.DataExportId = dataExportId; + this.TableNames = tableNames; + this.Enable = enable; + this.CreatedDate = createdDate; + this.LastModifiedDate = lastModifiedDate; + this.ResourceId = resourceId; + this.Type = type; + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the data export rule ID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataExportId")] + public string DataExportId {get; set; } + + /// + /// Gets or sets an array of tables to export, for example: [“Heartbeat, + /// SecurityEvent”]. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tableNames")] + public System.Collections.Generic.IList TableNames {get; set; } + + /// + /// Gets or sets active when enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enable")] + public bool? Enable {get; set; } + + /// + /// Gets or sets the latest data export rule modification time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; set; } + + /// + /// Gets or sets date and time when the export was last modified. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDate")] + public string LastModifiedDate {get; set; } + + /// + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.type")] + public string Type {get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "destination.metaData.eventHubName")] + public string EventHubName {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.TableNames == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TableNames"); + } + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs index 78ed4da9ec3c..b25a3930aa77 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataIngestionStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for DataIngestionStatus. /// + + public static class DataIngestionStatus { /// @@ -42,4 +39,4 @@ public static class DataIngestionStatus /// public const string ApproachingQuota = "ApproachingQuota"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs index 62ec50342b71..508e0de4ff1d 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSource.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,39 +23,52 @@ public DataSource() /// /// Initializes a new instance of the DataSource class. /// - /// The data source properties in raw json - /// format, each kind of data source have it's own schema. - /// Possible values include: 'WindowsEvent', - /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', - /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', - /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', - /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', - /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', - /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', - /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', - /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', - /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', - /// 'SecurityWindowsBaselineConfiguration', - /// 'SecurityCenterSecurityWindowsBaselineConfiguration', - /// 'SecurityEventCollectionConfiguration', - /// 'SecurityInsightsSecurityEventCollectionConfiguration', - /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', - /// 'ApplicationInsights', 'SqlDataClassification' + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// The ETag of the data source. - /// Resource tags. - public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The data source properties in raw json format, each kind of data source + /// have it's own schema. + /// + + /// The ETag of the data source. + /// + + /// The kind of the DataSource. + /// Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + /// 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + /// 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + /// 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + /// 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' + + /// Resource tags. + /// + public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type) { - Properties = properties; - Etag = etag; - Kind = kind; - Tags = tags; + this.Properties = properties; + this.Etag = etag; + this.Kind = kind; + this.Tags = tags; CustomInit(); } @@ -73,62 +77,51 @@ public DataSource() /// partial void CustomInit(); + /// - /// Gets or sets the data source properties in raw json format, each - /// kind of data source have it's own schema. + /// Gets or sets the data source properties in raw json format, each kind of + /// data source have it's own schema. /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public object Properties {get; set; } /// /// Gets or sets the ETag of the data source. /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } /// - /// Gets or sets possible values include: 'WindowsEvent', - /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', - /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', - /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', - /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', - /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', - /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', - /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', - /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', - /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', - /// 'SecurityWindowsBaselineConfiguration', - /// 'SecurityCenterSecurityWindowsBaselineConfiguration', - /// 'SecurityEventCollectionConfiguration', - /// 'SecurityInsightsSecurityEventCollectionConfiguration', - /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', - /// 'ApplicationInsights', 'SqlDataClassification' + /// Gets or sets the kind of the DataSource. Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification' /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Properties == null) + if (this.Properties == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Properties"); } - if (Kind == null) + if (this.Kind == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Kind"); } + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs index 204e5c64334c..e07eab7bc373 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceFilter.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,25 +23,27 @@ public DataSourceFilter() /// /// Initializes a new instance of the DataSourceFilter class. /// - /// Possible values include: 'WindowsEvent', - /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', - /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', - /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', - /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', - /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', - /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', - /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', - /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', - /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', - /// 'SecurityWindowsBaselineConfiguration', - /// 'SecurityCenterSecurityWindowsBaselineConfiguration', - /// 'SecurityEventCollectionConfiguration', - /// 'SecurityInsightsSecurityEventCollectionConfiguration', - /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', - /// 'ApplicationInsights', 'SqlDataClassification' + + /// The kind of the DataSource. + /// Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + /// 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + /// 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + /// 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + /// 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + /// 'SecurityWindowsBaselineConfiguration', + /// 'SecurityCenterSecurityWindowsBaselineConfiguration', + /// 'SecurityEventCollectionConfiguration', + /// 'SecurityInsightsSecurityEventCollectionConfiguration', + /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + /// 'ApplicationInsights', 'SqlDataClassification' public DataSourceFilter(string kind = default(string)) + { - Kind = kind; + this.Kind = kind; CustomInit(); } @@ -56,26 +52,11 @@ public DataSourceFilter() /// partial void CustomInit(); + /// - /// Gets or sets possible values include: 'WindowsEvent', - /// 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', - /// 'LinuxSyslogCollection', 'LinuxPerformanceObject', - /// 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', - /// 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', - /// 'ChangeTrackingCustomPath', 'ChangeTrackingPath', - /// 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', - /// 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', - /// 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', - /// 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', - /// 'SecurityWindowsBaselineConfiguration', - /// 'SecurityCenterSecurityWindowsBaselineConfiguration', - /// 'SecurityEventCollectionConfiguration', - /// 'SecurityInsightsSecurityEventCollectionConfiguration', - /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', - /// 'ApplicationInsights', 'SqlDataClassification' + /// Gets or sets the kind of the DataSource. Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification' /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs index a333acf6c231..35e4a526a5b0 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceKind.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for DataSourceKind. /// + + public static class DataSourceKind { public const string WindowsEvent = "WindowsEvent"; @@ -50,4 +47,4 @@ public static class DataSourceKind public const string ApplicationInsights = "ApplicationInsights"; public const string SqlDataClassification = "SqlDataClassification"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs index 9a20d7347e55..f8ff89218933 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DataSourceType.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for DataSourceType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum DataSourceType { - [EnumMember(Value = "CustomLogs")] + [System.Runtime.Serialization.EnumMember(Value = "CustomLogs")] CustomLogs, - [EnumMember(Value = "AzureWatson")] + [System.Runtime.Serialization.EnumMember(Value = "AzureWatson")] AzureWatson, - [EnumMember(Value = "Query")] + [System.Runtime.Serialization.EnumMember(Value = "Query")] Query, - [EnumMember(Value = "Alerts")] + [System.Runtime.Serialization.EnumMember(Value = "Alerts")] Alerts } internal static class DataSourceTypeEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this DataSourceType? value) { return value == null ? null : ((DataSourceType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this DataSourceType value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this DataSourceType value) } return null; } - internal static DataSourceType? ParseDataSourceType(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this DataSourceType value) return null; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs new file mode 100644 index 000000000000..0572b1e917ef --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Destination.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Destination properties. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class Destination + { + /// + /// Initializes a new instance of the Destination class. + /// + public Destination() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Destination class. + /// + + /// The destination resource ID. This can be copied from the Properties entry + /// of the destination resource in Azure. + /// + + /// The type of the destination resource + /// Possible values include: 'StorageAccount', 'EventHub' + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public Destination(string resourceId, string type = default(string), string eventHubName = default(string)) + + { + this.ResourceId = resourceId; + this.Type = type; + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the destination resource ID. This can be copied from the + /// Properties entry of the destination resource in Azure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets the type of the destination resource Possible values include: 'StorageAccount', 'EventHub' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metaData.eventHubName")] + public string EventHubName {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.ResourceId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ResourceId"); + } + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs new file mode 100644 index 000000000000..c477b6677519 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/DestinationMetaData.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Destination meta data. + /// + public partial class DestinationMetaData + { + /// + /// Initializes a new instance of the DestinationMetaData class. + /// + public DestinationMetaData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DestinationMetaData class. + /// + + /// Optional. Allows to define an Event Hub name. Not applicable when + /// destination is Storage Account. + /// + public DestinationMetaData(string eventHubName = default(string)) + + { + this.EventHubName = eventHubName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets optional. Allows to define an Event Hub name. Not applicable + /// when destination is Storage Account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventHubName")] + public string EventHubName {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs index f37324dc3b0f..509a9bc7ba7e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorAdditionalInfo.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public ErrorAdditionalInfo() /// /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// The additional info type. - /// The additional info. + + /// The additional info type. + /// + + /// The additional info. + /// public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { - Type = type; - Info = info; + this.Type = type; + this.Info = info; CustomInit(); } @@ -43,17 +42,17 @@ public ErrorAdditionalInfo() /// partial void CustomInit(); + /// /// Gets the additional info type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets the additional info. /// - [JsonProperty(PropertyName = "info")] - public object Info { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "info")] + public object Info {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs index 308fd06f3b34..26f9a5a5f0e3 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,18 +23,29 @@ public ErrorDetail() /// /// Initializes a new instance of the ErrorDetail class. /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + + /// The error code. + /// + + /// The error message. + /// + + /// The error target. + /// + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; CustomInit(); } @@ -51,35 +54,35 @@ public ErrorDetail() /// partial void CustomInit(); + /// /// Gets the error code. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } /// /// Gets the error message. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } /// /// Gets the error target. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } /// /// Gets the error details. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } /// /// Gets the error additional info. /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs index 8ea5c4fc5282..18f4c2ce34f8 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -1,25 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Error response + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// /// - /// Common error response for all Azure Resource Manager APIs to return - /// error details for failed operations. (This also follows the OData error - /// response format.). + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// public partial class ErrorResponse { @@ -34,10 +30,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error object. + + /// The error object. + /// public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -46,11 +45,11 @@ public ErrorResponse() /// partial void CustomInit(); + /// /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs index 9addf8aa02d2..2c109044fa72 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs index d41b26537594..f3cb42a56361 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Identity.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,21 +23,27 @@ public Identity() /// /// Initializes a new instance of the Identity class. /// - /// Type of managed service identity. Possible - /// values include: 'SystemAssigned', 'UserAssigned', 'None' - /// The principal ID of resource - /// identity. - /// The tenant ID of resource. - /// The list of user identities - /// associated with the resource. The user identity dictionary key - /// references will be ARM resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + + /// The principal ID of resource identity. + /// + + /// The tenant ID of resource. + /// + + /// Type of managed service identity. + /// Possible values include: 'SystemAssigned', 'UserAssigned', 'None' + + /// The list of user identities associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + { - PrincipalId = principalId; - TenantId = tenantId; - Type = type; - UserAssignedIdentities = userAssignedIdentities; + this.PrincipalId = principalId; + this.TenantId = tenantId; + this.Type = type; + this.UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -54,42 +52,45 @@ public Identity() /// partial void CustomInit(); + /// /// Gets the principal ID of resource identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the tenant ID of resource. /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId {get; private set; } /// - /// Gets or sets type of managed service identity. Possible values - /// include: 'SystemAssigned', 'UserAssigned', 'None' + /// Gets or sets type of managed service identity. Possible values include: 'SystemAssigned', 'UserAssigned', 'None' /// - [JsonProperty(PropertyName = "type")] - public IdentityType Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public IdentityType Type {get; set; } /// - /// Gets or sets the list of user identities associated with the - /// resource. The user identity dictionary key references will be ARM - /// resource ids in the form: - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// Gets or sets the list of user identities associated with the resource. The + /// user identity dictionary key references will be ARM resource ids in the + /// form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "userAssignedIdentities")] - public IDictionary UserAssignedIdentities { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs index b63a090303c0..9d37cfd7e562 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IdentityType.cs @@ -1,31 +1,24 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for IdentityType. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum IdentityType { - [EnumMember(Value = "SystemAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "SystemAssigned")] SystemAssigned, - [EnumMember(Value = "UserAssigned")] + [System.Runtime.Serialization.EnumMember(Value = "UserAssigned")] UserAssigned, - [EnumMember(Value = "None")] + [System.Runtime.Serialization.EnumMember(Value = "None")] None } internal static class IdentityTypeEnumExtension @@ -34,7 +27,6 @@ internal static string ToSerializedValue(this IdentityType? value) { return value == null ? null : ((IdentityType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this IdentityType value) { switch( value ) @@ -48,7 +40,6 @@ internal static string ToSerializedValue(this IdentityType value) } return null; } - internal static IdentityType? ParseIdentityType(this string value) { switch( value ) @@ -63,4 +54,4 @@ internal static string ToSerializedValue(this IdentityType value) return null; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs index fe3dfa4f2d26..5c1810c91887 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/IntelligencePack.cs @@ -1,21 +1,15 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Intelligence Pack containing a string name and boolean indicating if - /// it's enabled. + /// Intelligence Pack containing a string name and boolean indicating if it's + /// enabled. /// public partial class IntelligencePack { @@ -30,16 +24,21 @@ public IntelligencePack() /// /// Initializes a new instance of the IntelligencePack class. /// - /// The name of the intelligence pack. - /// The enabled boolean for the intelligence - /// pack. - /// The display name of the intelligence - /// pack. + + /// The name of the intelligence pack. + /// + + /// The enabled boolean for the intelligence pack. + /// + + /// The display name of the intelligence pack. + /// public IntelligencePack(string name = default(string), bool? enabled = default(bool?), string displayName = default(string)) + { - Name = name; - Enabled = enabled; - DisplayName = displayName; + this.Name = name; + this.Enabled = enabled; + this.DisplayName = displayName; CustomInit(); } @@ -48,23 +47,23 @@ public IntelligencePack() /// partial void CustomInit(); + /// /// Gets or sets the name of the intelligence pack. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the enabled boolean for the intelligence pack. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// /// Gets or sets the display name of the intelligence pack. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs index 2fc2a0e6b29e..7fb2362cbd1d 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/KeyVaultProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,20 +23,26 @@ public KeyVaultProperties() /// /// Initializes a new instance of the KeyVaultProperties class. /// - /// The Key Vault uri which holds they key - /// associated with the Log Analytics cluster. - /// The name of the key associated with the Log - /// Analytics cluster. - /// The version of the key associated with the - /// Log Analytics cluster. - /// Selected key minimum required - /// size. + + /// The Key Vault uri which holds they key associated with the Log Analytics + /// cluster. + /// + + /// The name of the key associated with the Log Analytics cluster. + /// + + /// The version of the key associated with the Log Analytics cluster. + /// + + /// Selected key minimum required size. + /// public KeyVaultProperties(string keyVaultUri = default(string), string keyName = default(string), string keyVersion = default(string), int? keyRsaSize = default(int?)) + { - KeyVaultUri = keyVaultUri; - KeyName = keyName; - KeyVersion = keyVersion; - KeyRsaSize = keyRsaSize; + this.KeyVaultUri = keyVaultUri; + this.KeyName = keyName; + this.KeyVersion = keyVersion; + this.KeyRsaSize = keyRsaSize; CustomInit(); } @@ -51,32 +51,31 @@ public KeyVaultProperties() /// partial void CustomInit(); + /// - /// Gets or sets the Key Vault uri which holds they key associated with - /// the Log Analytics cluster. + /// Gets or sets the Key Vault uri which holds they key associated with the Log + /// Analytics cluster. /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri {get; set; } /// - /// Gets or sets the name of the key associated with the Log Analytics - /// cluster. + /// Gets or sets the name of the key associated with the Log Analytics cluster. /// - [JsonProperty(PropertyName = "keyName")] - public string KeyName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyName")] + public string KeyName {get; set; } /// - /// Gets or sets the version of the key associated with the Log - /// Analytics cluster. + /// Gets or sets the version of the key associated with the Log Analytics + /// cluster. /// - [JsonProperty(PropertyName = "keyVersion")] - public string KeyVersion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "keyVersion")] + public string KeyVersion {get; set; } /// /// Gets or sets selected key minimum required size. /// - [JsonProperty(PropertyName = "keyRsaSize")] - public int? KeyRsaSize { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "keyRsaSize")] + public int? KeyRsaSize {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs index 56b3f4f15a12..b80b97d08c36 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedService.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level Linked service resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LinkedService : ProxyResource { /// @@ -34,29 +24,40 @@ public LinkedService() /// /// Initializes a new instance of the LinkedService class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// The resource id of the resource that will - /// be linked to the workspace. This should be used for linking - /// resources which require read access - /// The resource id of the resource - /// that will be linked to the workspace. This should be used for - /// linking resources which require write access - /// The provisioning state of the - /// linked service. Possible values include: 'Succeeded', 'Deleting', - /// 'ProvisioningAccount', 'Updating' - /// Resource tags. - public LinkedService(string id = default(string), string name = default(string), string type = default(string), string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require read access + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require write access + /// + + /// The provisioning state of the linked service. + /// Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + public LinkedService(string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string)) + + : base(id, name, type) { - ResourceId = resourceId; - WriteAccessResourceId = writeAccessResourceId; - ProvisioningState = provisioningState; - Tags = tags; + this.Tags = tags; + this.ResourceId = resourceId; + this.WriteAccessResourceId = writeAccessResourceId; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -65,35 +66,33 @@ public LinkedService() /// partial void CustomInit(); + /// - /// Gets or sets the resource id of the resource that will be linked to - /// the workspace. This should be used for linking resources which - /// require read access + /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "properties.resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets or sets the resource id of the resource that will be linked to - /// the workspace. This should be used for linking resources which - /// require write access + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require read + /// access /// - [JsonProperty(PropertyName = "properties.writeAccessResourceId")] - public string WriteAccessResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceId")] + public string ResourceId {get; set; } /// - /// Gets or sets the provisioning state of the linked service. Possible - /// values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', - /// 'Updating' + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require write + /// access /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.writeAccessResourceId")] + public string WriteAccessResourceId {get; set; } /// - /// Gets or sets resource tags. + /// Gets or sets the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs index b0072a205ebe..f87f71b162a9 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceEntityStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for LinkedServiceEntityStatus. /// + + public static class LinkedServiceEntityStatus { public const string Succeeded = "Succeeded"; @@ -21,4 +18,4 @@ public static class LinkedServiceEntityStatus public const string ProvisioningAccount = "ProvisioningAccount"; public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs new file mode 100644 index 000000000000..6a70db7b277b --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedServiceProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Linked service properties. + /// + public partial class LinkedServiceProperties + { + /// + /// Initializes a new instance of the LinkedServiceProperties class. + /// + public LinkedServiceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedServiceProperties class. + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require read access + /// + + /// The resource id of the resource that will be linked to the workspace. This + /// should be used for linking resources which require write access + /// + + /// The provisioning state of the linked service. + /// Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + /// 'Updating' + public LinkedServiceProperties(string resourceId = default(string), string writeAccessResourceId = default(string), string provisioningState = default(string)) + + { + this.ResourceId = resourceId; + this.WriteAccessResourceId = writeAccessResourceId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require read + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets the resource id of the resource that will be linked to the + /// workspace. This should be used for linking resources which require write + /// access + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "writeAccessResourceId")] + public string WriteAccessResourceId {get; set; } + + /// + /// Gets or sets the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs new file mode 100644 index 000000000000..8ae13c59d6af --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsProperties.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Linked storage accounts properties. + /// + public partial class LinkedStorageAccountsProperties + { + /// + /// Initializes a new instance of the LinkedStorageAccountsProperties class. + /// + public LinkedStorageAccountsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkedStorageAccountsProperties class. + /// + + /// Linked storage accounts type. + /// Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + + /// Linked storage accounts resources ids. + /// + public LinkedStorageAccountsProperties(DataSourceType? dataSourceType = default(DataSourceType?), System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + + { + this.DataSourceType = dataSourceType; + this.StorageAccountIds = storageAccountIds; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataSourceType")] + public DataSourceType? DataSourceType {get; private set; } + + /// + /// Gets or sets linked storage accounts resources ids. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountIds")] + public System.Collections.Generic.IList StorageAccountIds {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs index 9ea1f0c6c731..2e0f6536a075 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/LinkedStorageAccountsResource.cs @@ -1,31 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Linked storage accounts top level resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class LinkedStorageAccountsResource : ProxyResource { /// - /// Initializes a new instance of the LinkedStorageAccountsResource - /// class. + /// Initializes a new instance of the LinkedStorageAccountsResource class. /// public LinkedStorageAccountsResource() { @@ -33,25 +22,31 @@ public LinkedStorageAccountsResource() } /// - /// Initializes a new instance of the LinkedStorageAccountsResource - /// class. + /// Initializes a new instance of the LinkedStorageAccountsResource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Linked storage accounts type. Possible - /// values include: 'CustomLogs', 'AzureWatson', 'Query', - /// 'Alerts' - /// Linked storage accounts resources - /// ids. - public LinkedStorageAccountsResource(string id = default(string), string name = default(string), string type = default(string), DataSourceType? dataSourceType = default(DataSourceType?), IList storageAccountIds = default(IList)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Linked storage accounts type. + /// Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + + /// Linked storage accounts resources ids. + /// + public LinkedStorageAccountsResource(string id = default(string), string name = default(string), string type = default(string), DataSourceType? dataSourceType = default(DataSourceType?), System.Collections.Generic.IList storageAccountIds = default(System.Collections.Generic.IList)) + + : base(id, name, type) { - DataSourceType = dataSourceType; - StorageAccountIds = storageAccountIds; + this.DataSourceType = dataSourceType; + this.StorageAccountIds = storageAccountIds; CustomInit(); } @@ -60,18 +55,17 @@ public LinkedStorageAccountsResource() /// partial void CustomInit(); + /// - /// Gets linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' + /// Gets linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// - [JsonProperty(PropertyName = "properties.dataSourceType")] - public DataSourceType? DataSourceType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataSourceType")] + public DataSourceType? DataSourceType {get; private set; } /// /// Gets or sets linked storage accounts resources ids. /// - [JsonProperty(PropertyName = "properties.storageAccountIds")] - public IList StorageAccountIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountIds")] + public System.Collections.Generic.IList StorageAccountIds {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs index a99a5f036cf0..2d46399f8d18 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroup.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// A management group that is connected to a workspace /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class ManagementGroup { /// @@ -32,30 +24,41 @@ public ManagementGroup() /// /// Initializes a new instance of the ManagementGroup class. /// - /// The number of servers connected to the - /// management group. - /// Gets or sets a value indicating whether the - /// management group is a gateway. - /// The name of the management group. - /// The unique ID of the management group. - /// The datetime that the management group was - /// created. - /// The last datetime that the management - /// group received data. - /// The version of System Center that is managing - /// the management group. - /// The SKU of System Center that is managing the - /// management group. + + /// The number of servers connected to the management group. + /// + + /// Gets or sets a value indicating whether the management group is a gateway. + /// + + /// The name of the management group. + /// + + /// The unique ID of the management group. + /// + + /// The datetime that the management group was created. + /// + + /// The last datetime that the management group received data. + /// + + /// The version of System Center that is managing the management group. + /// + + /// The SKU of System Center that is managing the management group. + /// public ManagementGroup(int? serverCount = default(int?), bool? isGateway = default(bool?), string name = default(string), string id = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? dataReceived = default(System.DateTime?), string version = default(string), string sku = default(string)) + { - ServerCount = serverCount; - IsGateway = isGateway; - Name = name; - Id = id; - Created = created; - DataReceived = dataReceived; - Version = version; - Sku = sku; + this.ServerCount = serverCount; + this.IsGateway = isGateway; + this.Name = name; + this.Id = id; + this.Created = created; + this.DataReceived = dataReceived; + this.Version = version; + this.Sku = sku; CustomInit(); } @@ -64,58 +67,56 @@ public ManagementGroup() /// partial void CustomInit(); + /// - /// Gets or sets the number of servers connected to the management - /// group. + /// Gets or sets the number of servers connected to the management group. /// - [JsonProperty(PropertyName = "properties.serverCount")] - public int? ServerCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serverCount")] + public int? ServerCount {get; set; } /// - /// Gets or sets a value indicating whether the management group is a - /// gateway. + /// Gets or sets gets or sets a value indicating whether the management group + /// is a gateway. /// - [JsonProperty(PropertyName = "properties.isGateway")] - public bool? IsGateway { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isGateway")] + public bool? IsGateway {get; set; } /// /// Gets or sets the name of the management group. /// - [JsonProperty(PropertyName = "properties.name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string Name {get; set; } /// /// Gets or sets the unique ID of the management group. /// - [JsonProperty(PropertyName = "properties.id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.id")] + public string Id {get; set; } /// /// Gets or sets the datetime that the management group was created. /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.created")] + public System.DateTime? Created {get; set; } /// - /// Gets or sets the last datetime that the management group received - /// data. + /// Gets or sets the last datetime that the management group received data. /// - [JsonProperty(PropertyName = "properties.dataReceived")] - public System.DateTime? DataReceived { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.dataReceived")] + public System.DateTime? DataReceived {get; set; } /// - /// Gets or sets the version of System Center that is managing the - /// management group. + /// Gets or sets the version of System Center that is managing the management + /// group. /// - [JsonProperty(PropertyName = "properties.version")] - public string Version { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.version")] + public string Version {get; set; } /// - /// Gets or sets the SKU of System Center that is managing the - /// management group. + /// Gets or sets the SKU of System Center that is managing the management + /// group. /// - [JsonProperty(PropertyName = "properties.sku")] - public string Sku { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public string Sku {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs new file mode 100644 index 000000000000..f75a4bdb1102 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ManagementGroupProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Management group properties. + /// + public partial class ManagementGroupProperties + { + /// + /// Initializes a new instance of the ManagementGroupProperties class. + /// + public ManagementGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagementGroupProperties class. + /// + + /// The number of servers connected to the management group. + /// + + /// Gets or sets a value indicating whether the management group is a gateway. + /// + + /// The name of the management group. + /// + + /// The unique ID of the management group. + /// + + /// The datetime that the management group was created. + /// + + /// The last datetime that the management group received data. + /// + + /// The version of System Center that is managing the management group. + /// + + /// The SKU of System Center that is managing the management group. + /// + public ManagementGroupProperties(int? serverCount = default(int?), bool? isGateway = default(bool?), string name = default(string), string id = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? dataReceived = default(System.DateTime?), string version = default(string), string sku = default(string)) + + { + this.ServerCount = serverCount; + this.IsGateway = isGateway; + this.Name = name; + this.Id = id; + this.Created = created; + this.DataReceived = dataReceived; + this.Version = version; + this.Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the number of servers connected to the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serverCount")] + public int? ServerCount {get; set; } + + /// + /// Gets or sets gets or sets a value indicating whether the management group + /// is a gateway. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isGateway")] + public bool? IsGateway {get; set; } + + /// + /// Gets or sets the name of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } + + /// + /// Gets or sets the unique ID of the management group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets the datetime that the management group was created. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "created")] + public System.DateTime? Created {get; set; } + + /// + /// Gets or sets the last datetime that the management group received data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataReceived")] + public System.DateTime? DataReceived {get; set; } + + /// + /// Gets or sets the version of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public string Version {get; set; } + + /// + /// Gets or sets the SKU of System Center that is managing the management + /// group. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public string Sku {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs index bdea65678730..ce0e0c5d7b3f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/MetricName.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,17 @@ public MetricName() /// /// Initializes a new instance of the MetricName class. /// - /// The system name of the metric. - /// The localized name of the - /// metric. + + /// The system name of the metric. + /// + + /// The localized name of the metric. + /// public MetricName(string value = default(string), string localizedValue = default(string)) + { - Value = value; - LocalizedValue = localizedValue; + this.Value = value; + this.LocalizedValue = localizedValue; CustomInit(); } @@ -44,17 +42,17 @@ public MetricName() /// partial void CustomInit(); + /// /// Gets or sets the system name of the metric. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Gets or sets the localized name of the metric. /// - [JsonProperty(PropertyName = "localizedValue")] - public string LocalizedValue { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs index a42143ed3968..5b1ed98060ad 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Operation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: - /// {provider}/{resource}/{operation} - /// Display metadata associated with the - /// operation. + + /// Operation name: {provider}/{resource}/{operation} + /// + + /// Display metadata associated with the operation. + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { - Name = name; - Display = display; + this.Name = name; + this.Display = display; CustomInit(); } @@ -45,17 +42,17 @@ public Operation() /// partial void CustomInit(); + /// /// Gets or sets operation name: {provider}/{resource}/{operation} /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets display metadata associated with the operation. /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs index 49f796a52d92..613784171c48 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,25 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: Microsoft - /// OperationsManagement. - /// Resource on which the operation is performed - /// etc. - /// Type of operation: get, read, delete, - /// etc. - /// Description of operation + + /// Service provider: Microsoft OperationsManagement. + /// + + /// Resource on which the operation is performed etc. + /// + + /// Type of operation: get, read, delete, etc. + /// + + /// Description of operation + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -50,29 +50,29 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets or sets service provider: Microsoft OperationsManagement. /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource on which the operation is performed etc. /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets type of operation: get, read, delete, etc. /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets description of operation /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs index 5ece076b7af3..7d75829d8f98 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/OperationStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,21 +23,33 @@ public OperationStatus() /// /// Initializes a new instance of the OperationStatus class. /// - /// The operation Id. - /// The operation name. - /// The start time of the operation. - /// The end time of the operation. - /// The status of the operation. - /// The error detail of the operation if - /// any. + + /// The operation Id. + /// + + /// The operation name. + /// + + /// The start time of the operation. + /// + + /// The end time of the operation. + /// + + /// The status of the operation. + /// + + /// The error detail of the operation if any. + /// public OperationStatus(string id = default(string), string name = default(string), string startTime = default(string), string endTime = default(string), string status = default(string), ErrorResponse error = default(ErrorResponse)) + { - Id = id; - Name = name; - StartTime = startTime; - EndTime = endTime; - Status = status; - Error = error; + this.Id = id; + this.Name = name; + this.StartTime = startTime; + this.EndTime = endTime; + this.Status = status; + this.Error = error; CustomInit(); } @@ -52,41 +58,41 @@ public OperationStatus() /// partial void CustomInit(); + /// /// Gets or sets the operation Id. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the operation name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the start time of the operation. /// - [JsonProperty(PropertyName = "startTime")] - public string StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public string StartTime {get; set; } /// /// Gets or sets the end time of the operation. /// - [JsonProperty(PropertyName = "endTime")] - public string EndTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public string EndTime {get; set; } /// /// Gets or sets the status of the operation. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the error detail of the operation if any. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponse Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs index aaf4ca1c0238..0f7880aa5b96 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs index 4950adfade26..38bc51e55695 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page1.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page1 : IPage + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs index 332e1363540c..9e5cdafb3228 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Page2.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page2 : IPage + [Newtonsoft.Json.JsonObject] + public class Page2 : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("@odata.nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("@odata.nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs index 14bb99ee7083..cdf1d89246d3 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PrivateLinkScopedResource.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public PrivateLinkScopedResource() /// /// Initializes a new instance of the PrivateLinkScopedResource class. /// - /// The full resource Id of the private link - /// scope resource. - /// The private link scope unique - /// Identifier. + + /// The full resource Id of the private link scope resource. + /// + + /// The private link scope unique Identifier. + /// public PrivateLinkScopedResource(string resourceId = default(string), string scopeId = default(string)) + { - ResourceId = resourceId; - ScopeId = scopeId; + this.ResourceId = resourceId; + this.ScopeId = scopeId; CustomInit(); } @@ -45,18 +42,17 @@ public PrivateLinkScopedResource() /// partial void CustomInit(); + /// - /// Gets or sets the full resource Id of the private link scope - /// resource. + /// Gets or sets the full resource Id of the private link scope resource. /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } /// /// Gets or sets the private link scope unique Identifier. /// - [JsonProperty(PropertyName = "scopeId")] - public string ScopeId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "scopeId")] + public string ScopeId {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs index fee961764b03..dfa5473d9c72 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProvisioningStateEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,22 +9,23 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for ProvisioningStateEnum. /// + + public static class ProvisioningStateEnum { /// - /// Table schema is still being built and updated, table is currently - /// locked for any changes till the procedure is done. + /// Table schema is still being built and updated, table is currently locked + /// for any changes till the procedure is done. /// public const string Updating = "Updating"; /// - /// Table schema is stable and without changes, table data is being - /// updated. + /// Table schema is stable and without changes, table data is being updated. /// public const string InProgress = "InProgress"; /// - /// Table state is stable and without changes, table is unlocked and - /// open for new updates. + /// Table state is stable and without changes, table is unlocked and open for + /// new updates. /// public const string Succeeded = "Succeeded"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs index 431122ae6974..c9f805fce090 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ProxyResource.cs @@ -1,23 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { using System.Linq; /// - /// Proxy Resource + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location /// /// - /// The resource model definition for a Azure Resource Manager proxy - /// resource. It will not have tags and a location + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location /// public partial class ProxyResource : Resource { @@ -32,14 +28,20 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + + : base(id, name, type) { CustomInit(); } @@ -50,4 +52,4 @@ public ProxyResource() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs index 7f1409896031..f810253f2ffc 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PublicNetworkAccessType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for PublicNetworkAccessType. /// + + public static class PublicNetworkAccessType { /// @@ -25,4 +22,4 @@ public static class PublicNetworkAccessType /// public const string Disabled = "Disabled"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs index 436d09d56d7f..e799d4edb6ca 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/PurgeState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for PurgeState. /// + + public static class PurgeState { public const string Pending = "pending"; public const string Completed = "completed"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs index da86706ff956..e08a1c9ca372 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Resource.cs @@ -1,28 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// - /// Resource + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources /// /// /// Common fields that are returned in the response for all Azure Resource /// Manager resources /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -35,17 +28,23 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// public Resource(string id = default(string), string name = default(string), string type = default(string)) + { - Id = id; - Name = name; - Type = type; + this.Id = id; + this.Name = name; + this.Type = type; CustomInit(); } @@ -54,26 +53,25 @@ public Resource() /// partial void CustomInit(); + /// /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets the name of the resource /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } /// - /// Gets the type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs index 99ccb6c4208c..1b8c7e33a1a2 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/RestoredLogs.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,21 @@ public RestoredLogs() /// /// Initializes a new instance of the RestoredLogs class. /// - /// The timestamp to start the restore - /// from (UTC). - /// The timestamp to end the restore by - /// (UTC). - /// The table to restore data from. + + /// The timestamp to start the restore from (UTC). + /// + + /// The timestamp to end the restore by (UTC). + /// + + /// The table to restore data from. + /// public RestoredLogs(System.DateTime? startRestoreTime = default(System.DateTime?), System.DateTime? endRestoreTime = default(System.DateTime?), string sourceTable = default(string)) + { - StartRestoreTime = startRestoreTime; - EndRestoreTime = endRestoreTime; - SourceTable = sourceTable; + this.StartRestoreTime = startRestoreTime; + this.EndRestoreTime = endRestoreTime; + this.SourceTable = sourceTable; CustomInit(); } @@ -47,23 +46,23 @@ public RestoredLogs() /// partial void CustomInit(); + /// /// Gets or sets the timestamp to start the restore from (UTC). /// - [JsonProperty(PropertyName = "startRestoreTime")] - public System.DateTime? StartRestoreTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startRestoreTime")] + public System.DateTime? StartRestoreTime {get; set; } /// /// Gets or sets the timestamp to end the restore by (UTC). /// - [JsonProperty(PropertyName = "endRestoreTime")] - public System.DateTime? EndRestoreTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endRestoreTime")] + public System.DateTime? EndRestoreTime {get; set; } /// /// Gets or sets the table to restore data from. /// - [JsonProperty(PropertyName = "sourceTable")] - public string SourceTable { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceTable")] + public string SourceTable {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs index b898ec847176..c6fc2474b8ad 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/ResultStatistics.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public ResultStatistics() /// /// Initializes a new instance of the ResultStatistics class. /// - /// Search job completion percentage. - /// The number of rows that were returned - /// by the search job. + + /// Search job completion percentage. + /// + + /// The number of rows that were returned by the search job. + /// public ResultStatistics(double? progress = default(double?), int? ingestedRecords = default(int?)) + { - Progress = progress; - IngestedRecords = ingestedRecords; + this.Progress = progress; + this.IngestedRecords = ingestedRecords; CustomInit(); } @@ -45,33 +42,33 @@ public ResultStatistics() /// partial void CustomInit(); + /// /// Gets search job completion percentage. /// - [JsonProperty(PropertyName = "progress")] - public double? Progress { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "progress")] + public double? Progress {get; private set; } /// /// Gets the number of rows that were returned by the search job. /// - [JsonProperty(PropertyName = "ingestedRecords")] - public int? IngestedRecords { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ingestedRecords")] + public int? IngestedRecords {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Progress != null) + if (this.Progress != null) { - if (Progress % 0.01 != 0) + if (this.Progress % 0.01 != 0) { - throw new ValidationException(ValidationRules.MultipleOf, "Progress", 0.01); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MultipleOf, "Progress", 0.01); } } } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs index d5d016e94186..038aa8370924 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearch.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Value object for saved search results. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SavedSearch : ProxyResource { /// @@ -34,41 +24,60 @@ public SavedSearch() /// /// Initializes a new instance of the SavedSearch class. /// - /// The category of the saved search. This helps - /// the user to find a saved search faster. - /// Saved search display name. - /// The query expression for the saved - /// search. + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// The ETag of the saved search. To override an - /// existing saved search, use "*" or specify the current Etag - /// The function alias if query serves as a - /// function. - /// The optional function parameters - /// if query serves as a function. Value should be in the following - /// format: 'param-name1:type1 = default_value1, param-name2:type2 = - /// default_value2'. For more examples and proper syntax please refer - /// to - /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. - /// The version number of the query language. The - /// current version is 2 and is the default. - /// The tags attached to the saved search. - public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), IList tags = default(IList)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The ETag of the saved search. To override an existing saved search, use "*" + /// or specify the current Etag + /// + + /// The category of the saved search. This helps the user to find a saved + /// search faster. + /// + + /// Saved search display name. + /// + + /// The query expression for the saved search. + /// + + /// The function alias if query serves as a function. + /// + + /// The optional function parameters if query serves as a function. Value + /// should be in the following format: 'param-name1:type1 = default_value1, + /// param-name2:type2 = default_value2'. For more examples and proper syntax + /// please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + + /// The version number of the query language. The current version is 2 and is + /// the default. + /// + + /// The tags attached to the saved search. + /// + public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), System.Collections.Generic.IList tags = default(System.Collections.Generic.IList)) + + : base(id, name, type) { - Etag = etag; - Category = category; - DisplayName = displayName; - Query = query; - FunctionAlias = functionAlias; - FunctionParameters = functionParameters; - Version = version; - Tags = tags; + this.Etag = etag; + this.Category = category; + this.DisplayName = displayName; + this.Query = query; + this.FunctionAlias = functionAlias; + this.FunctionParameters = functionParameters; + this.Version = version; + this.Tags = tags; CustomInit(); } @@ -77,85 +86,90 @@ public SavedSearch() /// partial void CustomInit(); + /// - /// Gets or sets the ETag of the saved search. To override an existing - /// saved search, use "*" or specify the current Etag + /// Gets or sets the ETag of the saved search. To override an existing saved + /// search, use "*" or specify the current Etag /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] + public string Etag {get; set; } /// - /// Gets or sets the category of the saved search. This helps the user - /// to find a saved search faster. + /// Gets or sets the category of the saved search. This helps the user to find + /// a saved search faster. /// - [JsonProperty(PropertyName = "properties.category")] - public string Category { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.category")] + public string Category {get; set; } /// /// Gets or sets saved search display name. /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName {get; set; } /// /// Gets or sets the query expression for the saved search. /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.query")] + public string Query {get; set; } /// /// Gets or sets the function alias if query serves as a function. /// - [JsonProperty(PropertyName = "properties.functionAlias")] - public string FunctionAlias { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.functionAlias")] + public string FunctionAlias {get; set; } /// /// Gets or sets the optional function parameters if query serves as a - /// function. Value should be in the following format: - /// 'param-name1:type1 = default_value1, param-name2:type2 = - /// default_value2'. For more examples and proper syntax please refer - /// to + /// function. Value should be in the following format: 'param-name1:type1 = + /// default_value1, param-name2:type2 = default_value2'. For more examples and + /// proper syntax please refer to /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. /// - [JsonProperty(PropertyName = "properties.functionParameters")] - public string FunctionParameters { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.functionParameters")] + public string FunctionParameters {get; set; } /// - /// Gets or sets the version number of the query language. The current - /// version is 2 and is the default. + /// Gets or sets the version number of the query language. The current version + /// is 2 and is the default. /// - [JsonProperty(PropertyName = "properties.version")] - public long? Version { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.version")] + public long? Version {get; set; } /// /// Gets or sets the tags attached to the saved search. /// - [JsonProperty(PropertyName = "properties.tags")] - public IList Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tags")] + public System.Collections.Generic.IList Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Category == null) + if (this.Category == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Category"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Category"); } - if (DisplayName == null) + if (this.DisplayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DisplayName"); } - if (Query == null) + if (this.Query == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Query"); } - if (Tags != null) + + + + + + + if (this.Tags != null) { - foreach (var element in Tags) + foreach (var element in this.Tags) { if (element != null) { @@ -165,4 +179,4 @@ public virtual void Validate() } } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs new file mode 100644 index 000000000000..18c8eb876ee5 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchProperties.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Value object for saved search results. + /// + public partial class SavedSearchProperties + { + /// + /// Initializes a new instance of the SavedSearchProperties class. + /// + public SavedSearchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SavedSearchProperties class. + /// + + /// The category of the saved search. This helps the user to find a saved + /// search faster. + /// + + /// Saved search display name. + /// + + /// The query expression for the saved search. + /// + + /// The function alias if query serves as a function. + /// + + /// The optional function parameters if query serves as a function. Value + /// should be in the following format: 'param-name1:type1 = default_value1, + /// param-name2:type2 = default_value2'. For more examples and proper syntax + /// please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + + /// The version number of the query language. The current version is 2 and is + /// the default. + /// + + /// The tags attached to the saved search. + /// + public SavedSearchProperties(string category, string displayName, string query, string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), System.Collections.Generic.IList tags = default(System.Collections.Generic.IList)) + + { + this.Category = category; + this.DisplayName = displayName; + this.Query = query; + this.FunctionAlias = functionAlias; + this.FunctionParameters = functionParameters; + this.Version = version; + this.Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the category of the saved search. This helps the user to find + /// a saved search faster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public string Category {get; set; } + + /// + /// Gets or sets saved search display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } + + /// + /// Gets or sets the query expression for the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "query")] + public string Query {get; set; } + + /// + /// Gets or sets the function alias if query serves as a function. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "functionAlias")] + public string FunctionAlias {get; set; } + + /// + /// Gets or sets the optional function parameters if query serves as a + /// function. Value should be in the following format: 'param-name1:type1 = + /// default_value1, param-name2:type2 = default_value2'. For more examples and + /// proper syntax please refer to + /// https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "functionParameters")] + public string FunctionParameters {get; set; } + + /// + /// Gets or sets the version number of the query language. The current version + /// is 2 and is the default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public long? Version {get; set; } + + /// + /// Gets or sets the tags attached to the saved search. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IList Tags {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Category == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Category"); + } + if (this.DisplayName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DisplayName"); + } + if (this.Query == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Query"); + } + + + + + + if (this.Tags != null) + { + foreach (var element in this.Tags) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs index 7723eaf9b783..e3f05076a02c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SavedSearchesListResult.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,10 +23,13 @@ public SavedSearchesListResult() /// /// Initializes a new instance of the SavedSearchesListResult class. /// - /// The array of result values. - public SavedSearchesListResult(IList value = default(IList)) + + /// The array of result values. + /// + public SavedSearchesListResult(System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Value = value; + this.Value = value; CustomInit(); } @@ -43,11 +38,11 @@ public SavedSearchesListResult() /// partial void CustomInit(); + /// /// Gets or sets the array of result values. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs index b5e09561fbbb..f2a31da9cecc 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Schema.cs @@ -1,22 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Table's schema. + /// Table's schema. /// public partial class Schema { @@ -31,43 +23,63 @@ public Schema() /// /// Initializes a new instance of the Schema class. /// - /// Table name. - /// Table display name. - /// Table description. - /// A list of table custom columns. - /// A list of table standard - /// columns. - /// Table category. - /// Table labels. - /// Table's creator. Possible values include: - /// 'microsoft', 'customer' - /// Table's creator. Possible values include: - /// 'Microsoft', 'CustomLog', 'RestoredLogs', 'SearchResults' - /// The subtype describes what APIs can be - /// used to interact with the table, and what features are available - /// against it. Possible values include: 'Any', 'Classic', - /// 'DataCollectionRuleBased' - /// List of solutions the table is affiliated - /// with - /// Parameters of the search job that - /// initiated this table. - /// Parameters of the restore operation that - /// initiated this table. - public Schema(string name = default(string), string displayName = default(string), string description = default(string), IList columns = default(IList), IList standardColumns = default(IList), IList categories = default(IList), IList labels = default(IList), string source = default(string), string tableType = default(string), string tableSubType = default(string), IList solutions = default(IList), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs)) + + /// Table name. + /// + + /// Table display name. + /// + + /// Table description. + /// + + /// A list of table custom columns. + /// + + /// A list of table standard columns. + /// + + /// Table category. + /// + + /// Table labels. + /// + + /// Table's creator. + /// Possible values include: 'microsoft', 'customer' + + /// Table's creator. + /// Possible values include: 'Microsoft', 'CustomLog', 'RestoredLogs', + /// 'SearchResults' + + /// The subtype describes what APIs can be used to interact with the table, and + /// what features are available against it. + /// Possible values include: 'Any', 'Classic', 'DataCollectionRuleBased' + + /// List of solutions the table is affiliated with + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + public Schema(string name = default(string), string displayName = default(string), string description = default(string), System.Collections.Generic.IList columns = default(System.Collections.Generic.IList), System.Collections.Generic.IList standardColumns = default(System.Collections.Generic.IList), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), System.Collections.Generic.IList labels = default(System.Collections.Generic.IList), string source = default(string), string tableType = default(string), string tableSubType = default(string), System.Collections.Generic.IList solutions = default(System.Collections.Generic.IList), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs)) + { - Name = name; - DisplayName = displayName; - Description = description; - Columns = columns; - StandardColumns = standardColumns; - Categories = categories; - Labels = labels; - Source = source; - TableType = tableType; - TableSubType = tableSubType; - Solutions = solutions; - SearchResults = searchResults; - RestoredLogs = restoredLogs; + this.Name = name; + this.DisplayName = displayName; + this.Description = description; + this.Columns = columns; + this.StandardColumns = standardColumns; + this.Categories = categories; + this.Labels = labels; + this.Source = source; + this.TableType = tableType; + this.TableSubType = tableSubType; + this.Solutions = solutions; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; CustomInit(); } @@ -76,87 +88,84 @@ public Schema() /// partial void CustomInit(); + /// /// Gets or sets table name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets table display name. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets table description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Gets or sets a list of table custom columns. /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "columns")] + public System.Collections.Generic.IList Columns {get; set; } /// /// Gets a list of table standard columns. /// - [JsonProperty(PropertyName = "standardColumns")] - public IList StandardColumns { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "standardColumns")] + public System.Collections.Generic.IList StandardColumns {get; private set; } /// /// Gets table category. /// - [JsonProperty(PropertyName = "categories")] - public IList Categories { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "categories")] + public System.Collections.Generic.IList Categories {get; private set; } /// /// Gets table labels. /// - [JsonProperty(PropertyName = "labels")] - public IList Labels { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "labels")] + public System.Collections.Generic.IList Labels {get; private set; } /// - /// Gets table's creator. Possible values include: 'microsoft', - /// 'customer' + /// Gets table's creator. Possible values include: 'microsoft', 'customer' /// - [JsonProperty(PropertyName = "source")] - public string Source { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "source")] + public string Source {get; private set; } /// - /// Gets table's creator. Possible values include: 'Microsoft', - /// 'CustomLog', 'RestoredLogs', 'SearchResults' + /// Gets table's creator. Possible values include: 'Microsoft', 'CustomLog', 'RestoredLogs', 'SearchResults' /// - [JsonProperty(PropertyName = "tableType")] - public string TableType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tableType")] + public string TableType {get; private set; } /// - /// Gets the subtype describes what APIs can be used to interact with - /// the table, and what features are available against it. Possible - /// values include: 'Any', 'Classic', 'DataCollectionRuleBased' + /// Gets the subtype describes what APIs can be used to interact with the + /// table, and what features are available against it. Possible values include: 'Any', 'Classic', 'DataCollectionRuleBased' /// - [JsonProperty(PropertyName = "tableSubType")] - public string TableSubType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tableSubType")] + public string TableSubType {get; private set; } /// /// Gets list of solutions the table is affiliated with /// - [JsonProperty(PropertyName = "solutions")] - public IList Solutions { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "solutions")] + public System.Collections.Generic.IList Solutions {get; private set; } /// /// Gets parameters of the search job that initiated this table. /// - [JsonProperty(PropertyName = "searchResults")] - public SearchResults SearchResults { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults {get; private set; } /// /// Gets parameters of the restore operation that initiated this table. /// - [JsonProperty(PropertyName = "restoredLogs")] - public RestoredLogs RestoredLogs { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs index 7ab25942d305..480c5fbbd51e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchGetSchemaResponse.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,12 +23,17 @@ public SearchGetSchemaResponse() /// /// Initializes a new instance of the SearchGetSchemaResponse class. /// - /// The metadata from search results. - /// The array of result values. - public SearchGetSchemaResponse(SearchMetadata metadata = default(SearchMetadata), IList value = default(IList)) + + /// The metadata from search results. + /// + + /// The array of result values. + /// + public SearchGetSchemaResponse(SearchMetadata metadata = default(SearchMetadata), System.Collections.Generic.IList value = default(System.Collections.Generic.IList)) + { - Metadata = metadata; - Value = value; + this.Metadata = metadata; + this.Value = value; CustomInit(); } @@ -45,17 +42,17 @@ public SearchGetSchemaResponse() /// partial void CustomInit(); + /// /// Gets or sets the metadata from search results. /// - [JsonProperty(PropertyName = "metadata")] - public SearchMetadata Metadata { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "metadata")] + public SearchMetadata Metadata {get; set; } /// /// Gets or sets the array of result values. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs index 94753bf45639..dd09163a70c8 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadata.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,46 +23,77 @@ public SearchMetadata() /// /// Initializes a new instance of the SearchMetadata class. /// - /// The request id of the search. - /// The search result type. - /// The total number of search results. - /// The number of top search results. - /// The id of the search results request. - /// The core summaries. - /// The status of the search results. - /// The start time for the search. - /// The time of last update. - /// The ETag of the search results. - /// How the results are sorted. - /// The request time. - /// The aggregated value - /// field. - /// The aggregated grouping - /// fields. - /// The sum of all aggregates returned in the result - /// set. - /// The max of all aggregates returned in the result - /// set. - /// The schema. - public SearchMetadata(string searchId = default(string), string resultType = default(string), long? total = default(long?), long? top = default(long?), string id = default(string), IList coreSummaries = default(IList), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastUpdated = default(System.DateTime?), string eTag = default(string), IList sort = default(IList), long? requestTime = default(long?), string aggregatedValueField = default(string), string aggregatedGroupingFields = default(string), long? sum = default(long?), long? max = default(long?), SearchMetadataSchema schema = default(SearchMetadataSchema)) + + /// The request id of the search. + /// + + /// The search result type. + /// + + /// The total number of search results. + /// + + /// The number of top search results. + /// + + /// The id of the search results request. + /// + + /// The core summaries. + /// + + /// The status of the search results. + /// + + /// The start time for the search. + /// + + /// The time of last update. + /// + + /// The ETag of the search results. + /// + + /// How the results are sorted. + /// + + /// The request time. + /// + + /// The aggregated value field. + /// + + /// The aggregated grouping fields. + /// + + /// The sum of all aggregates returned in the result set. + /// + + /// The max of all aggregates returned in the result set. + /// + + /// The schema. + /// + public SearchMetadata(string searchId = default(string), string resultType = default(string), long? total = default(long?), long? top = default(long?), string id = default(string), System.Collections.Generic.IList coreSummaries = default(System.Collections.Generic.IList), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? lastUpdated = default(System.DateTime?), string eTag = default(string), System.Collections.Generic.IList sort = default(System.Collections.Generic.IList), long? requestTime = default(long?), string aggregatedValueField = default(string), string aggregatedGroupingFields = default(string), long? sum = default(long?), long? max = default(long?), SearchMetadataSchema schema = default(SearchMetadataSchema)) + { - SearchId = searchId; - ResultType = resultType; - Total = total; - Top = top; - Id = id; - CoreSummaries = coreSummaries; - Status = status; - StartTime = startTime; - LastUpdated = lastUpdated; - ETag = eTag; - Sort = sort; - RequestTime = requestTime; - AggregatedValueField = aggregatedValueField; - AggregatedGroupingFields = aggregatedGroupingFields; - Sum = sum; - Max = max; - Schema = schema; + this.SearchId = searchId; + this.ResultType = resultType; + this.Total = total; + this.Top = top; + this.Id = id; + this.CoreSummaries = coreSummaries; + this.Status = status; + this.StartTime = startTime; + this.LastUpdated = lastUpdated; + this.ETag = eTag; + this.Sort = sort; + this.RequestTime = requestTime; + this.AggregatedValueField = aggregatedValueField; + this.AggregatedGroupingFields = aggregatedGroupingFields; + this.Sum = sum; + this.Max = max; + this.Schema = schema; CustomInit(); } @@ -79,107 +102,107 @@ public SearchMetadata() /// partial void CustomInit(); + /// /// Gets or sets the request id of the search. /// - [JsonProperty(PropertyName = "requestId")] - public string SearchId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestId")] + public string SearchId {get; set; } /// /// Gets or sets the search result type. /// - [JsonProperty(PropertyName = "resultType")] - public string ResultType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resultType")] + public string ResultType {get; set; } /// /// Gets or sets the total number of search results. /// - [JsonProperty(PropertyName = "total")] - public long? Total { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "total")] + public long? Total {get; set; } /// /// Gets or sets the number of top search results. /// - [JsonProperty(PropertyName = "top")] - public long? Top { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "top")] + public long? Top {get; set; } /// /// Gets or sets the id of the search results request. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the core summaries. /// - [JsonProperty(PropertyName = "coreSummaries")] - public IList CoreSummaries { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "coreSummaries")] + public System.Collections.Generic.IList CoreSummaries {get; set; } /// /// Gets or sets the status of the search results. /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Gets or sets the start time for the search. /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime {get; set; } /// /// Gets or sets the time of last update. /// - [JsonProperty(PropertyName = "lastUpdated")] - public System.DateTime? LastUpdated { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdated")] + public System.DateTime? LastUpdated {get; set; } /// /// Gets or sets the ETag of the search results. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } /// /// Gets or sets how the results are sorted. /// - [JsonProperty(PropertyName = "sort")] - public IList Sort { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sort")] + public System.Collections.Generic.IList Sort {get; set; } /// /// Gets or sets the request time. /// - [JsonProperty(PropertyName = "requestTime")] - public long? RequestTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "requestTime")] + public long? RequestTime {get; set; } /// /// Gets or sets the aggregated value field. /// - [JsonProperty(PropertyName = "aggregatedValueField")] - public string AggregatedValueField { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedValueField")] + public string AggregatedValueField {get; set; } /// /// Gets or sets the aggregated grouping fields. /// - [JsonProperty(PropertyName = "aggregatedGroupingFields")] - public string AggregatedGroupingFields { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregatedGroupingFields")] + public string AggregatedGroupingFields {get; set; } /// /// Gets or sets the sum of all aggregates returned in the result set. /// - [JsonProperty(PropertyName = "sum")] - public long? Sum { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sum")] + public long? Sum {get; set; } /// /// Gets or sets the max of all aggregates returned in the result set. /// - [JsonProperty(PropertyName = "max")] - public long? Max { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "max")] + public long? Max {get; set; } /// /// Gets or sets the schema. /// - [JsonProperty(PropertyName = "schema")] - public SearchMetadataSchema Schema { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "schema")] + public SearchMetadataSchema Schema {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs index f22e7f8ad3a5..45f84fb7e088 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchMetadataSchema.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public SearchMetadataSchema() /// /// Initializes a new instance of the SearchMetadataSchema class. /// - /// The name of the metadata schema. - /// The version of the metadata schema. + + /// The name of the metadata schema. + /// + + /// The version of the metadata schema. + /// public SearchMetadataSchema(string name = default(string), int? version = default(int?)) + { - Name = name; - Version = version; + this.Name = name; + this.Version = version; CustomInit(); } @@ -43,17 +42,17 @@ public SearchMetadataSchema() /// partial void CustomInit(); + /// /// Gets or sets the name of the metadata schema. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the version of the metadata schema. /// - [JsonProperty(PropertyName = "version")] - public int? Version { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "version")] + public int? Version {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs index 8675e189c120..5c8309723271 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchResults.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,23 +23,33 @@ public SearchResults() /// /// Initializes a new instance of the SearchResults class. /// - /// Search job query. - /// Search job Description. - /// Limit the search job to return up to specified - /// number of rows. - /// The timestamp to start the search - /// from (UTC) - /// The timestamp to end the search by - /// (UTC) - /// The table used in the search job. + + /// Search job query. + /// + + /// Search job Description. + /// + + /// Limit the search job to return up to specified number of rows. + /// + + /// The timestamp to start the search from (UTC) + /// + + /// The timestamp to end the search by (UTC) + /// + + /// The table used in the search job. + /// public SearchResults(string query = default(string), string description = default(string), int? limit = default(int?), System.DateTime? startSearchTime = default(System.DateTime?), System.DateTime? endSearchTime = default(System.DateTime?), string sourceTable = default(string)) + { - Query = query; - Description = description; - Limit = limit; - StartSearchTime = startSearchTime; - EndSearchTime = endSearchTime; - SourceTable = sourceTable; + this.Query = query; + this.Description = description; + this.Limit = limit; + this.StartSearchTime = startSearchTime; + this.EndSearchTime = endSearchTime; + this.SourceTable = sourceTable; CustomInit(); } @@ -54,42 +58,41 @@ public SearchResults() /// partial void CustomInit(); + /// /// Gets or sets search job query. /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "query")] + public string Query {get; set; } /// /// Gets or sets search job Description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets limit the search job to return up to specified number - /// of rows. + /// Gets or sets limit the search job to return up to specified number of rows. /// - [JsonProperty(PropertyName = "limit")] - public int? Limit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public int? Limit {get; set; } /// /// Gets or sets the timestamp to start the search from (UTC) /// - [JsonProperty(PropertyName = "startSearchTime")] - public System.DateTime? StartSearchTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startSearchTime")] + public System.DateTime? StartSearchTime {get; set; } /// /// Gets or sets the timestamp to end the search by (UTC) /// - [JsonProperty(PropertyName = "endSearchTime")] - public System.DateTime? EndSearchTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "endSearchTime")] + public System.DateTime? EndSearchTime {get; set; } /// /// Gets the table used in the search job. /// - [JsonProperty(PropertyName = "sourceTable")] - public string SourceTable { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceTable")] + public string SourceTable {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs index a799f47d0fa4..484e343a9b88 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSchemaValue.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,26 +23,37 @@ public SearchSchemaValue() /// /// Initializes a new instance of the SearchSchemaValue class. /// - /// The boolean that indicates the field is - /// searchable as free text. - /// The boolean that indicates whether or not the - /// field is stored. - /// The boolean that indicates whether or not the - /// field is a facet. - /// The name of the schema. - /// The display name of the schema. - /// The type. - /// The array of workflows containing the - /// field. - public SearchSchemaValue(bool indexed, bool stored, bool facet, string name = default(string), string displayName = default(string), string type = default(string), IList ownerType = default(IList)) + + /// The name of the schema. + /// + + /// The display name of the schema. + /// + + /// The type. + /// + + /// The boolean that indicates the field is searchable as free text. + /// + + /// The boolean that indicates whether or not the field is stored. + /// + + /// The boolean that indicates whether or not the field is a facet. + /// + + /// The array of workflows containing the field. + /// + public SearchSchemaValue(bool indexed, bool stored, bool facet, string name = default(string), string displayName = default(string), string type = default(string), System.Collections.Generic.IList ownerType = default(System.Collections.Generic.IList)) + { - Name = name; - DisplayName = displayName; - Type = type; - Indexed = indexed; - Stored = stored; - Facet = facet; - OwnerType = ownerType; + this.Name = name; + this.DisplayName = displayName; + this.Type = type; + this.Indexed = indexed; + this.Stored = stored; + this.Facet = facet; + this.OwnerType = ownerType; CustomInit(); } @@ -59,59 +62,62 @@ public SearchSchemaValue() /// partial void CustomInit(); + /// /// Gets or sets the name of the schema. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the display name of the schema. /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } /// /// Gets or sets the type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; set; } /// - /// Gets or sets the boolean that indicates the field is searchable as - /// free text. + /// Gets or sets the boolean that indicates the field is searchable as free + /// text. /// - [JsonProperty(PropertyName = "indexed")] - public bool Indexed { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "indexed")] + public bool Indexed {get; set; } /// - /// Gets or sets the boolean that indicates whether or not the field is - /// stored. + /// Gets or sets the boolean that indicates whether or not the field is stored. /// - [JsonProperty(PropertyName = "stored")] - public bool Stored { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "stored")] + public bool Stored {get; set; } /// - /// Gets or sets the boolean that indicates whether or not the field is - /// a facet. + /// Gets or sets the boolean that indicates whether or not the field is a + /// facet. /// - [JsonProperty(PropertyName = "facet")] - public bool Facet { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "facet")] + public bool Facet {get; set; } /// /// Gets or sets the array of workflows containing the field. /// - [JsonProperty(PropertyName = "ownerType")] - public IList OwnerType { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "ownerType")] + public System.Collections.Generic.IList OwnerType {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs index 8a41638d2b7b..eb189a435d5a 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSort.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public SearchSort() /// /// Initializes a new instance of the SearchSort class. /// - /// The name of the field the search query is sorted - /// on. - /// The sort order of the search. Possible values - /// include: 'asc', 'desc' + + /// The name of the field the search query is sorted on. + /// + + /// The sort order of the search. + /// Possible values include: 'asc', 'desc' public SearchSort(string name = default(string), string order = default(string)) + { - Name = name; - Order = order; + this.Name = name; + this.Order = order; CustomInit(); } @@ -45,18 +42,17 @@ public SearchSort() /// partial void CustomInit(); + /// /// Gets or sets the name of the field the search query is sorted on. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the sort order of the search. Possible values include: - /// 'asc', 'desc' + /// Gets or sets the sort order of the search. Possible values include: 'asc', 'desc' /// - [JsonProperty(PropertyName = "order")] - public string Order { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "order")] + public string Order {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs index 0a681c0d75a7..3392d120be53 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SearchSortEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for SearchSortEnum. /// + + public static class SearchSortEnum { public const string Asc = "asc"; public const string Desc = "desc"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs index 089d88abde3b..7c8da31381ff 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SharedKeys.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public SharedKeys() /// /// Initializes a new instance of the SharedKeys class. /// - /// The primary shared key of a - /// workspace. - /// The secondary shared key of a - /// workspace. + + /// The primary shared key of a workspace. + /// + + /// The secondary shared key of a workspace. + /// public SharedKeys(string primarySharedKey = default(string), string secondarySharedKey = default(string)) + { - PrimarySharedKey = primarySharedKey; - SecondarySharedKey = secondarySharedKey; + this.PrimarySharedKey = primarySharedKey; + this.SecondarySharedKey = secondarySharedKey; CustomInit(); } @@ -45,17 +42,17 @@ public SharedKeys() /// partial void CustomInit(); + /// /// Gets or sets the primary shared key of a workspace. /// - [JsonProperty(PropertyName = "primarySharedKey")] - public string PrimarySharedKey { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "primarySharedKey")] + public string PrimarySharedKey {get; set; } /// /// Gets or sets the secondary shared key of a workspace. /// - [JsonProperty(PropertyName = "secondarySharedKey")] - public string SecondarySharedKey { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "secondarySharedKey")] + public string SecondarySharedKey {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs index 6f99cb627e0f..744bc3853b62 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SkuNameEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for SkuNameEnum. /// + + public static class SkuNameEnum { public const string Free = "Free"; @@ -24,4 +21,4 @@ public static class SkuNameEnum public const string Standalone = "Standalone"; public const string CapacityReservation = "CapacityReservation"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs index 1174fdc4c720..a66e57fcb18e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SourceEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,17 +9,19 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for SourceEnum. /// + + public static class SourceEnum { /// - /// Tables provisioned by the system, as collected via Diagnostic - /// Settings, the Agents, or any other standard data collection means. + /// Tables provisioned by the system, as collected via Diagnostic Settings, the + /// Agents, or any other standard data collection means. /// public const string Microsoft = "microsoft"; /// - /// Tables created by the owner of the Workspace, and only found in - /// this Workspace. + /// Tables created by the owner of the Workspace, and only found in this + /// Workspace. /// public const string Customer = "customer"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs index 933aa1fa9750..a0202a3de68a 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageAccount.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,13 +23,17 @@ public StorageAccount() /// /// Initializes a new instance of the StorageAccount class. /// - /// The Azure Resource Manager ID of the storage - /// account resource. - /// The storage account key. + + /// The Azure Resource Manager ID of the storage account resource. + /// + + /// The storage account key. + /// public StorageAccount(string id, string key) + { - Id = id; - Key = key; + this.Id = id; + this.Key = key; CustomInit(); } @@ -45,35 +42,36 @@ public StorageAccount(string id, string key) /// partial void CustomInit(); + /// - /// Gets or sets the Azure Resource Manager ID of the storage account - /// resource. + /// Gets or sets the Azure Resource Manager ID of the storage account resource. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } /// /// Gets or sets the storage account key. /// - [JsonProperty(PropertyName = "key")] - public string Key { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + public string Key {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Id == null) + if (this.Id == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); } - if (Key == null) + if (this.Key == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Key"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Key"); } + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs index 0e95b99f9a8f..0674afb927b0 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsight.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level storage insight resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class StorageInsight : ProxyResource { /// @@ -34,30 +24,45 @@ public StorageInsight() /// /// Initializes a new instance of the StorageInsight class. /// - /// The storage account connection - /// details + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// The names of the blob containers that the - /// workspace should read - /// The names of the Azure tables that the - /// workspace should read - /// The status of the storage insight - /// The ETag of the storage insight. - /// Resource tags. - public StorageInsight(StorageAccount storageAccount, string id = default(string), string name = default(string), string type = default(string), IList containers = default(IList), IList tables = default(IList), StorageInsightStatus status = default(StorageInsightStatus), string eTag = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// The ETag of the storage insight. + /// + + /// Resource tags. + /// + + /// The storage account connection details + /// + + /// The names of the blob containers that the workspace should read + /// + + /// The names of the Azure tables that the workspace should read + /// + + /// The status of the storage insight + /// + public StorageInsight(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), StorageAccount storageAccount = default(StorageAccount), System.Collections.Generic.IList containers = default(System.Collections.Generic.IList), System.Collections.Generic.IList tables = default(System.Collections.Generic.IList), StorageInsightStatus status = default(StorageInsightStatus)) + + : base(id, name, type) { - Containers = containers; - Tables = tables; - StorageAccount = storageAccount; - Status = status; - ETag = eTag; - Tags = tags; + this.ETag = eTag; + this.Tags = tags; + this.StorageAccount = storageAccount; + this.Containers = containers; + this.Tables = tables; + this.Status = status; CustomInit(); } @@ -66,64 +71,63 @@ public StorageInsight() /// partial void CustomInit(); + /// - /// Gets or sets the names of the blob containers that the workspace - /// should read + /// Gets or sets the ETag of the storage insight. /// - [JsonProperty(PropertyName = "properties.containers")] - public IList Containers { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } /// - /// Gets or sets the names of the Azure tables that the workspace - /// should read + /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "properties.tables")] - public IList Tables { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets the storage account connection details /// - [JsonProperty(PropertyName = "properties.storageAccount")] - public StorageAccount StorageAccount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccount")] + public StorageAccount StorageAccount {get; set; } /// - /// Gets the status of the storage insight + /// Gets or sets the names of the blob containers that the workspace should + /// read /// - [JsonProperty(PropertyName = "properties.status")] - public StorageInsightStatus Status { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.containers")] + public System.Collections.Generic.IList Containers {get; set; } /// - /// Gets or sets the ETag of the storage insight. + /// Gets or sets the names of the Azure tables that the workspace should read /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.tables")] + public System.Collections.Generic.IList Tables {get; set; } /// - /// Gets or sets resource tags. + /// Gets the status of the storage insight /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.status")] + public StorageInsightStatus Status {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (StorageAccount == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccount"); - } - if (StorageAccount != null) + + + if (this.StorageAccount != null) { - StorageAccount.Validate(); + this.StorageAccount.Validate(); } - if (Status != null) + + + if (this.Status != null) { - Status.Validate(); + this.Status.Validate(); } } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs new file mode 100644 index 000000000000..cb4dc136d80e --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Storage insight properties. + /// + public partial class StorageInsightProperties + { + /// + /// Initializes a new instance of the StorageInsightProperties class. + /// + public StorageInsightProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageInsightProperties class. + /// + + /// The names of the blob containers that the workspace should read + /// + + /// The names of the Azure tables that the workspace should read + /// + + /// The storage account connection details + /// + + /// The status of the storage insight + /// + public StorageInsightProperties(StorageAccount storageAccount, System.Collections.Generic.IList containers = default(System.Collections.Generic.IList), System.Collections.Generic.IList tables = default(System.Collections.Generic.IList), StorageInsightStatus status = default(StorageInsightStatus)) + + { + this.Containers = containers; + this.Tables = tables; + this.StorageAccount = storageAccount; + this.Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the names of the blob containers that the workspace should + /// read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "containers")] + public System.Collections.Generic.IList Containers {get; set; } + + /// + /// Gets or sets the names of the Azure tables that the workspace should read + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tables")] + public System.Collections.Generic.IList Tables {get; set; } + + /// + /// Gets or sets the storage account connection details + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccount")] + public StorageAccount StorageAccount {get; set; } + + /// + /// Gets the status of the storage insight + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public StorageInsightStatus Status {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.StorageAccount == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccount"); + } + + + if (this.StorageAccount != null) + { + this.StorageAccount.Validate(); + } + if (this.Status != null) + { + this.Status.Validate(); + } + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs index b640af7c0230..9184271245ed 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for StorageInsightState. /// + + public static class StorageInsightState { public const string OK = "OK"; - public const string ERROR = "ERROR"; + public const string Error = "ERROR"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs index 24d77243b3e8..99be42a2d4b9 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/StorageInsightStatus.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,14 +23,17 @@ public StorageInsightStatus() /// /// Initializes a new instance of the StorageInsightStatus class. /// - /// The state of the storage insight connection to - /// the workspace. Possible values include: 'OK', 'ERROR' - /// Description of the state of the storage - /// insight. + + /// The state of the storage insight connection to the workspace + /// Possible values include: 'OK', 'ERROR' + + /// Description of the state of the storage insight. + /// public StorageInsightStatus(string state, string description = default(string)) + { - State = state; - Description = description; + this.State = state; + this.Description = description; CustomInit(); } @@ -46,31 +42,32 @@ public StorageInsightStatus() /// partial void CustomInit(); + /// - /// Gets or sets the state of the storage insight connection to the - /// workspace. Possible values include: 'OK', 'ERROR' + /// Gets or sets the state of the storage insight connection to the workspace Possible values include: 'OK', 'ERROR' /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "state")] + public string State {get; set; } /// /// Gets or sets description of the state of the storage insight. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (State == null) + if (this.State == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "State"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "State"); } + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs index 964c4aa5e6b6..7734067d84be 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// Initializes a new instance of the SystemData class. /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The timestamp of resource last - /// modification (UTC) + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } /// /// Gets or sets the timestamp of resource creation (UTC). /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } /// /// Gets or sets the identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the timestamp of resource last modification (UTC) /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs index a2e91b99ad65..1e54fa3db869 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Table.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; using System.Linq; /// /// Workspace data table definition. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Table : ProxyResource { /// @@ -32,52 +24,71 @@ public Table() /// /// Initializes a new instance of the Table class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// The table retention in days, between - /// 4 and 730. Setting this property to -1 will default to the - /// workspace retention. - /// The table total retention in - /// days, between 4 and 2555. Setting this property to -1 will default - /// to table retention. - /// The table data archive - /// retention in days. Calculated as - /// (totalRetentionInDays-retentionInDays) - /// Parameters of the search job that - /// initiated this table. - /// Parameters of the restore operation that - /// initiated this table. - /// Search job execution - /// statistics. - /// Instruct the system how to handle and charge the - /// logs ingested to this table. Possible values include: 'Basic', - /// 'Analytics' - /// The timestamp that table plan - /// was last modified (UTC). - /// Table schema. - /// Table's current provisioning state. - /// If set to 'updating', indicates a resource lock due to ongoing - /// operation, forbidding any update to the table until the ongoing - /// operation is concluded. Possible values include: 'Updating', - /// 'InProgress', 'Succeeded' - public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Metadata pertaining to creation and last modification of the resource. + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + + /// Search job execution statistics. + /// + + /// Table schema. + /// + + /// The table retention in days, between 4 and 730. Setting this property to -1 + /// will default to the workspace retention. + /// + + /// The table total retention in days, between 4 and 2555. Setting this + /// property to -1 will default to table retention. + /// + + /// The table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + + /// Instruct the system how to handle and charge the logs ingested to this + /// table. + /// Possible values include: 'Basic', 'Analytics' + + /// The timestamp that table plan was last modified (UTC). + /// + + /// Table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + public Table(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), Schema schema = default(Schema), int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), string plan = default(string), string lastPlanModifiedDate = default(string), string provisioningState = default(string)) + + : base(id, name, type) { - RetentionInDays = retentionInDays; - TotalRetentionInDays = totalRetentionInDays; - ArchiveRetentionInDays = archiveRetentionInDays; - SearchResults = searchResults; - RestoredLogs = restoredLogs; - ResultStatistics = resultStatistics; - Plan = plan; - LastPlanModifiedDate = lastPlanModifiedDate; - Schema = schema; - ProvisioningState = provisioningState; - SystemData = systemData; + this.SystemData = systemData; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; + this.ResultStatistics = resultStatistics; + this.Schema = schema; + this.RetentionInDays = retentionInDays; + this.TotalRetentionInDays = totalRetentionInDays; + this.ArchiveRetentionInDays = archiveRetentionInDays; + this.Plan = plan; + this.LastPlanModifiedDate = lastPlanModifiedDate; + this.ProvisioningState = provisioningState; CustomInit(); } @@ -86,116 +97,119 @@ public Table() /// partial void CustomInit(); + /// - /// Gets or sets the table retention in days, between 4 and 730. - /// Setting this property to -1 will default to the workspace - /// retention. + /// Gets metadata pertaining to creation and last modification of the resource. /// - [JsonProperty(PropertyName = "properties.retentionInDays")] - public int? RetentionInDays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets or sets the table total retention in days, between 4 and 2555. - /// Setting this property to -1 will default to table retention. + /// Gets or sets parameters of the search job that initiated this table. /// - [JsonProperty(PropertyName = "properties.totalRetentionInDays")] - public int? TotalRetentionInDays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.searchResults")] + public SearchResults SearchResults {get; set; } /// - /// Gets the table data archive retention in days. Calculated as - /// (totalRetentionInDays-retentionInDays) + /// Gets or sets parameters of the restore operation that initiated this table. /// - [JsonProperty(PropertyName = "properties.archiveRetentionInDays")] - public int? ArchiveRetentionInDays { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.restoredLogs")] + public RestoredLogs RestoredLogs {get; set; } /// - /// Gets or sets parameters of the search job that initiated this - /// table. + /// Gets or sets search job execution statistics. /// - [JsonProperty(PropertyName = "properties.searchResults")] - public SearchResults SearchResults { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resultStatistics")] + public ResultStatistics ResultStatistics {get; set; } /// - /// Gets or sets parameters of the restore operation that initiated - /// this table. + /// Gets or sets table schema. /// - [JsonProperty(PropertyName = "properties.restoredLogs")] - public RestoredLogs RestoredLogs { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.schema")] + public Schema Schema {get; set; } /// - /// Gets or sets search job execution statistics. + /// Gets or sets the table retention in days, between 4 and 730. Setting this + /// property to -1 will default to the workspace retention. /// - [JsonProperty(PropertyName = "properties.resultStatistics")] - public ResultStatistics ResultStatistics { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } /// - /// Gets or sets instruct the system how to handle and charge the logs - /// ingested to this table. Possible values include: 'Basic', - /// 'Analytics' + /// Gets or sets the table total retention in days, between 4 and 2555. Setting + /// this property to -1 will default to table retention. /// - [JsonProperty(PropertyName = "properties.plan")] - public string Plan { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.totalRetentionInDays")] + public int? TotalRetentionInDays {get; set; } /// - /// Gets the timestamp that table plan was last modified (UTC). + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) /// - [JsonProperty(PropertyName = "properties.lastPlanModifiedDate")] - public string LastPlanModifiedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.archiveRetentionInDays")] + public int? ArchiveRetentionInDays {get; private set; } /// - /// Gets or sets table schema. + /// Gets or sets instruct the system how to handle and charge the logs ingested + /// to this table. Possible values include: 'Basic', 'Analytics' /// - [JsonProperty(PropertyName = "properties.schema")] - public Schema Schema { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.plan")] + public string Plan {get; set; } /// - /// Gets table's current provisioning state. If set to 'updating', - /// indicates a resource lock due to ongoing operation, forbidding any - /// update to the table until the ongoing operation is concluded. - /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// Gets the timestamp that table plan was last modified (UTC). /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastPlanModifiedDate")] + public string LastPlanModifiedDate {get; private set; } /// + /// Gets table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. Possible values include: 'Updating', 'InProgress', 'Succeeded' /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RetentionInDays != null) + + + + if (this.ResultStatistics != null) + { + this.ResultStatistics.Validate(); + } + + if (this.RetentionInDays != null) { - if (RetentionInDays > 730) + if (this.RetentionInDays > 730) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < 4) + if (this.RetentionInDays < 4) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RetentionInDays", 4); } } - if (TotalRetentionInDays != null) + if (this.TotalRetentionInDays != null) { - if (TotalRetentionInDays > 2555) + if (this.TotalRetentionInDays > 2555) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); } - if (TotalRetentionInDays < 4) + if (this.TotalRetentionInDays < 4) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); } } - if (ResultStatistics != null) - { - ResultStatistics.Validate(); - } + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs index 7a408029858f..c2baef281564 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TablePlanEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,11 +9,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for TablePlanEnum. /// + + public static class TablePlanEnum { /// - /// Logs that are adjusted to support high volume low value verbose - /// logs. + /// Logs that are adjusted to support high volume low value verbose logs. /// public const string Basic = "Basic"; /// @@ -26,4 +22,4 @@ public static class TablePlanEnum /// public const string Analytics = "Analytics"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs new file mode 100644 index 000000000000..3b0374c735b2 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableProperties.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Table properties. + /// + public partial class TableProperties + { + /// + /// Initializes a new instance of the TableProperties class. + /// + public TableProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TableProperties class. + /// + + /// The table retention in days, between 4 and 730. Setting this property to -1 + /// will default to the workspace retention. + /// + + /// The table total retention in days, between 4 and 2555. Setting this + /// property to -1 will default to table retention. + /// + + /// The table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + + /// Parameters of the search job that initiated this table. + /// + + /// Parameters of the restore operation that initiated this table. + /// + + /// Search job execution statistics. + /// + + /// Instruct the system how to handle and charge the logs ingested to this + /// table. + /// Possible values include: 'Basic', 'Analytics' + + /// The timestamp that table plan was last modified (UTC). + /// + + /// Table schema. + /// + + /// Table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. + /// Possible values include: 'Updating', 'InProgress', 'Succeeded' + public TableProperties(int? retentionInDays = default(int?), int? totalRetentionInDays = default(int?), int? archiveRetentionInDays = default(int?), SearchResults searchResults = default(SearchResults), RestoredLogs restoredLogs = default(RestoredLogs), ResultStatistics resultStatistics = default(ResultStatistics), string plan = default(string), string lastPlanModifiedDate = default(string), Schema schema = default(Schema), string provisioningState = default(string)) + + { + this.RetentionInDays = retentionInDays; + this.TotalRetentionInDays = totalRetentionInDays; + this.ArchiveRetentionInDays = archiveRetentionInDays; + this.SearchResults = searchResults; + this.RestoredLogs = restoredLogs; + this.ResultStatistics = resultStatistics; + this.Plan = plan; + this.LastPlanModifiedDate = lastPlanModifiedDate; + this.Schema = schema; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the table retention in days, between 4 and 730. Setting this + /// property to -1 will default to the workspace retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets or sets the table total retention in days, between 4 and 2555. Setting + /// this property to -1 will default to table retention. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "totalRetentionInDays")] + public int? TotalRetentionInDays {get; set; } + + /// + /// Gets the table data archive retention in days. Calculated as + /// (totalRetentionInDays-retentionInDays) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "archiveRetentionInDays")] + public int? ArchiveRetentionInDays {get; private set; } + + /// + /// Gets or sets parameters of the search job that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "searchResults")] + public SearchResults SearchResults {get; set; } + + /// + /// Gets or sets parameters of the restore operation that initiated this table. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "restoredLogs")] + public RestoredLogs RestoredLogs {get; set; } + + /// + /// Gets or sets search job execution statistics. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resultStatistics")] + public ResultStatistics ResultStatistics {get; set; } + + /// + /// Gets or sets instruct the system how to handle and charge the logs ingested + /// to this table. Possible values include: 'Basic', 'Analytics' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "plan")] + public string Plan {get; set; } + + /// + /// Gets the timestamp that table plan was last modified (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastPlanModifiedDate")] + public string LastPlanModifiedDate {get; private set; } + + /// + /// Gets or sets table schema. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "schema")] + public Schema Schema {get; set; } + + /// + /// Gets table's current provisioning state. If set to 'updating', indicates a + /// resource lock due to ongoing operation, forbidding any update to the table + /// until the ongoing operation is concluded. Possible values include: 'Updating', 'InProgress', 'Succeeded' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RetentionInDays != null) + { + if (this.RetentionInDays > 730) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (this.RetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "RetentionInDays", 4); + } + } + if (this.TotalRetentionInDays != null) + { + if (this.TotalRetentionInDays > 2555) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMaximum, "TotalRetentionInDays", 2555); + } + if (this.TotalRetentionInDays < 4) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.InclusiveMinimum, "TotalRetentionInDays", 4); + } + } + + + if (this.ResultStatistics != null) + { + this.ResultStatistics.Validate(); + } + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs index 66290ed88e5e..59978a60714b 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableSubTypeEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for TableSubTypeEnum. /// + + public static class TableSubTypeEnum { /// @@ -21,17 +18,16 @@ public static class TableSubTypeEnum /// public const string Any = "Any"; /// - /// Indicates a table created through the Data Collector API or with - /// the custom logs feature of the MMA agent, or any table against - /// which Custom Fields were created. + /// Indicates a table created through the Data Collector API or with the custom + /// logs feature of the MMA agent, or any table against which Custom Fields + /// were created. /// public const string Classic = "Classic"; /// - /// A table eligible to have data sent into it via any of the means - /// supported by Data Collection Rules: the Data Collection Endpoint - /// API, ingestion-time transformations, or any other mechanism - /// provided by Data Collection Rules + /// A table eligible to have data sent into it via any of the means supported + /// by Data Collection Rules: the Data Collection Endpoint API, ingestion-time + /// transformations, or any other mechanism provided by Data Collection Rules /// public const string DataCollectionRuleBased = "DataCollectionRuleBased"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs index c0a47dc4ff49..92978b7b5c7d 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TableTypeEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for TableTypeEnum. /// + + public static class TableTypeEnum { /// @@ -33,4 +30,4 @@ public static class TableTypeEnum /// public const string SearchResults = "SearchResults"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs index 0217ed7c7775..382ae7aa8f91 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Tag.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,12 +23,17 @@ public Tag() /// /// Initializes a new instance of the Tag class. /// - /// The tag name. - /// The tag value. + + /// The tag name. + /// + + /// The tag value. + /// public Tag(string name, string value) + { - Name = name; - Value = value; + this.Name = name; + this.Value = value; CustomInit(); } @@ -44,34 +42,36 @@ public Tag(string name, string value) /// partial void CustomInit(); + /// /// Gets or sets the tag name. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets the tag value. /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } - if (Value == null) + if (this.Value == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); } + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs index 3bf49fa1ae27..afc5e9addb69 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/TrackedResource.cs @@ -1,27 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Tracked Resource + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' /// /// /// The resource model definition for an Azure Resource Manager tracked top - /// level resource which has 'tags' and a 'location' + /// level resource which has 'tags' and a 'location' /// public partial class TrackedResource : Resource { @@ -36,20 +28,29 @@ public TrackedResource() /// /// Initializes a new instance of the TrackedResource class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Resource tags. - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, name, type) { - Tags = tags; - Location = location; + this.Tags = tags; + this.Location = location; CustomInit(); } @@ -58,30 +59,32 @@ public TrackedResource() /// partial void CustomInit(); + /// /// Gets or sets resource tags. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Gets or sets the geo-location where the resource lives /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs index 5041fa877447..f7f47d277071 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Type.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for Type. /// + + public static class Type { public const string StorageAccount = "StorageAccount"; public const string EventHub = "EventHub"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs index d7d330e90858..d7aa43a5b50d 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UsageMetric.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,22 +23,33 @@ public UsageMetric() /// /// Initializes a new instance of the UsageMetric class. /// - /// The name of the metric. - /// The units used for the metric. - /// The current value of the metric. - /// The quota limit for the metric. - /// The time that the metric's value will - /// reset. - /// The quota period that determines the - /// length of time between value resets. + + /// The name of the metric. + /// + + /// The units used for the metric. + /// + + /// The current value of the metric. + /// + + /// The quota limit for the metric. + /// + + /// The time that the metric's value will reset. + /// + + /// The quota period that determines the length of time between value resets. + /// public UsageMetric(MetricName name = default(MetricName), string unit = default(string), double? currentValue = default(double?), double? limit = default(double?), System.DateTime? nextResetTime = default(System.DateTime?), string quotaPeriod = default(string)) + { - Name = name; - Unit = unit; - CurrentValue = currentValue; - Limit = limit; - NextResetTime = nextResetTime; - QuotaPeriod = quotaPeriod; + this.Name = name; + this.Unit = unit; + this.CurrentValue = currentValue; + this.Limit = limit; + this.NextResetTime = nextResetTime; + this.QuotaPeriod = quotaPeriod; CustomInit(); } @@ -53,42 +58,42 @@ public UsageMetric() /// partial void CustomInit(); + /// /// Gets or sets the name of the metric. /// - [JsonProperty(PropertyName = "name")] - public MetricName Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public MetricName Name {get; set; } /// /// Gets or sets the units used for the metric. /// - [JsonProperty(PropertyName = "unit")] - public string Unit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit {get; set; } /// /// Gets or sets the current value of the metric. /// - [JsonProperty(PropertyName = "currentValue")] - public double? CurrentValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public double? CurrentValue {get; set; } /// /// Gets or sets the quota limit for the metric. /// - [JsonProperty(PropertyName = "limit")] - public double? Limit { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public double? Limit {get; set; } /// - /// Gets or sets the time that the metric's value will reset. + /// Gets or sets the time that the metric's value will reset. /// - [JsonProperty(PropertyName = "nextResetTime")] - public System.DateTime? NextResetTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime {get; set; } /// - /// Gets or sets the quota period that determines the length of time - /// between value resets. + /// Gets or sets the quota period that determines the length of time between + /// value resets. /// - [JsonProperty(PropertyName = "quotaPeriod")] - public string QuotaPeriod { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs index ebe5da6faf3a..79464625463a 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/UserIdentityProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,17 @@ public UserIdentityProperties() /// /// Initializes a new instance of the UserIdentityProperties class. /// - /// The principal id of user assigned - /// identity. - /// The client id of user assigned - /// identity. + + /// The principal id of user assigned identity. + /// + + /// The client id of user assigned identity. + /// public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + { - PrincipalId = principalId; - ClientId = clientId; + this.PrincipalId = principalId; + this.ClientId = clientId; CustomInit(); } @@ -45,17 +42,17 @@ public UserIdentityProperties() /// partial void CustomInit(); + /// /// Gets the principal id of user assigned identity. /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; private set; } /// /// Gets the client id of user assigned identity. /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "clientId")] + public string ClientId {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs index 30cfa30eaef6..ac80fd72714f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/Workspace.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level Workspace resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class Workspace : TrackedResource { /// @@ -34,63 +24,93 @@ public Workspace() /// /// Initializes a new instance of the Workspace class. /// - /// The geo-location where the resource - /// lives + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Resource tags. - /// The provisioning state of the - /// workspace. Possible values include: 'Creating', 'Succeeded', - /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', - /// 'Updating' - /// This is a read-only property. Represents - /// the ID associated with the workspace. - /// The SKU of the workspace. - /// The workspace data retention in days. - /// Allowed values are per pricing plan. See pricing tiers - /// documentation for details. - /// The daily volume cap for - /// ingestion. - /// Workspace creation date. - /// Workspace modification date. - /// The network access - /// type for accessing Log Analytics ingestion. Possible values - /// include: 'Enabled', 'Disabled' - /// The network access type - /// for accessing Log Analytics query. Possible values include: - /// 'Enabled', 'Disabled' - /// Indicates whether customer managed - /// storage is mandatory for query management. - /// List of linked private - /// link scope resources. - /// Workspace features. - /// The resource ID - /// of the default Data Collection Rule to use for this workspace. - /// Expected format is - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. - /// The ETag of the workspace. - public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), SystemData systemData = default(SystemData), string eTag = default(string)) - : base(location, id, name, type, tags) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Metadata pertaining to creation and last modification of the resource. + /// + + /// The ETag of the workspace. + /// + + /// The daily volume cap for ingestion. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SystemData systemData = default(SystemData), string eTag = default(string), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + : base(location, id, name, type, tags) { - ProvisioningState = provisioningState; - CustomerId = customerId; - Sku = sku; - RetentionInDays = retentionInDays; - WorkspaceCapping = workspaceCapping; - CreatedDate = createdDate; - ModifiedDate = modifiedDate; - PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; - PublicNetworkAccessForQuery = publicNetworkAccessForQuery; - ForceCmkForQuery = forceCmkForQuery; - PrivateLinkScopedResources = privateLinkScopedResources; - Features = features; - DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; - SystemData = systemData; - ETag = eTag; + this.SystemData = systemData; + this.ETag = eTag; + this.WorkspaceCapping = workspaceCapping; + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; CustomInit(); } @@ -99,117 +119,126 @@ public Workspace() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the workspace. Possible values - /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', - /// 'ProvisioningAccount', 'Updating' + /// Gets metadata pertaining to creation and last modification of the resource. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// - /// Gets this is a read-only property. Represents the ID associated - /// with the workspace. + /// Gets or sets the ETag of the workspace. /// - [JsonProperty(PropertyName = "properties.customerId")] - public string CustomerId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } /// - /// Gets or sets the SKU of the workspace. + /// Gets or sets the daily volume cap for ingestion. /// - [JsonProperty(PropertyName = "properties.sku")] - public WorkspaceSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } /// - /// Gets or sets the workspace data retention in days. Allowed values - /// are per pricing plan. See pricing tiers documentation for details. + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' /// - [JsonProperty(PropertyName = "properties.retentionInDays")] - public int? RetentionInDays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the daily volume cap for ingestion. + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. /// - [JsonProperty(PropertyName = "properties.workspaceCapping")] - public WorkspaceCapping WorkspaceCapping { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId {get; private set; } /// - /// Gets workspace creation date. + /// Gets or sets the SKU of the workspace. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public string CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku {get; set; } /// - /// Gets workspace modification date. + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. /// - [JsonProperty(PropertyName = "properties.modifiedDate")] - public string ModifiedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } /// - /// Gets or sets the network access type for accessing Log Analytics - /// ingestion. Possible values include: 'Enabled', 'Disabled' + /// Gets workspace creation date. /// - [JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] - public string PublicNetworkAccessForIngestion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } /// - /// Gets or sets the network access type for accessing Log Analytics - /// query. Possible values include: 'Enabled', 'Disabled' + /// Gets workspace modification date. /// - [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] - public string PublicNetworkAccessForQuery { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate {get; private set; } /// - /// Gets or sets indicates whether customer managed storage is - /// mandatory for query management. + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.forceCmkForQuery")] - public bool? ForceCmkForQuery { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } /// - /// Gets list of linked private link scope resources. + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] - public IList PrivateLinkScopedResources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } /// - /// Gets or sets workspace features. + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. /// - [JsonProperty(PropertyName = "properties.features")] - public WorkspaceFeatures Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } /// - /// Gets or sets the resource ID of the default Data Collection Rule to - /// use for this workspace. Expected format is - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// Gets list of linked private link scope resources. /// - [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] - public string DefaultDataCollectionRuleResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } /// + /// Gets or sets workspace features. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features {get; set; } /// - /// Gets or sets the ETag of the workspace. + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Sku != null) + + + + + + if (this.Sku != null) { - Sku.Validate(); + this.Sku.Validate(); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs index 21334397f8a0..f7c0f2281085 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceCapping.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,19 +23,22 @@ public WorkspaceCapping() /// /// Initializes a new instance of the WorkspaceCapping class. /// - /// The workspace daily quota for - /// ingestion. - /// The time when the quota will be - /// rest. - /// The status of data ingestion for - /// this workspace. Possible values include: 'RespectQuota', 'ForceOn', - /// 'ForceOff', 'OverQuota', 'SubscriptionSuspended', - /// 'ApproachingQuota' + + /// The workspace daily quota for ingestion. + /// + + /// The time when the quota will be rest. + /// + + /// The status of data ingestion for this workspace. + /// Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', + /// 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota' public WorkspaceCapping(double? dailyQuotaGb = default(double?), string quotaNextResetTime = default(string), string dataIngestionStatus = default(string)) + { - DailyQuotaGb = dailyQuotaGb; - QuotaNextResetTime = quotaNextResetTime; - DataIngestionStatus = dataIngestionStatus; + this.DailyQuotaGb = dailyQuotaGb; + this.QuotaNextResetTime = quotaNextResetTime; + this.DataIngestionStatus = dataIngestionStatus; CustomInit(); } @@ -50,25 +47,23 @@ public WorkspaceCapping() /// partial void CustomInit(); + /// /// Gets or sets the workspace daily quota for ingestion. /// - [JsonProperty(PropertyName = "dailyQuotaGb")] - public double? DailyQuotaGb { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "dailyQuotaGb")] + public double? DailyQuotaGb {get; set; } /// /// Gets the time when the quota will be rest. /// - [JsonProperty(PropertyName = "quotaNextResetTime")] - public string QuotaNextResetTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaNextResetTime")] + public string QuotaNextResetTime {get; private set; } /// - /// Gets the status of data ingestion for this workspace. Possible - /// values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', - /// 'SubscriptionSuspended', 'ApproachingQuota' + /// Gets the status of data ingestion for this workspace. Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota' /// - [JsonProperty(PropertyName = "dataIngestionStatus")] - public string DataIngestionStatus { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "dataIngestionStatus")] + public string DataIngestionStatus {get; private set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs index 4863a223b41a..ef1e97e6f2e5 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceEntityStatus.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for WorkspaceEntityStatus. /// + + public static class WorkspaceEntityStatus { public const string Creating = "Creating"; @@ -24,4 +21,4 @@ public static class WorkspaceEntityStatus public const string ProvisioningAccount = "ProvisioningAccount"; public const string Updating = "Updating"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs index 43b3cefe27d2..0bf406fc9817 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceFeatures.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,26 +23,33 @@ public WorkspaceFeatures() /// /// Initializes a new instance of the WorkspaceFeatures class. /// - /// Unmatched properties from the - /// message are deserialized this collection - /// Flag that indicate if data should be - /// exported. - /// Flag that describes if we - /// want to remove the data after 30 days. - /// Flag that - /// indicate which permission to use - resource or workspace or - /// both. - /// Dedicated LA cluster resourceId - /// that is linked to the workspaces. - /// Disable Non-AAD based Auth. - public WorkspaceFeatures(IDictionary additionalProperties = default(IDictionary), bool? enableDataExport = default(bool?), bool? immediatePurgeDataOn30Days = default(bool?), bool? enableLogAccessUsingOnlyResourcePermissions = default(bool?), string clusterResourceId = default(string), bool? disableLocalAuth = default(bool?)) + + /// Workspace features. + /// + + /// Flag that indicate if data should be exported. + /// + + /// Flag that describes if we want to remove the data after 30 days. + /// + + /// Flag that indicate which permission to use - resource or workspace or both. + /// + + /// Dedicated LA cluster resourceId that is linked to the workspaces. + /// + + /// Disable Non-AAD based Auth. + /// + public WorkspaceFeatures(System.Collections.Generic.IDictionary additionalProperties = default(System.Collections.Generic.IDictionary), bool? enableDataExport = default(bool?), bool? immediatePurgeDataOn30Days = default(bool?), bool? enableLogAccessUsingOnlyResourcePermissions = default(bool?), string clusterResourceId = default(string), bool? disableLocalAuth = default(bool?)) + { - AdditionalProperties = additionalProperties; - EnableDataExport = enableDataExport; - ImmediatePurgeDataOn30Days = immediatePurgeDataOn30Days; - EnableLogAccessUsingOnlyResourcePermissions = enableLogAccessUsingOnlyResourcePermissions; - ClusterResourceId = clusterResourceId; - DisableLocalAuth = disableLocalAuth; + this.AdditionalProperties = additionalProperties; + this.EnableDataExport = enableDataExport; + this.ImmediatePurgeDataOn30Days = immediatePurgeDataOn30Days; + this.EnableLogAccessUsingOnlyResourcePermissions = enableLogAccessUsingOnlyResourcePermissions; + this.ClusterResourceId = clusterResourceId; + this.DisableLocalAuth = disableLocalAuth; CustomInit(); } @@ -59,45 +58,44 @@ public WorkspaceFeatures() /// partial void CustomInit(); + /// - /// Gets or sets unmatched properties from the message are deserialized - /// this collection + /// Gets or sets workspace features. /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties {get; set; } /// /// Gets or sets flag that indicate if data should be exported. /// - [JsonProperty(PropertyName = "enableDataExport")] - public bool? EnableDataExport { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableDataExport")] + public bool? EnableDataExport {get; set; } /// - /// Gets or sets flag that describes if we want to remove the data - /// after 30 days. + /// Gets or sets flag that describes if we want to remove the data after 30 + /// days. /// - [JsonProperty(PropertyName = "immediatePurgeDataOn30Days")] - public bool? ImmediatePurgeDataOn30Days { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "immediatePurgeDataOn30Days")] + public bool? ImmediatePurgeDataOn30Days {get; set; } /// - /// Gets or sets flag that indicate which permission to use - resource - /// or workspace or both. + /// Gets or sets flag that indicate which permission to use - resource or + /// workspace or both. /// - [JsonProperty(PropertyName = "enableLogAccessUsingOnlyResourcePermissions")] - public bool? EnableLogAccessUsingOnlyResourcePermissions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableLogAccessUsingOnlyResourcePermissions")] + public bool? EnableLogAccessUsingOnlyResourcePermissions {get; set; } /// /// Gets or sets dedicated LA cluster resourceId that is linked to the /// workspaces. /// - [JsonProperty(PropertyName = "clusterResourceId")] - public string ClusterResourceId { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "clusterResourceId")] + public string ClusterResourceId {get; set; } /// /// Gets or sets disable Non-AAD based Auth. /// - [JsonProperty(PropertyName = "disableLocalAuth")] - public bool? DisableLocalAuth { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "disableLocalAuth")] + public bool? DisableLocalAuth {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs index 308ed59db14d..a5f623fc4322 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePatch.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The top level Workspace resource container. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class WorkspacePatch : AzureEntityResource { /// @@ -34,60 +24,86 @@ public WorkspacePatch() /// /// Initializes a new instance of the WorkspacePatch class. /// + /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// The name of the resource - /// The type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// Resource Etag. - /// The provisioning state of the - /// workspace. Possible values include: 'Creating', 'Succeeded', - /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', - /// 'Updating' - /// This is a read-only property. Represents - /// the ID associated with the workspace. - /// The SKU of the workspace. - /// The workspace data retention in days. - /// Allowed values are per pricing plan. See pricing tiers - /// documentation for details. - /// The daily volume cap for - /// ingestion. - /// Workspace creation date. - /// Workspace modification date. - /// The network access - /// type for accessing Log Analytics ingestion. Possible values - /// include: 'Enabled', 'Disabled' - /// The network access type - /// for accessing Log Analytics query. Possible values include: - /// 'Enabled', 'Disabled' - /// Indicates whether customer managed - /// storage is mandatory for query management. - /// List of linked private - /// link scope resources. - /// Workspace features. - /// The resource ID - /// of the default Data Collection Rule to use for this workspace. - /// Expected format is - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. - /// Resource tags. Optional. - public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type, etag) + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Resource Etag. + /// + + /// Resource tags. Optional. + /// + + /// The daily volume cap for ingestion. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + : base(id, name, type, etag) { - ProvisioningState = provisioningState; - CustomerId = customerId; - Sku = sku; - RetentionInDays = retentionInDays; - WorkspaceCapping = workspaceCapping; - CreatedDate = createdDate; - ModifiedDate = modifiedDate; - PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; - PublicNetworkAccessForQuery = publicNetworkAccessForQuery; - ForceCmkForQuery = forceCmkForQuery; - PrivateLinkScopedResources = privateLinkScopedResources; - Features = features; - DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; - Tags = tags; + this.Tags = tags; + this.WorkspaceCapping = workspaceCapping; + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; CustomInit(); } @@ -96,111 +112,118 @@ public WorkspacePatch() /// partial void CustomInit(); + /// - /// Gets the provisioning state of the workspace. Possible values - /// include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', - /// 'ProvisioningAccount', 'Updating' + /// Gets or sets resource tags. Optional. /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets this is a read-only property. Represents the ID associated - /// with the workspace. + /// Gets or sets the daily volume cap for ingestion. /// - [JsonProperty(PropertyName = "properties.customerId")] - public string CustomerId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } /// - /// Gets or sets the SKU of the workspace. + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' /// - [JsonProperty(PropertyName = "properties.sku")] - public WorkspaceSku Sku { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } /// - /// Gets or sets the workspace data retention in days. Allowed values - /// are per pricing plan. See pricing tiers documentation for details. + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. /// - [JsonProperty(PropertyName = "properties.retentionInDays")] - public int? RetentionInDays { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId {get; private set; } /// - /// Gets or sets the daily volume cap for ingestion. + /// Gets or sets the SKU of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.sku")] + public WorkspaceSku Sku {get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. /// - [JsonProperty(PropertyName = "properties.workspaceCapping")] - public WorkspaceCapping WorkspaceCapping { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionInDays")] + public int? RetentionInDays {get; set; } /// /// Gets workspace creation date. /// - [JsonProperty(PropertyName = "properties.createdDate")] - public string CreatedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate {get; private set; } /// /// Gets workspace modification date. /// - [JsonProperty(PropertyName = "properties.modifiedDate")] - public string ModifiedDate { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate {get; private set; } /// - /// Gets or sets the network access type for accessing Log Analytics - /// ingestion. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] - public string PublicNetworkAccessForIngestion { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } /// - /// Gets or sets the network access type for accessing Log Analytics - /// query. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' /// - [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] - public string PublicNetworkAccessForQuery { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } /// - /// Gets or sets indicates whether customer managed storage is - /// mandatory for query management. + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. /// - [JsonProperty(PropertyName = "properties.forceCmkForQuery")] - public bool? ForceCmkForQuery { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } /// /// Gets list of linked private link scope resources. /// - [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] - public IList PrivateLinkScopedResources { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } /// /// Gets or sets workspace features. /// - [JsonProperty(PropertyName = "properties.features")] - public WorkspaceFeatures Features { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.features")] + public WorkspaceFeatures Features {get; set; } /// - /// Gets or sets the resource ID of the default Data Collection Rule to - /// use for this workspace. Expected format is - + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. /// - [JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] - public string DefaultDataCollectionRuleResourceId { get; set; } - - /// - /// Gets or sets resource tags. Optional. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Sku != null) + + + + + if (this.Sku != null) { - Sku.Validate(); + this.Sku.Validate(); } + + + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs new file mode 100644 index 000000000000..ed0f8b57951c --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceProperties.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + /// + /// Workspace properties. + /// + public partial class WorkspaceProperties + { + /// + /// Initializes a new instance of the WorkspaceProperties class. + /// + public WorkspaceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceProperties class. + /// + + /// The provisioning state of the workspace. + /// Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'ProvisioningAccount', 'Updating' + + /// This is a read-only property. Represents the ID associated with the + /// workspace. + /// + + /// The SKU of the workspace. + /// + + /// The workspace data retention in days. Allowed values are per pricing plan. + /// See pricing tiers documentation for details. + /// + + /// The daily volume cap for ingestion. + /// + + /// Workspace creation date. + /// + + /// Workspace modification date. + /// + + /// The network access type for accessing Log Analytics ingestion. + /// Possible values include: 'Enabled', 'Disabled' + + /// The network access type for accessing Log Analytics query. + /// Possible values include: 'Enabled', 'Disabled' + + /// Indicates whether customer managed storage is mandatory for query + /// management. + /// + + /// List of linked private link scope resources. + /// + + /// Workspace features. + /// + + /// The resource ID of the default Data Collection Rule to use for this + /// workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + public WorkspaceProperties(string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), System.Collections.Generic.IList privateLinkScopedResources = default(System.Collections.Generic.IList), WorkspaceFeatures features = default(WorkspaceFeatures), string defaultDataCollectionRuleResourceId = default(string)) + + { + this.ProvisioningState = provisioningState; + this.CustomerId = customerId; + this.Sku = sku; + this.RetentionInDays = retentionInDays; + this.WorkspaceCapping = workspaceCapping; + this.CreatedDate = createdDate; + this.ModifiedDate = modifiedDate; + this.PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + this.PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + this.ForceCmkForQuery = forceCmkForQuery; + this.PrivateLinkScopedResources = privateLinkScopedResources; + this.Features = features; + this.DefaultDataCollectionRuleResourceId = defaultDataCollectionRuleResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + + /// + /// Gets this is a read-only property. Represents the ID associated with the + /// workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customerId")] + public string CustomerId {get; private set; } + + /// + /// Gets or sets the SKU of the workspace. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] + public WorkspaceSku Sku {get; set; } + + /// + /// Gets or sets the workspace data retention in days. Allowed values are per + /// pricing plan. See pricing tiers documentation for details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInDays")] + public int? RetentionInDays {get; set; } + + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceCapping")] + public WorkspaceCapping WorkspaceCapping {get; set; } + + /// + /// Gets workspace creation date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdDate")] + public string CreatedDate {get; private set; } + + /// + /// Gets workspace modification date. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedDate")] + public string ModifiedDate {get; private set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccessForIngestion")] + public string PublicNetworkAccessForIngestion {get; set; } + + /// + /// Gets or sets the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "publicNetworkAccessForQuery")] + public string PublicNetworkAccessForQuery {get; set; } + + /// + /// Gets or sets indicates whether customer managed storage is mandatory for + /// query management. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "forceCmkForQuery")] + public bool? ForceCmkForQuery {get; set; } + + /// + /// Gets list of linked private link scope resources. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkScopedResources")] + public System.Collections.Generic.IList PrivateLinkScopedResources {get; private set; } + + /// + /// Gets or sets workspace features. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "features")] + public WorkspaceFeatures Features {get; set; } + + /// + /// Gets or sets the resource ID of the default Data Collection Rule to use for + /// this workspace. Expected format is - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "defaultDataCollectionRuleResourceId")] + public string DefaultDataCollectionRuleResourceId {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.Sku != null) + { + this.Sku.Validate(); + } + + + + + + + + + } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs index ba29038ffa6e..f3afc01b45e8 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBody.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,13 +23,18 @@ public WorkspacePurgeBody() /// /// Initializes a new instance of the WorkspacePurgeBody class. /// - /// Table from which to purge data. - /// The set of columns and filters (queries) to - /// run over them to purge the resulting data. - public WorkspacePurgeBody(string table, IList filters) + + /// Table from which to purge data. + /// + + /// The set of columns and filters (queries) to run over them to purge the + /// resulting data. + /// + public WorkspacePurgeBody(string table, System.Collections.Generic.IList filters) + { - Table = table; - Filters = filters; + this.Table = table; + this.Filters = filters; CustomInit(); } @@ -47,35 +43,37 @@ public WorkspacePurgeBody(string table, IList filters /// partial void CustomInit(); + /// /// Gets or sets table from which to purge data. /// - [JsonProperty(PropertyName = "table")] - public string Table { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "table")] + public string Table {get; set; } /// - /// Gets or sets the set of columns and filters (queries) to run over - /// them to purge the resulting data. + /// Gets or sets the set of columns and filters (queries) to run over them to + /// purge the resulting data. /// - [JsonProperty(PropertyName = "filters")] - public IList Filters { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "filters")] + public System.Collections.Generic.IList Filters {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Table == null) + if (this.Table == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Table"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Table"); } - if (Filters == null) + if (this.Filters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Filters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Filters"); } + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs index 829096e31e90..eb0711e82e91 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeBodyFilters.cs @@ -1,21 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Newtonsoft.Json; using System.Linq; /// - /// User-defined filters to return data which will be purged from the - /// table. + /// User-defined filters to return data which will be purged from the table. /// public partial class WorkspacePurgeBodyFilters { @@ -30,23 +23,29 @@ public WorkspacePurgeBodyFilters() /// /// Initializes a new instance of the WorkspacePurgeBodyFilters class. /// - /// The column of the table over which the given - /// query should run - /// A query operator to evaluate over - /// the provided column and value(s). Supported operators are ==, =~, - /// in, in~, >, >=, <, <=, between, and have the same - /// behavior as they would in a KQL query. - /// the value for the operator to function over. - /// This can be a number (e.g., > 100), a string (timestamp >= - /// '2017-09-01') or array of values. - /// When filtering over custom dimensions, this key - /// will be used as the name of the custom dimension. + + /// The column of the table over which the given query should run + /// + + /// A query operator to evaluate over the provided column and value(s). + /// Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have + /// the same behavior as they would in a KQL query. + /// + + /// the value for the operator to function over. This can be a number (e.g., > + /// 100), a string (timestamp >= '2017-09-01') or array of values. + /// + + /// When filtering over custom dimensions, this key will be used as the name of + /// the custom dimension. + /// public WorkspacePurgeBodyFilters(string column = default(string), string operatorProperty = default(string), object value = default(object), string key = default(string)) + { - Column = column; - OperatorProperty = operatorProperty; - Value = value; - Key = key; + this.Column = column; + this.OperatorProperty = operatorProperty; + this.Value = value; + this.Key = key; CustomInit(); } @@ -55,36 +54,34 @@ public WorkspacePurgeBodyFilters() /// partial void CustomInit(); + /// - /// Gets or sets the column of the table over which the given query - /// should run + /// Gets or sets the column of the table over which the given query should run /// - [JsonProperty(PropertyName = "column")] - public string Column { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "column")] + public string Column {get; set; } /// - /// Gets or sets a query operator to evaluate over the provided column - /// and value(s). Supported operators are ==, =~, in, in~, &gt;, - /// &gt;=, &lt;, &lt;=, between, and have the same behavior - /// as they would in a KQL query. + /// Gets or sets a query operator to evaluate over the provided column and + /// value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + /// and have the same behavior as they would in a KQL query. /// - [JsonProperty(PropertyName = "operator")] - public string OperatorProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public string OperatorProperty {get; set; } /// - /// Gets or sets the value for the operator to function over. This can - /// be a number (e.g., &gt; 100), a string (timestamp &gt;= - /// '2017-09-01') or array of values. + /// Gets or sets the value for the operator to function over. This can be a + /// number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + /// values. /// - [JsonProperty(PropertyName = "value")] - public object Value { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public object Value {get; set; } /// - /// Gets or sets when filtering over custom dimensions, this key will - /// be used as the name of the custom dimension. + /// Gets or sets when filtering over custom dimensions, this key will be used + /// as the name of the custom dimension. /// - [JsonProperty(PropertyName = "key")] - public string Key { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "key")] + public string Key {get; set; } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs new file mode 100644 index 000000000000..6b87cab63929 --- /dev/null +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeHeaders.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using System.Linq; + + public partial class WorkspacePurgeHeaders + { + /// + /// Initializes a new instance of the WorkspacePurgeHeaders class. + /// + public WorkspacePurgeHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspacePurgeHeaders class. + /// + + /// + /// + public WorkspacePurgeHeaders(string xmsStatusLocation = default(string)) + + { + this.XMSStatusLocation = xmsStatusLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-status-location")] + public string XMSStatusLocation {get; set; } + } +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs deleted file mode 100644 index 729968083c35..000000000000 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgePurgeHeaders.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.OperationalInsights.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for Purge operation. - /// - public partial class WorkspacePurgePurgeHeaders - { - /// - /// Initializes a new instance of the WorkspacePurgePurgeHeaders class. - /// - public WorkspacePurgePurgeHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WorkspacePurgePurgeHeaders class. - /// - /// The location from which to request - /// the operation status. - public WorkspacePurgePurgeHeaders(string xMsStatusLocation = default(string)) - { - XMsStatusLocation = xMsStatusLocation; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location from which to request the operation - /// status. - /// - [JsonProperty(PropertyName = "x-ms-status-location")] - public string XMsStatusLocation { get; set; } - - } -} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs index f248a8c344b2..f98a47b3b92e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeResponse.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,11 +23,13 @@ public WorkspacePurgeResponse() /// /// Initializes a new instance of the WorkspacePurgeResponse class. /// - /// Id to use when querying for status for a - /// particular purge operation. + + /// Id to use when querying for status for a particular purge operation. + /// public WorkspacePurgeResponse(string operationId) + { - OperationId = operationId; + this.OperationId = operationId; CustomInit(); } @@ -43,25 +38,26 @@ public WorkspacePurgeResponse(string operationId) /// partial void CustomInit(); + /// - /// Gets or sets id to use when querying for status for a particular - /// purge operation. + /// Gets or sets id to use when querying for status for a particular purge + /// operation. /// - [JsonProperty(PropertyName = "operationId")] - public string OperationId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "operationId")] + public string OperationId {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (OperationId == null) + if (this.OperationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "OperationId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "OperationId"); } + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs index dc9439c0c469..723ec07033be 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspacePurgeStatusResponse.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -20,8 +13,7 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models public partial class WorkspacePurgeStatusResponse { /// - /// Initializes a new instance of the WorkspacePurgeStatusResponse - /// class. + /// Initializes a new instance of the WorkspacePurgeStatusResponse class. /// public WorkspacePurgeStatusResponse() { @@ -29,15 +21,15 @@ public WorkspacePurgeStatusResponse() } /// - /// Initializes a new instance of the WorkspacePurgeStatusResponse - /// class. + /// Initializes a new instance of the WorkspacePurgeStatusResponse class. /// - /// Status of the operation represented by the - /// requested Id. Possible values include: 'pending', - /// 'completed' + + /// Status of the operation represented by the requested Id. + /// Possible values include: 'pending', 'completed' public WorkspacePurgeStatusResponse(string status) + { - Status = status; + this.Status = status; CustomInit(); } @@ -46,25 +38,25 @@ public WorkspacePurgeStatusResponse(string status) /// partial void CustomInit(); + /// - /// Gets or sets status of the operation represented by the requested - /// Id. Possible values include: 'pending', 'completed' + /// Gets or sets status of the operation represented by the requested Id. Possible values include: 'pending', 'completed' /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Status == null) + if (this.Status == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Status"); } + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs index 7a9c6153a300..d7c70db6bc65 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSku.cs @@ -1,17 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { - using Microsoft.Rest; - using Newtonsoft.Json; using System.Linq; /// @@ -30,19 +23,24 @@ public WorkspaceSku() /// /// Initializes a new instance of the WorkspaceSku class. /// - /// The name of the SKU. Possible values include: - /// 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', - /// 'Standalone', 'CapacityReservation', 'LACluster' - /// The capacity reservation - /// level in GB for this workspace, when CapacityReservation sku is - /// selected. - /// The last time when the sku was - /// updated. + + /// The name of the SKU. + /// Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', + /// 'PerGB2018', 'Standalone', 'CapacityReservation', 'LACluster' + + /// The capacity reservation level in GB for this workspace, when + /// CapacityReservation sku is selected. + /// Possible values include: '100', '200', '300', '400', '500', '1000', '2000', + /// '5000' + + /// The last time when the sku was updated. + /// public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) + { - Name = name; - CapacityReservationLevel = capacityReservationLevel; - LastSkuUpdate = lastSkuUpdate; + this.Name = name; + this.CapacityReservationLevel = capacityReservationLevel; + this.LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -51,39 +49,40 @@ public WorkspaceSku() /// partial void CustomInit(); + /// - /// Gets or sets the name of the SKU. Possible values include: 'Free', - /// 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', - /// 'CapacityReservation', 'LACluster' + /// Gets or sets the name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation', 'LACluster' /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// - /// Gets or sets the capacity reservation level in GB for this - /// workspace, when CapacityReservation sku is selected. + /// Gets or sets the capacity reservation level in GB for this workspace, when + /// CapacityReservation sku is selected. Possible values include: '100', '200', '300', '400', '500', '1000', '2000', '5000' /// - [JsonProperty(PropertyName = "capacityReservationLevel")] - public int? CapacityReservationLevel { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "capacityReservationLevel")] + public int? CapacityReservationLevel {get; set; } /// /// Gets the last time when the sku was updated. /// - [JsonProperty(PropertyName = "lastSkuUpdate")] - public string LastSkuUpdate { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Name == null) + if (this.Name == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); } + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs index 8706725bae8d..613ab63b2568 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Models/WorkspaceSkuNameEnum.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models /// /// Defines values for WorkspaceSkuNameEnum. /// + + public static class WorkspaceSkuNameEnum { public const string Free = "Free"; @@ -25,4 +22,4 @@ public static class WorkspaceSkuNameEnum public const string CapacityReservation = "CapacityReservation"; public const string LACluster = "LACluster"; } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs index c2d691db9046..07b352e550f1 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// OperationStatusesOperations operations. /// - internal partial class OperationStatusesOperations : IServiceOperations, IOperationStatusesOperations + internal partial class OperationStatusesOperations : Microsoft.Rest.IServiceOperations, IOperationStatusesOperations { /// /// Initializes a new instance of the OperationStatusesOperations class. @@ -36,13 +24,13 @@ internal partial class OperationStatusesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal OperationStatusesOperations(OperationalInsightsManagementClient client) + internal OperationStatusesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,48 +68,58 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, string asyncOperationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } + if (asyncOperationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "asyncOperationId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "asyncOperationId"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("asyncOperationId", asyncOperationId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}").ToString(); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{asyncOperationId}", System.Uri.EscapeDataString(asyncOperationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -131,25 +129,24 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -161,55 +158,56 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -219,9 +217,10 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -232,24 +231,28 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs index c4e6012e0ee1..6a9b8282f142 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationStatusesOperationsExtensions.cs @@ -1,65 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for OperationStatusesOperations. + /// Extension methods for OperationStatusesOperations /// public static partial class OperationStatusesOperationsExtensions { - /// - /// Get the status of a long running azure asynchronous operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region name of operation. - /// - /// - /// The operation Id. - /// - public static OperationStatus Get(this IOperationStatusesOperations operations, string location, string asyncOperationId) - { - return operations.GetAsync(location, asyncOperationId).GetAwaiter().GetResult(); - } + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + public static OperationStatus Get(this IOperationStatusesOperations operations, string location, string asyncOperationId) + { + return ((IOperationStatusesOperations)operations).GetAsync(location, asyncOperationId).GetAwaiter().GetResult(); + } - /// - /// Get the status of a long running azure asynchronous operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The region name of operation. - /// - /// - /// The operation Id. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IOperationStatusesOperations operations, string location, string asyncOperationId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the status of a long running azure asynchronous operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The region name of operation. + /// + /// + /// The operation Id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IOperationStatusesOperations operations, string location, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, asyncOperationId, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(location, asyncOperationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs index 30dcc115a3e5..8e1d907c1932 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs @@ -1,171 +1,140 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - public partial class OperationalInsightsManagementClient : ServiceClient, IOperationalInsightsManagementClient, IAzureClient + /// + /// Azure Log Analytics API reference + /// + public partial class OperationalInsightsManagementClient : Microsoft.Rest.ServiceClient, IOperationalInsightsManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The ID of the target subscription. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// /// set to true a unique x-ms-client-request-id value is generated and + /// /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IWorkspacesOperations. + /// Gets the IWorkspacesOperations /// public virtual IWorkspacesOperations Workspaces { get; private set; } - /// - /// Gets the IDeletedWorkspacesOperations. + /// Gets the IDeletedWorkspacesOperations /// public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } - /// - /// Gets the ITablesOperations. + /// Gets the ITablesOperations /// public virtual ITablesOperations Tables { get; private set; } - /// - /// Gets the IDataExportsOperations. + /// Gets the IDataExportsOperations /// public virtual IDataExportsOperations DataExports { get; private set; } - /// - /// Gets the IDataSourcesOperations. + /// Gets the IDataSourcesOperations /// public virtual IDataSourcesOperations DataSources { get; private set; } - /// - /// Gets the IIntelligencePacksOperations. + /// Gets the IIntelligencePacksOperations /// public virtual IIntelligencePacksOperations IntelligencePacks { get; private set; } - /// - /// Gets the ILinkedServicesOperations. + /// Gets the ILinkedServicesOperations /// public virtual ILinkedServicesOperations LinkedServices { get; private set; } - /// - /// Gets the ILinkedStorageAccountsOperations. + /// Gets the ILinkedStorageAccountsOperations /// public virtual ILinkedStorageAccountsOperations LinkedStorageAccounts { get; private set; } - /// - /// Gets the IManagementGroupsOperations. + /// Gets the IManagementGroupsOperations /// public virtual IManagementGroupsOperations ManagementGroups { get; private set; } - /// - /// Gets the IOperationStatusesOperations. + /// Gets the IOperationStatusesOperations /// public virtual IOperationStatusesOperations OperationStatuses { get; private set; } - /// - /// Gets the ISharedKeysOperations. + /// Gets the ISharedKeysOperations /// public virtual ISharedKeysOperations SharedKeys { get; private set; } - /// - /// Gets the IUsagesOperations. + /// Gets the IUsagesOperations /// public virtual IUsagesOperations Usages { get; private set; } - /// - /// Gets the IStorageInsightConfigsOperations. + /// Gets the IStorageInsightConfigsOperations /// public virtual IStorageInsightConfigsOperations StorageInsightConfigs { get; private set; } - /// - /// Gets the ISavedSearchesOperations. + /// Gets the ISavedSearchesOperations /// public virtual ISavedSearchesOperations SavedSearches { get; private set; } - /// - /// Gets the IAvailableServiceTiersOperations. + /// Gets the IAvailableServiceTiersOperations /// public virtual IAvailableServiceTiersOperations AvailableServiceTiers { get; private set; } - /// - /// Gets the IGatewaysOperations. + /// Gets the IGatewaysOperations /// public virtual IGatewaysOperations Gateways { get; private set; } - /// - /// Gets the ISchemaOperations. + /// Gets the ISchemaOperations /// public virtual ISchemaOperations Schema { get; private set; } - /// - /// Gets the IWorkspacePurgeOperations. + /// Gets the IWorkspacePurgeOperations /// public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } - /// - /// Gets the IClustersOperations. + /// Gets the IClustersOperations /// public virtual IClustersOperations Clusters { get; private set; } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -174,24 +143,22 @@ public partial class OperationalInsightsManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling OperationalInsightsManagementClient.Dispose(). False: will not dispose provided httpClient - protected OperationalInsightsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected OperationalInsightsManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected OperationalInsightsManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected OperationalInsightsManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the OperationalInsightsManagementClient class. + /// Initializes a new instance of the OperationalInsightsManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -199,11 +166,10 @@ protected OperationalInsightsManagementClient(params DelegatingHandler[] handler /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected OperationalInsightsManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected OperationalInsightsManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -216,15 +182,14 @@ protected OperationalInsightsManagementClient(HttpClientHandler rootHandler, par /// /// Thrown when a required parameter is null /// - protected OperationalInsightsManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected OperationalInsightsManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -240,15 +205,15 @@ protected OperationalInsightsManagementClient(System.Uri baseUri, params Delegat /// /// Thrown when a required parameter is null /// - protected OperationalInsightsManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected OperationalInsightsManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -261,23 +226,23 @@ protected OperationalInsightsManagementClient(System.Uri baseUri, HttpClientHand /// /// Thrown when a required parameter is null /// - public OperationalInsightsManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -288,23 +253,23 @@ public OperationalInsightsManagementClient(ServiceClientCredentials credentials, /// /// Thrown when a required parameter is null /// - public OperationalInsightsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -316,26 +281,26 @@ public OperationalInsightsManagementClient(ServiceClientCredentials credentials, /// /// Thrown when a required parameter is null /// - public OperationalInsightsManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public OperationalInsightsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -344,7 +309,7 @@ public OperationalInsightsManagementClient(ServiceClientCredentials credentials, /// /// Thrown when a required parameter is null /// - public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public OperationalInsightsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -354,33 +319,30 @@ public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public OperationalInsightsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -390,76 +352,77 @@ public OperationalInsightsManagementClient(System.Uri baseUri, ServiceClientCred { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - Operations = new Operations(this); - Workspaces = new WorkspacesOperations(this); - DeletedWorkspaces = new DeletedWorkspacesOperations(this); - Tables = new TablesOperations(this); - DataExports = new DataExportsOperations(this); - DataSources = new DataSourcesOperations(this); - IntelligencePacks = new IntelligencePacksOperations(this); - LinkedServices = new LinkedServicesOperations(this); - LinkedStorageAccounts = new LinkedStorageAccountsOperations(this); - ManagementGroups = new ManagementGroupsOperations(this); - OperationStatuses = new OperationStatusesOperations(this); - SharedKeys = new SharedKeysOperations(this); - Usages = new UsagesOperations(this); - StorageInsightConfigs = new StorageInsightConfigsOperations(this); - SavedSearches = new SavedSearchesOperations(this); - AvailableServiceTiers = new AvailableServiceTiersOperations(this); - Gateways = new GatewaysOperations(this); - Schema = new SchemaOperations(this); - WorkspacePurge = new WorkspacePurgeOperations(this); - Clusters = new ClustersOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.Operations = new Operations(this); + this.Workspaces = new WorkspacesOperations(this); + this.DeletedWorkspaces = new DeletedWorkspacesOperations(this); + this.Tables = new TablesOperations(this); + this.DataExports = new DataExportsOperations(this); + this.DataSources = new DataSourcesOperations(this); + this.IntelligencePacks = new IntelligencePacksOperations(this); + this.LinkedServices = new LinkedServicesOperations(this); + this.LinkedStorageAccounts = new LinkedStorageAccountsOperations(this); + this.ManagementGroups = new ManagementGroupsOperations(this); + this.OperationStatuses = new OperationStatusesOperations(this); + this.SharedKeys = new SharedKeysOperations(this); + this.Usages = new UsagesOperations(this); + this.StorageInsightConfigs = new StorageInsightConfigsOperations(this); + this.SavedSearches = new SavedSearchesOperations(this); + this.AvailableServiceTiers = new AvailableServiceTiersOperations(this); + this.Gateways = new GatewaysOperations(this); + this.Schema = new SchemaOperations(this); + this.WorkspacePurge = new WorkspacePurgeOperations(this); + this.Clusters = new ClustersOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs index 8780c7fb6d41..0fc6d6f2007c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations /// Thrown when a required parameter is null /// - internal Operations(OperationalInsightsManagementClient client) + internal Operations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,33 +47,47 @@ internal Operations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.OperationalInsights/operations").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -95,25 +97,24 @@ internal Operations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -125,50 +126,51 @@ internal Operations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -178,9 +180,10 @@ internal Operations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -191,25 +194,29 @@ internal Operations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists all of the available OperationalInsights Rest API operations. /// @@ -222,13 +229,13 @@ internal Operations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -237,51 +244,54 @@ internal Operations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -293,50 +303,51 @@ internal Operations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -346,9 +357,10 @@ internal Operations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -359,24 +371,28 @@ internal Operations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs index 88b7fd3d4e71..3b0a4657215b 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationsExtensions.cs @@ -1,87 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// Lists all of the available OperationalInsights Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Lists all of the available OperationalInsights Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists all of the available OperationalInsights Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + /// + /// Lists all of the available OperationalInsights Rest API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists all of the available OperationalInsights Rest API operations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs index cb8dcc2f74ff..d9acacf34111 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SavedSearchesOperations operations. /// - internal partial class SavedSearchesOperations : IServiceOperations, ISavedSearchesOperations + internal partial class SavedSearchesOperations : Microsoft.Rest.IServiceOperations, ISavedSearchesOperations { /// /// Initializes a new instance of the SavedSearchesOperations class. @@ -36,13 +24,13 @@ internal partial class SavedSearchesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SavedSearchesOperations(OperationalInsightsManagementClient client) + internal SavedSearchesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -68,10 +56,10 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,80 +68,89 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (savedSearchId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -163,25 +160,24 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -193,55 +189,56 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -251,20 +248,25 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Creates or updates a saved search for a given workspace. /// @@ -286,13 +288,13 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -301,89 +303,98 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId == null) { - if (Client.SubscriptionId.Length < 1) + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (savedSearchId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -393,25 +404,24 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -423,61 +433,62 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -487,9 +498,10 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -500,25 +512,29 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the specified saved search for a given workspace. /// @@ -537,13 +553,13 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -552,80 +568,89 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string savedSearchId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (savedSearchId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "savedSearchId"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -635,25 +660,24 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -665,55 +689,56 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -723,9 +748,10 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -736,25 +762,29 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets the saved searches for a given Log Analytics Workspace /// @@ -770,13 +800,13 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -785,74 +815,82 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -862,25 +900,24 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -892,55 +929,56 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -950,9 +988,10 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -963,24 +1002,28 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs index bd0160bdcf68..659376f14822 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SavedSearchesOperationsExtensions.cs @@ -1,206 +1,187 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SavedSearchesOperations. + /// Extension methods for SavedSearchesOperations /// public static partial class SavedSearchesOperationsExtensions { - /// - /// Deletes the specified saved search in a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - public static void Delete(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified saved search in a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static void Delete(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + ((ISavedSearchesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a saved search for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - /// - /// The parameters required to save a search. - /// - public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchId, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes the specified saved search in a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters) + { + return ((ISavedSearchesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchId, parameters).GetAwaiter().GetResult(); + } - /// - /// Creates or updates a saved search for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - /// - /// The parameters required to save a search. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Creates or updates a saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + public static SavedSearch Get(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + { + return ((ISavedSearchesOperations)operations).GetAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + } - /// - /// Gets the specified saved search for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - public static SavedSearch Get(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) + /// + /// Gets the specified saved search for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The id of the saved search. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SavedSearchesListResult ListByWorkspace(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISavedSearchesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets the specified saved search for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The id of the saved search. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the saved searches for a given Log Analytics Workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ListByWorkspaceAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// Gets the saved searches for a given Log Analytics Workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static SavedSearchesListResult ListByWorkspace(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets the saved searches for a given Log Analytics Workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task ListByWorkspaceAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs index 3681f0a61987..934332e07d19 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SchemaOperations operations. /// - internal partial class SchemaOperations : IServiceOperations, ISchemaOperations + internal partial class SchemaOperations : Microsoft.Rest.IServiceOperations, ISchemaOperations { /// /// Initializes a new instance of the SchemaOperations class. @@ -36,13 +24,13 @@ internal partial class SchemaOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SchemaOperations(OperationalInsightsManagementClient client) + internal SchemaOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal SchemaOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal SchemaOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal SchemaOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +182,56 @@ internal SchemaOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +241,10 @@ internal SchemaOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,24 +255,28 @@ internal SchemaOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs index dbeb3dd2bc27..c4777bf098c5 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SchemaOperationsExtensions.cs @@ -1,65 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SchemaOperations. + /// Extension methods for SchemaOperations /// public static partial class SchemaOperationsExtensions { - /// - /// Gets the schema for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static SearchGetSchemaResponse Get(this ISchemaOperations operations, string resourceGroupName, string workspaceName) - { - return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SearchGetSchemaResponse Get(this ISchemaOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISchemaOperations)operations).GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets the schema for a given workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISchemaOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the schema for a given workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ISchemaOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs deleted file mode 100644 index 0d1aeeb16983..000000000000 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SdkInfo_OperationalInsightsManagementClient.cs +++ /dev/null @@ -1,46 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.OperationalInsights -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_OperationalInsightsManagementClient - { - get - { - return new Tuple[] - { - new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-08-01"), - new Tuple("OperationalInsights", "Clusters", "2021-06-01"), - new Tuple("OperationalInsights", "DataExports", "2020-08-01"), - new Tuple("OperationalInsights", "DataSources", "2020-08-01"), - new Tuple("OperationalInsights", "DeletedWorkspaces", "2021-12-01-preview"), - new Tuple("OperationalInsights", "Gateways", "2020-08-01"), - new Tuple("OperationalInsights", "IntelligencePacks", "2020-08-01"), - new Tuple("OperationalInsights", "LinkedServices", "2020-08-01"), - new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-08-01"), - new Tuple("OperationalInsights", "ManagementGroups", "2020-08-01"), - new Tuple("OperationalInsights", "OperationStatuses", "2020-08-01"), - new Tuple("OperationalInsights", "Operations", "2021-12-01-preview"), - new Tuple("OperationalInsights", "SavedSearches", "2020-08-01"), - new Tuple("OperationalInsights", "Schema", "2020-08-01"), - new Tuple("OperationalInsights", "SharedKeys", "2020-08-01"), - new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-08-01"), - new Tuple("OperationalInsights", "Tables", "2021-12-01-preview"), - new Tuple("OperationalInsights", "Usages", "2020-08-01"), - new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), - new Tuple("OperationalInsights", "Workspaces", "2021-12-01-preview"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs index 3ff3be59e77f..8dd1e24f0c63 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SharedKeysOperations operations. /// - internal partial class SharedKeysOperations : IServiceOperations, ISharedKeysOperations + internal partial class SharedKeysOperations : Microsoft.Rest.IServiceOperations, ISharedKeysOperations { /// /// Initializes a new instance of the SharedKeysOperations class. @@ -36,13 +24,13 @@ internal partial class SharedKeysOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SharedKeysOperations(OperationalInsightsManagementClient client) + internal SharedKeysOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetSharedKeysWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSharedKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSharedKeys", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +182,56 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +241,10 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,25 +255,29 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Regenerates the shared keys for a Log Analytics Workspace. These keys are /// used to connect Microsoft Operational Insights agents to the workspace. @@ -293,13 +294,13 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -308,74 +309,82 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RegenerateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Regenerate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Regenerate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -385,25 +394,24 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -415,55 +423,56 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -473,9 +482,10 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -486,24 +496,28 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs index d867f85ec9ee..ae0e1f401eff 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/SharedKeysOperationsExtensions.cs @@ -1,107 +1,96 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SharedKeysOperations. + /// Extension methods for SharedKeysOperations /// public static partial class SharedKeysOperationsExtensions { - /// - /// Gets the shared keys for a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static SharedKeys GetSharedKeys(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) - { - return operations.GetSharedKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys GetSharedKeys(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISharedKeysOperations)operations).GetSharedKeysAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets the shared keys for a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task GetSharedKeysAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the shared keys for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetSharedKeysAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetSharedKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetSharedKeysWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static SharedKeys Regenerate(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + { + return ((ISharedKeysOperations)operations).RegenerateAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Regenerates the shared keys for a Log Analytics Workspace. These keys are - /// used to connect Microsoft Operational Insights agents to the workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static SharedKeys Regenerate(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName) + /// + /// Regenerates the shared keys for a Log Analytics Workspace. These keys are + /// used to connect Microsoft Operational Insights agents to the workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task RegenerateAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.RegenerateAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Regenerates the shared keys for a Log Analytics Workspace. These keys are - /// used to connect Microsoft Operational Insights agents to the workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task RegenerateAsync(this ISharedKeysOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs index f9aaa53440c2..c2a47e947bb9 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// StorageInsightConfigsOperations operations. /// - internal partial class StorageInsightConfigsOperations : IServiceOperations, IStorageInsightConfigsOperations + internal partial class StorageInsightConfigsOperations : Microsoft.Rest.IServiceOperations, IStorageInsightConfigsOperations { /// /// Initializes a new instance of the StorageInsightConfigsOperations class. @@ -36,13 +24,13 @@ internal partial class StorageInsightConfigsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal StorageInsightConfigsOperations(OperationalInsightsManagementClient client) + internal StorageInsightConfigsOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -71,13 +59,13 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -86,89 +74,98 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (storageInsightName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -178,25 +175,24 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -208,61 +204,62 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -272,9 +269,10 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -285,16 +283,16 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -303,25 +301,29 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets a storage insight instance. /// @@ -340,13 +342,13 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -355,80 +357,89 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (storageInsightName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -438,25 +449,24 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -468,55 +478,56 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -526,9 +537,10 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -539,25 +551,29 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a storageInsightsConfigs resource /// @@ -576,10 +592,10 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -588,80 +604,89 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string storageInsightName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (storageInsightName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storageInsightName"); } - if (Client.SubscriptionId == null) + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -671,25 +696,24 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -701,55 +725,56 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -759,20 +784,25 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists the storage insight instances within a workspace /// @@ -788,13 +818,13 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -803,74 +833,82 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -880,25 +918,24 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -910,55 +947,56 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -968,9 +1006,10 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -981,25 +1020,29 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Lists the storage insight instances within a workspace /// @@ -1012,13 +1055,13 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1027,51 +1070,54 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspaceNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1083,55 +1129,56 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1141,9 +1188,10 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1154,24 +1202,28 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs index d6a7241509a6..3b27ad81ad8c 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/StorageInsightConfigsOperationsExtensions.cs @@ -1,240 +1,220 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for StorageInsightConfigsOperations. + /// Extension methods for StorageInsightConfigsOperations /// public static partial class StorageInsightConfigsOperationsExtensions { - /// - /// Create or update a storage insight. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - /// - /// The parameters required to create or update a storage insight. - /// - public static StorageInsight CreateOrUpdate(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, storageInsightName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a storage insight. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - /// - /// The parameters required to create or update a storage insight. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a storage insight instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - public static StorageInsight Get(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) - { - return operations.GetAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); - } + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static StorageInsight CreateOrUpdate(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters) + { + return ((IStorageInsightConfigsOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, storageInsightName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets a storage insight instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a storage insight. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, StorageInsight parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static StorageInsight Get(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + return ((IStorageInsightConfigsOperations)operations).GetAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } - /// - /// Deletes a storageInsightsConfigs resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - public static void Delete(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + /// + /// Gets a storage insight instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + public static void Delete(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName) + { + ((IStorageInsightConfigsOperations)operations).DeleteAsync(resourceGroupName, workspaceName, storageInsightName).GetAwaiter().GetResult(); + } - /// - /// Deletes a storageInsightsConfigs resource - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Name of the storageInsightsConfigs resource - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists the storage insight instances within a workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IPage ListByWorkspace(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Deletes a storageInsightsConfigs resource + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Name of the storageInsightsConfigs resource + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, string storageInsightName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, storageInsightName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspace(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName) + { + return ((IStorageInsightConfigsOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Lists the storage insight instances within a workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this IStorageInsightConfigsOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByWorkspaceNext(this IStorageInsightConfigsOperations operations, string nextPageLink) + { + return ((IStorageInsightConfigsOperations)operations).ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Lists the storage insight instances within a workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByWorkspaceNext(this IStorageInsightConfigsOperations operations, string nextPageLink) + /// + /// Lists the storage insight instances within a workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceNextAsync(this IStorageInsightConfigsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByWorkspaceNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Lists the storage insight instances within a workspace - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceNextAsync(this IStorageInsightConfigsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs index 68ab5674a04a..0270705b85a9 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// TablesOperations operations. /// - internal partial class TablesOperations : IServiceOperations, ITablesOperations + internal partial class TablesOperations : Microsoft.Rest.IServiceOperations, ITablesOperations { /// /// Initializes a new instance of the TablesOperations class. @@ -36,13 +24,13 @@ internal partial class TablesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TablesOperations(OperationalInsightsManagementClient client) + internal TablesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,50 +182,51 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -240,9 +236,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -253,25 +250,29 @@ internal TablesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update or Create a Log Analytics workspace table. /// @@ -288,16 +289,16 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// The parameters required to update table properties. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse
_response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse
_response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -316,16 +317,16 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// The parameters required to update table properties. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse
_response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse
_response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -346,13 +347,13 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -361,80 +362,89 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (tableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -444,25 +454,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -474,50 +483,51 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -527,9 +537,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse
(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse
(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -540,25 +551,29 @@ internal TablesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a Log Analytics workspace table. /// @@ -572,16 +587,16 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// The name of the table. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -604,10 +619,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -616,80 +631,89 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task MigrateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (tableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Migrate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -699,25 +723,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -729,50 +752,51 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -782,20 +806,25 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update or Create a Log Analytics workspace table. /// @@ -817,13 +846,13 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -832,89 +861,98 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (tableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -924,25 +962,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -954,56 +991,57 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1013,9 +1051,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse
(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse
(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1026,25 +1065,29 @@ internal TablesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Update a Log Analytics workspace table. /// @@ -1066,13 +1109,13 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1081,85 +1124,94 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (tableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1169,25 +1221,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1199,56 +1250,57 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1258,9 +1310,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse
(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse
(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1271,25 +1324,29 @@ internal TablesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete a Log Analytics workspace table. /// @@ -1308,10 +1365,10 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1320,80 +1377,89 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (tableName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("tableName", tableName); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1403,25 +1469,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1433,50 +1498,51 @@ internal TablesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1486,19 +1552,24 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs index cecdd43a657e..2abec86ab36e 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/TablesOperationsExtensions.cs @@ -1,454 +1,410 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for TablesOperations. + /// Extension methods for TablesOperations /// public static partial class TablesOperationsExtensions { - /// - /// Gets all the tables for the specified Log Analytics workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all the tables for the specified Log Analytics workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update or Create a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - public static Table CreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update or Create a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - /// - /// The cancellation token. - /// - public static async Task
CreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) - { - return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - /// - /// The cancellation token. - /// - public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) + { + return ((ITablesOperations)operations).ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - public static Table Get(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table CreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Gets a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The cancellation token. - /// - public static async Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
CreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Delete a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - public static void Delete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Get(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + return ((ITablesOperations)operations).GetAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } - /// - /// Delete a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Delete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } - /// - /// Migrate a Log Analytics table from support of the Data Collector API and - /// Custom Fields features to support of Data Collection Rule-based Custom - /// Logs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - public static void Migrate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) - { - operations.MigrateAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); - } - - /// - /// Migrate a Log Analytics table from support of the Data Collector API and - /// Custom Fields features to support of Data Collection Rule-based Custom - /// Logs. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The cancellation token. - /// - public static async Task MigrateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Update or Create a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - public static Table BeginCreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); - } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void Migrate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).MigrateAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } - /// - /// Update or Create a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - /// - /// The cancellation token. - /// - public static async Task
BeginCreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - public static Table BeginUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) - { - return operations.BeginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Update a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The parameters required to update table properties. - /// - /// - /// The cancellation token. - /// - public static async Task
BeginUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// Migrate a Log Analytics table from support of the Data Collector API and + /// Custom Fields features to support of Data Collection Rule-based Custom + /// Logs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MigrateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.MigrateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table BeginCreateOrUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Delete a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - public static void BeginDelete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + /// + /// Update or Create a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
BeginCreateOrUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table BeginUpdate(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return ((ITablesOperations)operations).BeginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } - /// - /// Delete a Log Analytics workspace table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The name of the table. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Update a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task
BeginUpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static void BeginDelete(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + ((ITablesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + /// + /// Delete a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs index 9dc81912a309..0b422e927f81 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// UsagesOperations operations. /// - internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + internal partial class UsagesOperations : Microsoft.Rest.IServiceOperations, IUsagesOperations { /// /// Initializes a new instance of the UsagesOperations class. @@ -36,13 +24,13 @@ internal partial class UsagesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal UsagesOperations(OperationalInsightsManagementClient client) + internal UsagesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -65,13 +53,13 @@ internal UsagesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -80,74 +68,82 @@ internal UsagesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -157,25 +153,24 @@ internal UsagesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -187,55 +182,56 @@ internal UsagesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -245,9 +241,10 @@ internal UsagesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -258,24 +255,28 @@ internal UsagesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs index 0f082fe105a3..c4da1f915b7b 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/UsagesOperationsExtensions.cs @@ -1,67 +1,55 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for UsagesOperations. + /// Extension methods for UsagesOperations /// public static partial class UsagesOperationsExtensions { - /// - /// Gets a list of usage metrics for a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static IEnumerable List(this IUsagesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static System.Collections.Generic.IEnumerable List(this IUsagesOperations operations, string resourceGroupName, string workspaceName) + { + return ((IUsagesOperations)operations).ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Gets a list of usage metrics for a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IUsagesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a list of usage metrics for a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IUsagesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs index 421f17d5e458..903371711e95 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacePurgeOperations operations. /// - internal partial class WorkspacePurgeOperations : IServiceOperations, IWorkspacePurgeOperations + internal partial class WorkspacePurgeOperations : Microsoft.Rest.IServiceOperations, IWorkspacePurgeOperations { /// /// Initializes a new instance of the WorkspacePurgeOperations class. @@ -36,13 +24,13 @@ internal partial class WorkspacePurgeOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) + internal WorkspacePurgeOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -52,7 +40,6 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) /// /// Purges data in an Log Analytics workspace by a set of user-defined filters. - /// /// In order to manage system resources, purge requests are throttled at 50 /// requests per hour. You should batch the execution of purge requests by /// sending a single command whose predicate includes all user identities that @@ -76,13 +63,13 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -91,83 +78,91 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> PurgeWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (body == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) - { - body.Validate(); - } string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Purge", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Purge", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -177,25 +172,24 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -207,61 +201,62 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(body != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -271,9 +266,10 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -284,38 +280,42 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets status of an ongoing purge operation. /// @@ -335,13 +335,13 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -350,80 +350,89 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string purgeId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } if (purgeId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "purgeId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "purgeId"); } + string apiVersion = "2020-08-01"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("purgeId", purgeId); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPurgeStatus", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetPurgeStatus", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{purgeId}", System.Uri.EscapeDataString(purgeId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -433,25 +442,24 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -463,55 +471,56 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -521,9 +530,10 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -534,24 +544,28 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs index 7a9c982bbd8e..f61934c4be32 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacePurgeOperationsExtensions.cs @@ -1,135 +1,114 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WorkspacePurgeOperations. + /// Extension methods for WorkspacePurgeOperations /// public static partial class WorkspacePurgeOperationsExtensions { - /// - /// Purges data in an Log Analytics workspace by a set of user-defined filters. - /// - /// In order to manage system resources, purge requests are throttled at 50 - /// requests per hour. You should batch the execution of purge requests by - /// sending a single command whose predicate includes all user identities that - /// require purging. Use the in operator to specify multiple identities. You - /// should run the query prior to using for a purge request to verify that the - /// results are expected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Describes the body of a request to purge data in a single table of an Log - /// Analytics Workspace - /// - public static WorkspacePurgeResponse Purge(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body) - { - return operations.PurgeAsync(resourceGroupName, workspaceName, body).GetAwaiter().GetResult(); - } + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static WorkspacePurgeResponse Purge(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body) + { + return ((IWorkspacePurgeOperations)operations).PurgeAsync(resourceGroupName, workspaceName, body).GetAwaiter().GetResult(); + } - /// - /// Purges data in an Log Analytics workspace by a set of user-defined filters. - /// - /// In order to manage system resources, purge requests are throttled at 50 - /// requests per hour. You should batch the execution of purge requests by - /// sending a single command whose predicate includes all user identities that - /// require purging. Use the in operator to specify multiple identities. You - /// should run the query prior to using for a purge request to verify that the - /// results are expected. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Describes the body of a request to purge data in a single table of an Log - /// Analytics Workspace - /// - /// - /// The cancellation token. - /// - public static async Task PurgeAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Purges data in an Log Analytics workspace by a set of user-defined filters. + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task PurgeAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, WorkspacePurgeBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.PurgeWithHttpMessagesAsync(resourceGroupName, workspaceName, body, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.PurgeWithHttpMessagesAsync(resourceGroupName, workspaceName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + public static WorkspacePurgeStatusResponse GetPurgeStatus(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId) + { + return ((IWorkspacePurgeOperations)operations).GetPurgeStatusAsync(resourceGroupName, workspaceName, purgeId).GetAwaiter().GetResult(); + } - /// - /// Gets status of an ongoing purge operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// In a purge status request, this is the Id of the operation the status of - /// which is returned. - /// - public static WorkspacePurgeStatusResponse GetPurgeStatus(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId) + /// + /// Gets status of an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetPurgeStatusAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetPurgeStatusWithHttpMessagesAsync(resourceGroupName, workspaceName, purgeId, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetPurgeStatusAsync(resourceGroupName, workspaceName, purgeId).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Gets status of an ongoing purge operation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// In a purge status request, this is the Id of the operation the status of - /// which is returned. - /// - /// - /// The cancellation token. - /// - public static async Task GetPurgeStatusAsync(this IWorkspacePurgeOperations operations, string resourceGroupName, string workspaceName, string purgeId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPurgeStatusWithHttpMessagesAsync(resourceGroupName, workspaceName, purgeId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs index 37ea4a2bed6a..c38dcfcc8f1f 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// WorkspacesOperations operations. /// - internal partial class WorkspacesOperations : IServiceOperations, IWorkspacesOperations + internal partial class WorkspacesOperations : Microsoft.Rest.IServiceOperations, IWorkspacesOperations { /// /// Initializes a new instance of the WorkspacesOperations class. @@ -36,13 +24,13 @@ internal partial class WorkspacesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WorkspacesOperations(OperationalInsightsManagementClient client) + internal WorkspacesOperations (OperationalInsightsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,36 +62,44 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -113,25 +109,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -143,50 +138,51 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +192,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,25 +206,29 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Gets workspaces in a resource group. /// @@ -240,13 +241,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -255,53 +256,61 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -311,25 +320,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -341,50 +349,51 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -394,9 +403,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -407,25 +417,29 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a workspace. /// @@ -439,16 +453,16 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// The parameters required to create or update a workspace. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -468,16 +482,16 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// deleted with this flag cannot be recovered. /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -495,13 +509,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -510,74 +524,82 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -587,25 +609,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -617,50 +638,51 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -670,9 +692,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -683,25 +706,29 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Updates a workspace. /// @@ -720,13 +747,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -735,79 +762,87 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -817,25 +852,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -847,56 +881,57 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -906,9 +941,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -919,25 +955,29 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update a workspace. /// @@ -956,13 +996,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -971,83 +1011,91 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Workspace parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (this.Client.SubscriptionId == null) { - parameters.Validate(); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1057,25 +1105,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1087,56 +1134,57 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1146,9 +1194,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1159,16 +1208,16 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -1177,25 +1226,29 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Deletes a workspace resource. To recover the workspace, create it again /// with the same name, in the same subscription, resource group and location. @@ -1218,10 +1271,10 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1230,107 +1283,115 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); } if (resourceGroupName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } if (workspaceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "workspaceName"); } if (workspaceName != null) { if (workspaceName.Length > 63) { - throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "workspaceName", 63); } if (workspaceName.Length < 4) { - throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "workspaceName", 4); } if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - if (Client.SubscriptionId == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2021-12-01-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("force", force); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (force != null) { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(force, this.Client.SerializationSettings).Trim('"')))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1342,50 +1403,51 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1395,19 +1457,24 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs index 360e15a73131..7681d1a435ab 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/WorkspacesOperationsExtensions.cs @@ -1,369 +1,332 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.OperationalInsights { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for WorkspacesOperations. + /// Extension methods for WorkspacesOperations /// public static partial class WorkspacesOperationsExtensions { - /// - /// Gets the workspaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IEnumerable List(this IWorkspacesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Gets the workspaces in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IWorkspacesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets workspaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static IEnumerable ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Gets workspaces in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to create or update a workspace. - /// - public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); - } + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IWorkspacesOperations operations) + { + return ((IWorkspacesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// Create or update a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to create or update a workspace. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets the workspaces in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IWorkspacesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IWorkspacesOperations operations, string resourceGroupName) + { + return ((IWorkspacesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// Deletes a workspace resource. To recover the workspace, create it again - /// with the same name, in the same subscription, resource group and location. - /// The name is kept for 14 days and cannot be used for another workspace. To - /// remove the workspace completely and release the name, use the force flag. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Deletes the workspace without the recovery option. A workspace that was - /// deleted with this flag cannot be recovered. - /// - public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + /// + /// Gets workspaces in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IWorkspacesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - operations.DeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace CreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return ((IWorkspacesOperations)operations).CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a workspace resource. To recover the workspace, create it again - /// with the same name, in the same subscription, resource group and location. - /// The name is kept for 14 days and cannot be used for another workspace. To - /// remove the workspace completely and release the name, use the force flag. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Deletes the workspace without the recovery option. A workspace that was - /// deleted with this flag cannot be recovered. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void Delete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + ((IWorkspacesOperations)operations).DeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } - /// - /// Gets a workspace instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets a workspace instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to patch a workspace. - /// - public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters) - { - return operations.UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to patch a workspace. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to create or update a workspace. - /// - public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); - } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace Get(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName) + { + return ((IWorkspacesOperations)operations).GetAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } - /// - /// Create or update a workspace. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters required to create or update a workspace. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Gets a workspace instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace Update(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters) + { + return ((IWorkspacesOperations)operations).UpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a workspace resource. To recover the workspace, create it again - /// with the same name, in the same subscription, resource group and location. - /// The name is kept for 14 days and cannot be used for another workspace. To - /// remove the workspace completely and release the name, use the force flag. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Deletes the workspace without the recovery option. A workspace that was - /// deleted with this flag cannot be recovered. - /// - public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + /// + /// Updates a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, WorkspacePatch parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - operations.BeginDeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static Workspace BeginCreateOrUpdate(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters) + { + return ((IWorkspacesOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).GetAwaiter().GetResult(); + } - /// - /// Deletes a workspace resource. To recover the workspace, create it again - /// with the same name, in the same subscription, resource group and location. - /// The name is kept for 14 days and cannot be used for another workspace. To - /// remove the workspace completely and release the name, use the force flag. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Deletes the workspace without the recovery option. A workspace that was - /// deleted with this flag cannot be recovered. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Create or update a workspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, Workspace parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, parameters, null, cancellationToken).ConfigureAwait(false)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return _result.Body; } + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + public static void BeginDelete(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?)) + { + ((IWorkspacesOperations)operations).BeginDeleteAsync(resourceGroupName, workspaceName, force).GetAwaiter().GetResult(); + } + /// + /// Deletes a workspace resource. To recover the workspace, create it again + /// with the same name, in the same subscription, resource group and location. + /// The name is kept for 14 days and cannot be used for another workspace. To + /// remove the workspace completely and release the name, use the force flag. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Deletes the workspace without the recovery option. A workspace that was + /// deleted with this flag cannot be recovered. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IWorkspacesOperations operations, string resourceGroupName, string workspaceName, bool? force = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } } } diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md index cf6fcb51d72d..c618d28ff3fc 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/README.md @@ -5,14 +5,14 @@ This directory contains management plane service clients of Az.OperationalInsigh In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true openapi-type: arm @@ -54,9 +54,17 @@ output-folder: Generated namespace: Microsoft.Azure.Management.OperationalInsights directive: + # README suppress - from: OperationalInsights.json suppress: R3006 # BodyTopLevelProperties/R3006/RPCViolation reason: properties etag defined as eTag in model + # Model property rename + - where: + model-name: DataExport + property-name: PropertiesDestinationType + set: + property-name: DataExportType + # XML format error fix - from: Tables.json where: $.definitions.Column.properties.dataTypeHint transform: >- diff --git a/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json b/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json index 05af1bf54d0e..9279a137a0ca 100644 --- a/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json +++ b/src/OperationalInsights/OperationalInsights.Test/SessionRecords/Microsoft.Azure.Commands.OperationalInsights.Test.DataSourceTests/TestToggleSingletonDataSourceState.json @@ -1,24 +1,24 @@ { "Entries": [ { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/providers/Microsoft.OperationalInsights?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Byb3ZpZGVycy9NaWNyb3NvZnQuT3BlcmF0aW9uYWxJbnNpZ2h0cz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/providers/Microsoft.OperationalInsights?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Byb3ZpZGVycy9NaWNyb3NvZnQuT3BlcmF0aW9uYWxJbnNpZ2h0cz9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "ad939642-9528-4b95-81e8-e9c708b17f2d" + "ee61c05a-6d36-4f86-924e-eccc42b9551f" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.58" + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.102" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -27,16 +27,19 @@ "no-cache" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "249" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "973bcc0f-2a05-4096-a989-48ef5ac9560b" + "d971555d-3b92-43d2-b7a1-5dd65167122b" ], "x-ms-correlation-request-id": [ - "973bcc0f-2a05-4096-a989-48ef5ac9560b" + "d971555d-3b92-43d2-b7a1-5dd65167122b" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125130Z:973bcc0f-2a05-4096-a989-48ef5ac9560b" + "SOUTHEASTASIA:20241128T091711Z:d971555d-3b92-43d2-b7a1-5dd65167122b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -44,39 +47,44 @@ "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 45C7E82822404E96B6F519EBF9B7B82E Ref B: MAA201060513019 Ref C: 2024-11-28T09:17:11Z" + ], "Date": [ - "Thu, 07 Jul 2022 12:51:30 GMT" + "Thu, 28 Nov 2024 09:17:11 GMT" + ], + "Content-Length": [ + "16240" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" - ], - "Content-Length": [ - "11823" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/providers/Microsoft.OperationalInsights\",\r\n \"namespace\": \"Microsoft.OperationalInsights\",\r\n \"authorizations\": [\r\n {\r\n \"applicationId\": \"d2a0a418-0aac-4541-82b2-b3142c89da77\",\r\n \"roleDefinitionId\": \"86695298-2eb9-48a7-9ec3-2fdb38b6878b\"\r\n },\r\n {\r\n \"applicationId\": \"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5\",\r\n \"roleDefinitionId\": \"5d5a2e56-9835-44aa-93db-d2f19e155438\"\r\n }\r\n ],\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2021-06-01\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"querypacks\",\r\n \"locations\": [\r\n \"West Central US\",\r\n \"East US\",\r\n \"South Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"West US 2\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"Central India\",\r\n \"Japan East\",\r\n \"Australia East\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"East Asia\",\r\n \"West US\",\r\n \"South Africa North\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Norway East\",\r\n \"Australia Southeast\",\r\n \"Australia Central 2\",\r\n \"Germany West Central\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UK West\",\r\n \"Brazil Southeast\",\r\n \"Japan West\",\r\n \"UAE North\",\r\n \"Australia Central\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2019-09-01-preview\",\r\n \"2019-09-01\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationStatuses\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/scopedPrivateLinkProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/query\",\r\n \"locations\": [\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/metadata\",\r\n \"locations\": [\r\n \"East US 2 EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataSources\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedStorageAccounts\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/tables\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\",\r\n \"Sweden South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-07-01-privatepreview\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/storageInsightConfigs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"storageInsightConfigs\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2014-10-10\"\r\n ],\r\n \"capabilities\": \"SupportsExtension\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedServices\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"linkTargets\",\r\n \"locations\": [\r\n \"East US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"deletedWorkspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2014-11-10\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"clusters\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"Brazil South\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-06-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataExports\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"East US 2 EUAP\",\r\n \"Qatar Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/providers/Microsoft.OperationalInsights\",\r\n \"namespace\": \"Microsoft.OperationalInsights\",\r\n \"authorizations\": [\r\n {\r\n \"applicationId\": \"d2a0a418-0aac-4541-82b2-b3142c89da77\",\r\n \"roleDefinitionId\": \"86695298-2eb9-48a7-9ec3-2fdb38b6878b\"\r\n },\r\n {\r\n \"applicationId\": \"ca7f3f0b-7d91-482c-8e09-c5d840d0eac5\",\r\n \"roleDefinitionId\": \"5d5a2e56-9835-44aa-93db-d2f19e155438\"\r\n }\r\n ],\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2021-06-01\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"querypacks\",\r\n \"locations\": [\r\n \"West Central US\",\r\n \"East US\",\r\n \"South Central US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"West US 2\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"Central India\",\r\n \"Japan East\",\r\n \"Australia East\",\r\n \"Korea Central\",\r\n \"France Central\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"East Asia\",\r\n \"West US\",\r\n \"South Africa North\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Norway East\",\r\n \"Australia Southeast\",\r\n \"Australia Central 2\",\r\n \"Germany West Central\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UK West\",\r\n \"Brazil Southeast\",\r\n \"Japan West\",\r\n \"UAE North\",\r\n \"Australia Central\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2019-09-01-preview\",\r\n \"2019-09-01\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationStatuses\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2023-01-01-preview\",\r\n \"2022-10-01\",\r\n \"2022-09-01-privatepreview\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/workspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Australia Southeast\",\r\n \"UK South\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"Germany West Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/scopedPrivateLinkProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/api\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/query\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/metadata\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/purge\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2017-04-26-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2020-08-01\",\r\n \"2017-04-26-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataSources\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedStorageAccounts\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/tables\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-07-01-privatepreview\",\r\n \"2021-03-01-privatepreview\",\r\n \"2020-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/summaryLogs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-01-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/storageInsightConfigs\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia East\",\r\n \"Australia Central\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2017-04-26-preview\",\r\n \"2017-03-15-preview\",\r\n \"2017-03-03-preview\",\r\n \"2017-01-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"storageInsightConfigs\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2014-10-10\"\r\n ],\r\n \"capabilities\": \"SupportsExtension\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/linkedServices\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\",\r\n \"2015-11-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"linkTargets\",\r\n \"locations\": [\r\n \"East US\"\r\n ],\r\n \"apiVersions\": [\r\n \"2020-03-01-preview\",\r\n \"2015-03-20\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"deletedWorkspaces\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-12-01-preview\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2015-11-01-preview\",\r\n \"2014-11-10\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"clusters\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"Brazil South\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2022-10-01\",\r\n \"2021-06-01\",\r\n \"2020-10-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity\"\r\n },\r\n {\r\n \"resourceType\": \"workspaces/dataExports\",\r\n \"locations\": [\r\n \"East US\",\r\n \"West Europe\",\r\n \"Southeast Asia\",\r\n \"Australia Southeast\",\r\n \"West Central US\",\r\n \"Japan East\",\r\n \"UK South\",\r\n \"Central India\",\r\n \"Canada Central\",\r\n \"West US 2\",\r\n \"Australia Central\",\r\n \"Australia East\",\r\n \"France Central\",\r\n \"Korea Central\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US 2\",\r\n \"South Central US\",\r\n \"North Central US\",\r\n \"West US\",\r\n \"UK West\",\r\n \"South Africa North\",\r\n \"Brazil South\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"Germany West Central\",\r\n \"Australia Central 2\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"Japan West\",\r\n \"Brazil Southeast\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"France South\",\r\n \"South India\",\r\n \"Korea South\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Qatar Central\",\r\n \"Canada East\",\r\n \"West US 3\",\r\n \"Sweden Central\",\r\n \"South Africa West\",\r\n \"Germany North\",\r\n \"Poland Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Mexico Central\",\r\n \"Spain Central\"\r\n ],\r\n \"apiVersions\": [\r\n \"2023-09-01\",\r\n \"2020-08-01\",\r\n \"2020-03-01-preview\",\r\n \"2019-08-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/networkSecurityPerimeterAssociationProxies\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"workspaces/networkSecurityPerimeterConfigurations\",\r\n \"locations\": [\r\n \"East US\",\r\n \"East US 2\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/notifyNetworkSecurityPerimeterUpdatesAvailable\",\r\n \"locations\": [\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\",\r\n \"Australia Central\",\r\n \"Australia Central 2\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Brazil Southeast\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"Central India\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"France Central\",\r\n \"France South\",\r\n \"Germany North\",\r\n \"Germany West Central\",\r\n \"Israel Central\",\r\n \"Italy North\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Jio India Central\",\r\n \"Jio India West\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"Mexico Central\",\r\n \"North Central US\",\r\n \"North Europe\",\r\n \"Norway East\",\r\n \"Norway West\",\r\n \"Poland Central\",\r\n \"Qatar Central\",\r\n \"South Africa North\",\r\n \"South Africa West\",\r\n \"South Central US\",\r\n \"South India\",\r\n \"Southeast Asia\",\r\n \"Spain Central\",\r\n \"Sweden Central\",\r\n \"Switzerland North\",\r\n \"Switzerland West\",\r\n \"UAE Central\",\r\n \"UAE North\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West Central US\",\r\n \"West Europe\",\r\n \"West India\",\r\n \"West US\",\r\n \"West US 2\",\r\n \"West US 3\"\r\n ],\r\n \"apiVersions\": [\r\n \"2021-10-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388?api-version=2016-09-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MD9hcGktdmVyc2lvbj0yMDE2LTA5LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "41e6478d-cebd-45af-84d3-04ee1b1ad674" + "771f1d02-00c8-4510-9348-a1b4798e6a73" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", - "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.58" + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.102" ], "Content-Type": [ "application/json; charset=utf-8" @@ -85,6 +93,7 @@ "29" ] }, + "RequestBody": "{\r\n \"location\": \"East US\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -93,16 +102,19 @@ "no-cache" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "199" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "x-ms-correlation-request-id": [ - "46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125133Z:46f3fb26-cc11-4211-bd68-88a2c971fdbe" + "SOUTHEASTASIA:20241128T091715Z:b9aecc08-1814-4d4c-856c-fe8af22046c1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -110,8 +122,14 @@ "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F84EFBFF1964411ABEE964B8B105FC9D Ref B: MAA201060516035 Ref C: 2024-11-28T09:17:11Z" + ], "Date": [ - "Thu, 07 Jul 2022 12:51:32 GMT" + "Thu, 28 Nov 2024 09:17:15 GMT" ], "Content-Length": [ "165" @@ -123,25 +141,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388\",\r\n \"name\": \"ps3388\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050\",\r\n \"name\": \"ps2050\",\r\n \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063?api-version=2021-12-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"pergb2018\"\r\n },\r\n \"features\": {}\r\n },\r\n \"tags\": {},\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "623a1a4d-82c6-4092-8440-cc374e8ed2f0" + "14e5e7c6-ee59-4440-b3db-9f62d0f4a15a" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -151,6 +168,7 @@ "138" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"sku\": {\r\n \"name\": \"pergb2018\"\r\n },\r\n \"features\": {}\r\n },\r\n \"tags\": {},\r\n \"location\": \"East US\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -158,8 +176,11 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "Location": [ + "https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" ], "Request-Context": [ "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" @@ -167,57 +188,65 @@ "X-Content-Type-Options": [ "nosniff" ], - "x-ms-request-id": [ - "2bdb20a8-a2d9-4df3-9583-f2b1613fcf4a" + "api-supported-versions": [ + "2021-12-01-preview" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], "Access-Control-Allow-Origin": [ "*" ], - "Server": [ - "Microsoft-IIS/10.0" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" - ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-request-id": [ + "eeae3768-0cda-4260-97a5-07484f76ab5b" ], "x-ms-correlation-request-id": [ - "be68ef59-8516-4a46-975f-d09116d22f46" + "eeae3768-0cda-4260-97a5-07484f76ab5b" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125140Z:be68ef59-8516-4a46-975f-d09116d22f46" + "SOUTHEASTASIA:20241128T091720Z:eeae3768-0cda-4260-97a5-07484f76ab5b" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 429C39869692463CADA1EE0E67AEA12F Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:16Z" ], "Date": [ - "Thu, 07 Jul 2022 12:51:40 GMT" + "Thu, 28 Nov 2024 09:17:20 GMT" ], "Content-Length": [ - "1064" + "882" ], "Content-Type": [ - "application/json" + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": \"d4ba7b9b-b2b2-4782-84b8-cc164cd15a05\",\r\n \"provisioningState\": \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"Fri, 08 Jul 2022 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\",\r\n \"modifiedDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/microsoft.operationalinsights/workspaces/aztestps8063\",\r\n \"name\": \"AzTestps8063\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"location\": \"East US\",\r\n \"tags\": {}\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"customerId\": \"77403bf2-429b-4499-9107-94d05e38e491\",\r\n \"provisioningState\": \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"2024-11-29T00:00:00Z\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"2024-11-28T09:17:20.0083434Z\",\r\n \"modifiedDate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"location\": \"East US\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783\",\r\n \"name\": \"AzTestps6783\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"etag\": \"\\\"8e0963d8-0000-0100-0000-674835200000\\\"\"\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063?api-version=2021-12-01-preview", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783?api-version=2021-12-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlR3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODM/YXBpLXZlcnNpb249MjAyMS0xMi0wMS1wcmV2aWV3", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "623a1a4d-82c6-4092-8440-cc374e8ed2f0" + "14e5e7c6-ee59-4440-b3db-9f62d0f4a15a" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -225,11 +254,8 @@ "Pragma": [ "no-cache" ], - "Vary": [ - "Accept-Encoding" - ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" ], "Request-Context": [ "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" @@ -237,60 +263,68 @@ "X-Content-Type-Options": [ "nosniff" ], - "x-ms-request-id": [ - "29b45b44-2f24-4950-acfa-0ce3ccaf10af" + "api-supported-versions": [ + "2021-12-01-preview" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], "Access-Control-Allow-Origin": [ "*" ], - "Server": [ - "Microsoft-IIS/10.0" - ], - "X-Powered-By": [ - "ASP.NET", - "ASP.NET" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-request-id": [ + "b2606503-1cb1-4525-8d18-ce98a712d601" ], "x-ms-correlation-request-id": [ - "11542dd5-c810-4f98-9614-0d7f91b566a5" + "b2606503-1cb1-4525-8d18-ce98a712d601" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125210Z:11542dd5-c810-4f98-9614-0d7f91b566a5" + "SOUTHEASTASIA:20241128T091751Z:b2606503-1cb1-4525-8d18-ce98a712d601" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 8D2A7D1C0B3A4658BA48FA9903000D1C Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:50Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:10 GMT" + "Thu, 28 Nov 2024 09:17:50 GMT" ], "Content-Length": [ - "1065" + "882" ], "Content-Type": [ - "application/json" + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": \"d4ba7b9b-b2b2-4782-84b8-cc164cd15a05\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"Thu, 07 Jul 2022 12:51:39 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"Fri, 08 Jul 2022 02:00:00 GMT\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"Thu, 07 Jul 2022 12:51:39 GMT\",\r\n \"modifiedDate\": \"Thu, 07 Jul 2022 12:51:40 GMT\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/microsoft.operationalinsights/workspaces/aztestps8063\",\r\n \"name\": \"AzTestps8063\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"location\": \"East US\",\r\n \"tags\": {}\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"customerId\": \"77403bf2-429b-4499-9107-94d05e38e491\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": \"2024-11-28T09:17:20.0083434Z\"\r\n },\r\n \"retentionInDays\": 30,\r\n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": \"2024-11-29T00:00:00Z\",\r\n \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\": \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"createdDate\": \"2024-11-28T09:17:20.0083434Z\",\r\n \"modifiedDate\": \"2024-11-28T09:17:21.415792Z\"\r\n },\r\n \"location\": \"East US\",\r\n \"tags\": {},\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783\",\r\n \"name\": \"AzTestps6783\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n \"etag\": \"\\\"8e09b1d8-0000-0100-0000-674835210000\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -298,35 +332,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "69eb1109-5a3f-44ea-b845-066622a41cc9" ], "x-ms-correlation-request-id": [ - "8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "69eb1109-5a3f-44ea-b845-066622a41cc9" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125213Z:8642741e-d4bb-4d7c-a6b7-ee4e0c430daa" + "SOUTHEASTASIA:20241128T091752Z:69eb1109-5a3f-44ea-b845-066622a41cc9" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: E36C8260D3DB4A4C9046B28F3D2AEC2C Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:51Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:12 GMT" + "Thu, 28 Nov 2024 09:17:51 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -335,28 +381,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'IISLogs'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnSUlTTG9ncycmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -364,35 +410,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "fb4f3ef0-fda7-4254-816c-4e37f568e24f" ], "x-ms-correlation-request-id": [ - "4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "fb4f3ef0-fda7-4254-816c-4e37f568e24f" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125217Z:4aeed2f2-f33c-4c17-9ef8-1406975f076f" + "SOUTHEASTASIA:20241128T091757Z:fb4f3ef0-fda7-4254-816c-4e37f568e24f" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 754D8A6A818C452CB5B3772ADC22C892 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:56Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:17 GMT" + "Thu, 28 Nov 2024 09:17:56 GMT" ], "Content-Length": [ - "396" + "414" ], "Content-Type": [ "application/json; charset=utf-8" @@ -401,28 +459,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -430,65 +488,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], "x-ms-correlation-request-id": [ - "f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125213Z:f73ac3ee-4a6d-4a90-aa3f-f8dcab5b0b0b" + "SOUTHEASTASIA:20241128T091753Z:b9b1b6b8-5554-4ca4-9bfd-22c2b8e9a91a" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:13 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "103" + "X-MSEdge-Ref": [ + "Ref A: E340ADCB43E8433BA5EB9AF3EA17CC25 Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:52Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:17:53 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_IISLogs' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -496,32 +563,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "f27bc585-20f8-4f9c-8920-8c0ea52355b4" ], "x-ms-correlation-request-id": [ - "d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "f27bc585-20f8-4f9c-8920-8c0ea52355b4" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125218Z:d5407aa7-2412-4d0a-a3d3-dc01ad818dfb" + "SOUTHEASTASIA:20241128T091758Z:f27bc585-20f8-4f9c-8920-8c0ea52355b4" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 9A473DE0CB28402D867BBE345A89DA40 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:57Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:17 GMT" + "Thu, 28 Nov 2024 09:17:57 GMT" ], "Content-Length": [ "384" @@ -533,25 +612,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "4eb49314-cbd8-4334-9495-f1ec9980d176" + "47632c69-6ab2-47d9-8f82-6baf8d04d045" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -561,6 +639,7 @@ "83" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -568,32 +647,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "11ca8645-9521-4c89-9fc6-8788ec9d9807" + "f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" ], "x-ms-correlation-request-id": [ - "11ca8645-9521-4c89-9fc6-8788ec9d9807" + "f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125216Z:11ca8645-9521-4c89-9fc6-8788ec9d9807" + "SOUTHEASTASIA:20241128T091756Z:f8c6b3a2-9f84-470b-8265-f1ae4d4dee72" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 072CEF6A5BBC467C8DC1B092ECE56976 Ref B: MAA201060515051 Ref C: 2024-11-28T09:17:54Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:15 GMT" + "Thu, 28 Nov 2024 09:17:55 GMT" ], "Content-Length": [ "384" @@ -605,25 +696,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A15.5492550Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseEnabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A55.3116659Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_IISLogs?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_IISLogs?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9JSVNMb2dzP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "028a52d3-c19e-4f27-9fd7-1b0b1b0567a0" + "ae02cc85-8f11-4ede-a3b4-067c151609c7" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -633,6 +723,7 @@ "84" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -640,32 +731,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" ], "x-ms-correlation-request-id": [ - "603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125219Z:603b5649-95be-4c1b-8978-9eaa9d6eb38c" + "SOUTHEASTASIA:20241128T091800Z:bcea2be9-bf5d-4b78-8d3f-047a73dc4f35" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 98E2865AD75640B2A2F7DBF6DA6D95F2 Ref B: MAA201060514049 Ref C: 2024-11-28T09:17:58Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:19 GMT" + "Thu, 28 Nov 2024 09:18:00 GMT" ], "Content-Length": [ "385" @@ -677,28 +780,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"IISLogs\",\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_IISLogs\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A19.1346169Z'\\\"\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"OnPremiseDisabled\"\r\n },\r\n \"kind\": \"IISLogs\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_IISLogs\",\r\n \"name\": \"DataSource_IISLogs\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A17%3A59.9862421Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -706,35 +809,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "f841c730-d98f-460c-a795-a94d91fc7d00" + "8869f7a9-5cfb-4c6d-898b-82b476e86a67" ], "x-ms-correlation-request-id": [ - "f841c730-d98f-460c-a795-a94d91fc7d00" + "8869f7a9-5cfb-4c6d-898b-82b476e86a67" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125222Z:f841c730-d98f-460c-a795-a94d91fc7d00" + "SOUTHEASTASIA:20241128T091801Z:8869f7a9-5cfb-4c6d-898b-82b476e86a67" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 31FF638480FD4BB4B0847571303ECB4E Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:01Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:22 GMT" + "Thu, 28 Nov 2024 09:18:00 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -743,28 +858,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'CustomLogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnQ3VzdG9tTG9nQ29sbGVjdGlvbicmYXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -772,35 +887,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "02a8a307-5c4a-4b7b-a140-53f2aa5d327a" ], "x-ms-correlation-request-id": [ - "a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "02a8a307-5c4a-4b7b-a140-53f2aa5d327a" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125226Z:a8f6415b-88a9-4aa8-9b98-428121cf7a5b" + "SOUTHEASTASIA:20241128T091807Z:02a8a307-5c4a-4b7b-a140-53f2aa5d327a" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7833A6C0EBD74C6C88A416B7520B931F Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:06Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:26 GMT" + "Thu, 28 Nov 2024 09:18:06 GMT" ], "Content-Length": [ - "432" + "450" ], "Content-Type": [ "application/json; charset=utf-8" @@ -809,28 +936,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -838,65 +965,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "da77a132-3464-4143-b7e4-2e9d156c3daa" + "b0c616f6-2cc0-4668-af59-6b82f19fae71" ], "x-ms-correlation-request-id": [ - "da77a132-3464-4143-b7e4-2e9d156c3daa" + "b0c616f6-2cc0-4668-af59-6b82f19fae71" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125223Z:da77a132-3464-4143-b7e4-2e9d156c3daa" + "SOUTHEASTASIA:20241128T091803Z:b0c616f6-2cc0-4668-af59-6b82f19fae71" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:22 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "115" + "X-MSEdge-Ref": [ + "Ref A: 2BDB880EA9C5443CABA46E255E15F54E Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:01Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:03 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_CustomLogCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -904,32 +1040,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "d2006125-8004-4664-a8ae-dadbb5df2425" ], "x-ms-correlation-request-id": [ - "d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "d2006125-8004-4664-a8ae-dadbb5df2425" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125227Z:d6de031f-0517-4c0a-9f3d-62dc6e09d322" + "SOUTHEASTASIA:20241128T091808Z:d2006125-8004-4664-a8ae-dadbb5df2425" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: DCE7C80124D44ED8943ADDBD854CED32 Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:07Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:27 GMT" + "Thu, 28 Nov 2024 09:18:07 GMT" ], "Content-Length": [ "420" @@ -941,25 +1089,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "7bdf109d-4a8c-4a3d-bf43-6d1444dc401e" + "a1802172-8efc-4c78-9279-b6cef77450bf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -969,6 +1116,7 @@ "95" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -976,32 +1124,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "7e7f3218-1798-4805-b85b-f1e9cd948f56" + "01398287-5234-4757-9b3b-d44dc64ec30f" ], "x-ms-correlation-request-id": [ - "7e7f3218-1798-4805-b85b-f1e9cd948f56" + "01398287-5234-4757-9b3b-d44dc64ec30f" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125225Z:7e7f3218-1798-4805-b85b-f1e9cd948f56" + "SOUTHEASTASIA:20241128T091805Z:01398287-5234-4757-9b3b-d44dc64ec30f" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: CF7AA07329F844A397329D274728631F Ref B: MAA201060515051 Ref C: 2024-11-28T09:18:03Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:24 GMT" + "Thu, 28 Nov 2024 09:18:05 GMT" ], "Content-Length": [ "420" @@ -1013,25 +1173,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A24.5105456Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsEnabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A05.4274006Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_CustomLogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9DdXN0b21Mb2dDb2xsZWN0aW9uP2FwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "b5bf6ae8-c3c7-4a8f-b4ee-6b4a255c8a5d" + "64077949-fc9a-4d6a-82a7-c9cc15ef1979" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1041,6 +1200,7 @@ "96" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1048,32 +1208,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "5583fc78-2a5d-480b-adab-5ad284bec5ac" + "24785759-c369-4d79-9486-22ba6f451023" ], "x-ms-correlation-request-id": [ - "5583fc78-2a5d-480b-adab-5ad284bec5ac" + "24785759-c369-4d79-9486-22ba6f451023" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125228Z:5583fc78-2a5d-480b-adab-5ad284bec5ac" + "SOUTHEASTASIA:20241128T091812Z:24785759-c369-4d79-9486-22ba6f451023" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F1787745AFF441B4AA2B9141C5A114BC Ref B: MAA201060514009 Ref C: 2024-11-28T09:18:08Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:28 GMT" + "Thu, 28 Nov 2024 09:18:11 GMT" ], "Content-Length": [ "421" @@ -1085,28 +1257,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"CustomLogCollection\",\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_CustomLogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A28.3386924Z'\\\"\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"LinuxLogsDisabled\"\r\n },\r\n \"kind\": \"CustomLogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_CustomLogCollection\",\r\n \"name\": \"DataSource_CustomLogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A10.2990252Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1114,35 +1286,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "61544b67-c2cd-46a6-8ba7-7789b97eccf0" ], "x-ms-correlation-request-id": [ - "22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "61544b67-c2cd-46a6-8ba7-7789b97eccf0" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125231Z:22f0dd8b-0c3d-443b-8788-6ba057b5639c" + "SOUTHEASTASIA:20241128T091813Z:61544b67-c2cd-46a6-8ba7-7789b97eccf0" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 217CF92727E243478EF328A546BE097F Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:12Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:31 GMT" + "Thu, 28 Nov 2024 09:18:13 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1151,28 +1335,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxPerformanceCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhQZXJmb3JtYW5jZUNvbGxlY3Rpb24nJmFwaS12ZXJzaW9uPTIwMjAtMDgtMDE=", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1180,35 +1364,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a039e583-3963-427a-ad83-db471e78e4e1" + "5892b3e6-f91b-4c08-875b-24b3142bd1ea" ], "x-ms-correlation-request-id": [ - "a039e583-3963-427a-ad83-db471e78e4e1" + "5892b3e6-f91b-4c08-875b-24b3142bd1ea" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125236Z:a039e583-3963-427a-ad83-db471e78e4e1" + "SOUTHEASTASIA:20241128T091818Z:5892b3e6-f91b-4c08-875b-24b3142bd1ea" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: E3A190277B404668A989D7F012B1B300 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:17Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:36 GMT" + "Thu, 28 Nov 2024 09:18:17 GMT" ], "Content-Length": [ - "444" + "462" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1217,28 +1413,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1246,65 +1442,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "060a44b2-fec0-4572-8f83-1011558f51a0" + "5584c2c5-582f-4834-90e3-c69ec927196e" ], "x-ms-correlation-request-id": [ - "060a44b2-fec0-4572-8f83-1011558f51a0" + "5584c2c5-582f-4834-90e3-c69ec927196e" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125231Z:060a44b2-fec0-4572-8f83-1011558f51a0" + "SOUTHEASTASIA:20241128T091814Z:5584c2c5-582f-4834-90e3-c69ec927196e" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:31 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "122" + "X-MSEdge-Ref": [ + "Ref A: 613FA7D638AA4C3EB8C1FFB8BBD47A95 Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:14Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:14 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_LinuxPerformanceCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1312,32 +1517,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "9e5ba200-bb80-4873-b356-ad71d68d79f0" ], "x-ms-correlation-request-id": [ - "a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "9e5ba200-bb80-4873-b356-ad71d68d79f0" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125237Z:a32958b9-e5b1-4dde-bafa-76ed7ef9afa9" + "SOUTHEASTASIA:20241128T091819Z:9e5ba200-bb80-4873-b356-ad71d68d79f0" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 10EC7F0B26A241D9993DB132F69530D4 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:18Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:37 GMT" + "Thu, 28 Nov 2024 09:18:19 GMT" ], "Content-Length": [ "432" @@ -1349,25 +1566,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "80856c20-966d-4877-a98a-9d867560851b" + "01bfa5c0-d159-4f6f-a300-32e501977aaf" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1377,6 +1593,7 @@ "93" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1384,32 +1601,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "d0d84df8-4bbf-4b09-8f12-9479a4321140" + "426a0712-fdd7-409e-9a55-b7dcbef29336" ], "x-ms-correlation-request-id": [ - "d0d84df8-4bbf-4b09-8f12-9479a4321140" + "426a0712-fdd7-409e-9a55-b7dcbef29336" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125233Z:d0d84df8-4bbf-4b09-8f12-9479a4321140" + "SOUTHEASTASIA:20241128T091816Z:426a0712-fdd7-409e-9a55-b7dcbef29336" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: B899225916B147E5999B96D4754387AF Ref B: MAA201060514021 Ref C: 2024-11-28T09:18:14Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:33 GMT" + "Thu, 28 Nov 2024 09:18:16 GMT" ], "Content-Length": [ "432" @@ -1421,25 +1650,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A32.8158624Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A15.8233546Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxPerformanceCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFBlcmZvcm1hbmNlQ29sbGVjdGlvbj9hcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "aedc24ef-52d0-4039-94b1-9068e00e4127" + "ca41a0db-68b2-46ec-94ea-6aec8f392a13" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1449,6 +1677,7 @@ "94" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1456,32 +1685,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "67dc232b-3909-4619-9c60-68ebdde4b5ac" ], "x-ms-correlation-request-id": [ - "9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "67dc232b-3909-4619-9c60-68ebdde4b5ac" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125239Z:9689ea36-3cb1-4d21-9032-4b4b867f6b1e" + "SOUTHEASTASIA:20241128T091821Z:67dc232b-3909-4619-9c60-68ebdde4b5ac" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7B8C2D497DA14A669EE107FDD3F21619 Ref B: MAA201060516037 Ref C: 2024-11-28T09:18:19Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:39 GMT" + "Thu, 28 Nov 2024 09:18:20 GMT" ], "Content-Length": [ "433" @@ -1493,28 +1734,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A38.9698940Z'\\\"\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxPerformanceCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxPerformanceCollection\",\r\n \"name\": \"DataSource_LinuxPerformanceCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A20.7606956Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1522,35 +1763,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11999" + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "ced69d59-6945-487b-8c4a-7789af0f44fd" + "690e549c-76e7-4ae2-bb97-07067fea6e74" ], "x-ms-correlation-request-id": [ - "ced69d59-6945-487b-8c4a-7789af0f44fd" + "690e549c-76e7-4ae2-bb97-07067fea6e74" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125241Z:ced69d59-6945-487b-8c4a-7789af0f44fd" + "SOUTHEASTASIA:20241128T091822Z:690e549c-76e7-4ae2-bb97-07067fea6e74" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F32094D14124476582688724F820017B Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:21Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:41 GMT" + "Thu, 28 Nov 2024 09:18:22 GMT" ], "Content-Length": [ - "12" + "30" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1559,28 +1812,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": []\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources?$filter=kind%20eq%20'LinuxSyslogCollection'&api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXM/JGZpbHRlcj1raW5kJTIwZXElMjAnTGludXhTeXNsb2dDb2xsZWN0aW9uJyZhcGktdmVyc2lvbj0yMDIwLTA4LTAx", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1588,35 +1841,47 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "2622a637-b13c-45ce-bd30-8a8021c48601" + "eb35477d-75a6-445a-8f9d-9949ed2bd687" ], "x-ms-correlation-request-id": [ - "2622a637-b13c-45ce-bd30-8a8021c48601" + "eb35477d-75a6-445a-8f9d-9949ed2bd687" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125245Z:2622a637-b13c-45ce-bd30-8a8021c48601" + "SOUTHEASTASIA:20241128T091829Z:eb35477d-75a6-445a-8f9d-9949ed2bd687" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 96DFE2179BAB4153A0FCEBF5C6343002 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:27Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:45 GMT" + "Thu, 28 Nov 2024 09:18:28 GMT" ], "Content-Length": [ - "429" + "447" ], "Content-Type": [ "application/json; charset=utf-8" @@ -1625,28 +1890,28 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"__metadata\": null,\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1654,65 +1919,74 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11998" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "c88414d3-267e-42ca-aece-808b5853bd03" + "4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], "x-ms-correlation-request-id": [ - "c88414d3-267e-42ca-aece-808b5853bd03" + "4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125242Z:c88414d3-267e-42ca-aece-808b5853bd03" + "SOUTHEASTASIA:20241128T091825Z:4e881b8f-4e2b-4628-92fd-1c1faf3eab7c" ], - "Date": [ - "Thu, 07 Jul 2022 12:52:42 GMT" + "X-Cache": [ + "CONFIG_NOCACHE" ], - "Content-Length": [ - "117" + "X-MSEdge-Ref": [ + "Ref A: E71080E2E4FA411499EC0B9E68363FB9 Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:24Z" ], - "Content-Type": [ - "application/json; charset=utf-8" + "Date": [ + "Thu, 28 Nov 2024 09:18:25 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"DataSourceNotFound\",\r\n \"message\": \"DataSource 'DataSource_LinuxSyslogCollection' could not be found.\"\r\n }\r\n}", + "ResponseBody": "", "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "GET", - "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ] }, + "RequestBody": "", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1720,32 +1994,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-reads": [ + "249" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ - "11997" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "3749" ], "x-ms-request-id": [ - "5871d22f-ccfb-4334-9f1b-3684434b7a75" + "e34d2454-408e-4764-b453-961b71ef2973" ], "x-ms-correlation-request-id": [ - "5871d22f-ccfb-4334-9f1b-3684434b7a75" + "e34d2454-408e-4764-b453-961b71ef2973" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125246Z:5871d22f-ccfb-4334-9f1b-3684434b7a75" + "SOUTHEASTASIA:20241128T091830Z:e34d2454-408e-4764-b453-961b71ef2973" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 75984E64236D4BD5BA32858FDACED874 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:29Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:45 GMT" + "Thu, 28 Nov 2024 09:18:29 GMT" ], "Content-Length": [ "417" @@ -1757,25 +2043,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "8f676f4f-3d1b-4044-93e6-887108dfab22" + "0163b032-b35b-4311-aa0f-fd93ee0328f6" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1785,6 +2070,7 @@ "88" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1792,32 +2078,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" ], - "X-Powered-By": [ - "ASP.NET" + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "Access-Control-Allow-Origin": [ + "*" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "a900f068-c6af-4016-8440-f9f3ac2484f9" + "419c6e8e-d780-4a07-998e-b764e6ce0471" ], "x-ms-correlation-request-id": [ - "a900f068-c6af-4016-8440-f9f3ac2484f9" + "419c6e8e-d780-4a07-998e-b764e6ce0471" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125244Z:a900f068-c6af-4016-8440-f9f3ac2484f9" + "SOUTHEASTASIA:20241128T091827Z:419c6e8e-d780-4a07-998e-b764e6ce0471" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 613CDAD0F03043D8A0A3944C4B4C0612 Ref B: MAA201060514045 Ref C: 2024-11-28T09:18:25Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:44 GMT" + "Thu, 28 Nov 2024 09:18:27 GMT" ], "Content-Length": [ "417" @@ -1829,25 +2127,24 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A43.8046904Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A26.9582875Z'\\\"\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourcegroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlZ3JvdXBzL3BzMzM4OC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczgwNjMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", + "RequestUri": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/dataSources/DataSource_LinuxSyslogCollection?api-version=2020-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMGIxZjY0NzEtMWJmMC00ZGRhLWFlYzMtY2I5MjcyZjA5NTkwL3Jlc291cmNlZ3JvdXBzL3BzMjA1MC9wcm92aWRlcnMvTWljcm9zb2Z0Lk9wZXJhdGlvbmFsSW5zaWdodHMvd29ya3NwYWNlcy9BelRlc3RwczY3ODMvZGF0YVNvdXJjZXMvRGF0YVNvdXJjZV9MaW51eFN5c2xvZ0NvbGxlY3Rpb24/YXBpLXZlcnNpb249MjAyMC0wOC0wMQ==", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "6ca9d95a-2c55-4a37-ac68-c4c5e6a05f09" + "7e2a6662-06e2-44e1-aaf7-212adacb9fef" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.700.22.26002", + "FxVersion/6.0.3624.51421", "OSName/Windows", - "OSVersion/Microsoft.Windows.10.0.22000", + "OSVersion/Microsoft.Windows.10.0.26100", "Microsoft.Azure.Management.OperationalInsights.OperationalInsightsManagementClient/0.25.0.0" ], "Content-Type": [ @@ -1857,6 +2154,7 @@ "89" ] }, + "RequestBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\"\r\n}", "ResponseHeaders": { "Cache-Control": [ "no-cache" @@ -1864,32 +2162,44 @@ "Pragma": [ "no-cache" ], - "Strict-Transport-Security": [ - "max-age=31536000; includeSubDomains" + "x-ms-ratelimit-remaining-subscription-writes": [ + "199" + ], + "Request-Context": [ + "appId=cid-v1:e6336c63-aab2-45f0-996a-e5dbab2a1508" ], "X-Content-Type-Options": [ "nosniff" ], - "Server": [ - "Microsoft-IIS/10.0" + "api-supported-versions": [ + "2015-03-20, 2015-11-01-preview, 2017-01-01-preview, 2017-03-03-preview, 2017-03-15-preview, 2017-04-26-preview, 2020-03-01-preview, 2020-08-01, 2020-10-01, 2023-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" ], - "X-Powered-By": [ - "ASP.NET" + "Access-Control-Allow-Origin": [ + "*" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "2999" ], "x-ms-request-id": [ - "9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "6a353ebe-6ea0-41be-a31f-29e6e3c9c722" ], "x-ms-correlation-request-id": [ - "9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "6a353ebe-6ea0-41be-a31f-29e6e3c9c722" ], "x-ms-routing-request-id": [ - "FRANCESOUTH:20220707T125248Z:9fdf1c4e-f4a5-47f8-8b04-a382a747bccb" + "SOUTHEASTASIA:20241128T091832Z:6a353ebe-6ea0-41be-a31f-29e6e3c9c722" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 5FC78B69491C4AF0AC9C86396450D682 Ref B: MAA201060516017 Ref C: 2024-11-28T09:18:30Z" ], "Date": [ - "Thu, 07 Jul 2022 12:52:47 GMT" + "Thu, 28 Nov 2024 09:18:31 GMT" ], "Content-Length": [ "418" @@ -1901,17 +2211,17 @@ "-1" ] }, - "ResponseBody": "{\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps3388/providers/Microsoft.OperationalInsights/workspaces/AzTestps8063/datasources/DataSource_LinuxSyslogCollection\",\r\n \"etag\": \"W/\\\"datetime'2022-07-07T12%3A52%3A47.4284730Z'\\\"\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"kind\": \"LinuxSyslogCollection\",\r\n \"id\": \"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/ps2050/providers/Microsoft.OperationalInsights/workspaces/AzTestps6783/datasources/DataSource_LinuxSyslogCollection\",\r\n \"name\": \"DataSource_LinuxSyslogCollection\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces/datasources\",\r\n \"etag\": \"W/\\\"datetime'2024-11-28T09%3A18%3A31.6797759Z'\\\"\"\r\n}", "StatusCode": 200 } ], "Names": { "Test-ToggleSingletonDataSourceState": [ - "ps8063", - "ps3388" + "ps6783", + "ps2050" ] }, "Variables": { - "SubscriptionId": "57947cb5-aadd-4b6c-9e8e-27f545bb7bf5" + "SubscriptionId": "0b1f6471-1bf0-4dda-aec3-cb9272f09590" } } \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs b/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs index 1afa6f80268b..579e88a4f869 100644 --- a/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs +++ b/src/OperationalInsights/OperationalInsights/Client/OperationalInsightsClient.DataSources.cs @@ -41,7 +41,7 @@ public virtual List ListDataSources(string resourceGroupName, stri // List data sources by kind var response = OperationalInsightsManagementClient.DataSources.ListByWorkspace( - new ODataQuery(ds => ds.Kind == kind), resourceGroupName, workspaceName); + resourceGroupName, workspaceName, new ODataQuery(ds => ds.Kind == kind)); while (null != response) { diff --git a/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs b/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs index cc9d56f67bcb..91987a96d6ff 100644 --- a/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs +++ b/src/OperationalInsights/OperationalInsights/Models/PSLinkedService.cs @@ -62,7 +62,7 @@ public PSLinkedService(LinkedService service) public LinkedService getLinkedService() { - return new LinkedService(this.Id, this.Name, this.Type, this.ResourceId, this.WriteAccessResourceId, this.ProvisioningState, this.Tags); + return new LinkedService(this.Id, this.Name, this.Type, this.Tags, this.ResourceId, this.WriteAccessResourceId, this.ProvisioningState); } } } From a04a797ab8185f72b27352487121450b996b1d2d Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:47:19 +0800 Subject: [PATCH 3/4] Add change log and edit test project reference --- .../OperationalInsights.Test/OperationalInsights.Test.csproj | 5 ++++- src/OperationalInsights/OperationalInsights/ChangeLog.md | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj b/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj index c54bc5269125..12e08a0ca7c5 100644 --- a/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj +++ b/src/OperationalInsights/OperationalInsights.Test/OperationalInsights.Test.csproj @@ -11,9 +11,12 @@ - + + + + \ No newline at end of file diff --git a/src/OperationalInsights/OperationalInsights/ChangeLog.md b/src/OperationalInsights/OperationalInsights/ChangeLog.md index d6b6c2a29037..62bebfa51d2b 100644 --- a/src/OperationalInsights/OperationalInsights/ChangeLog.md +++ b/src/OperationalInsights/OperationalInsights/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Removed "Microsoft.Azure.Management.OperationalInsights" Version "0.25.0-preview" PackageReference. ## Version 3.2.1 * Fixed an issue that `Invoke-AzOperationalInsightsQuery` timed out after 100 seconds. The timeout is now bound to the `-Wait` parameter. (#16553) From 8d606e1ab47991688fade173949798158ce11450 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:02:17 +0800 Subject: [PATCH 4/4] sync up latest autorest generated code --- .../Generated/OperationalInsightsManagementClient.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs index 8e1d907c1932..a10fd1aa23bf 100644 --- a/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs +++ b/src/OperationalInsights/OperationalInsights.Management.Sdk/Generated/OperationalInsightsManagementClient.cs @@ -339,6 +339,9 @@ public OperationalInsightsManagementClient(System.Uri baseUri, Microsoft.Rest.Se /// /// Optional. The http client handler used to handle http transport. /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// /// /// Thrown when a required parameter is null ///