From 0da0419379564dc28702fff26e508d4aca39c660 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 9 Nov 2023 05:53:26 +0000 Subject: [PATCH] CodeGen from PR 26636 in Azure/azure-rest-api-specs Merge d7d3d347cd6fdb63b476c0851594be712caeb383 into ed84b11847785792767b0b84cc6f98f4ea08ca77 --- .../Azure.Analytics.Defender.Easm.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.Analytics.Defender.Easm/README.md | 86 + .../src/Azure.Analytics.Defender.Easm.csproj | 20 + .../src/Generated/AlexaInfo.Serialization.cs | 93 + .../src/Generated/AlexaInfo.cs | 50 + ...ticsDefenderEasmClientBuilderExtensions.cs | 38 + .../AnalyticsDefenderEasmModelFactory.cs | 1527 +++++++ .../src/Generated/AsAsset.Serialization.cs | 388 ++ .../src/Generated/AsAsset.cs | 148 + .../AsAssetResource.Serialization.cs | 166 + .../src/Generated/AsAssetResource.cs | 52 + .../AssetPageResult.Serialization.cs | 74 + .../src/Generated/AssetPageResult.cs | 48 + .../Generated/AssetResource.Serialization.cs | 46 + .../src/Generated/AssetResource.cs | 90 + .../AssetSecurityPolicy.Serialization.cs | 115 + .../src/Generated/AssetSecurityPolicy.cs | 61 + .../src/Generated/AssetState.cs | 65 + .../AssetSummaryResult.Serialization.cs | 115 + .../src/Generated/AssetSummaryResult.cs | 69 + .../AssetUpdateData.Serialization.cs | 55 + .../src/Generated/AssetUpdateData.cs | 44 + .../src/Generated/AssetUpdateState.cs | 63 + .../src/Generated/AssetUpdateTransfers.cs | 69 + .../src/Generated/Attribute.Serialization.cs | 105 + .../src/Generated/Attribute.cs | 57 + .../Generated/AuditTrailItem.Serialization.cs | 70 + .../src/Generated/AuditTrailItem.cs | 44 + .../src/Generated/AuditTrailItemKind.cs | 69 + ...ataExplorerDataConnection.Serialization.cs | 143 + .../AzureDataExplorerDataConnection.cs | 49 + ...xplorerDataConnectionData.Serialization.cs | 53 + .../AzureDataExplorerDataConnectionData.cs | 42 + ...rDataConnectionProperties.Serialization.cs | 83 + ...ureDataExplorerDataConnectionProperties.cs | 36 + .../src/Generated/Banner.Serialization.cs | 127 + .../src/Generated/Banner.cs | 69 + .../Generated/ContactAsset.Serialization.cs | 119 + .../src/Generated/ContactAsset.cs | 59 + .../ContactAssetResource.Serialization.cs | 166 + .../src/Generated/ContactAssetResource.cs | 52 + .../src/Generated/Cookie.Serialization.cs | 99 + .../src/Generated/Cookie.cs | 54 + .../src/Generated/Cve.Serialization.cs | 68 + .../src/Generated/Cve.cs | 40 + .../Generated/Cvss3Summary.Serialization.cs | 150 + .../src/Generated/Cvss3Summary.cs | 92 + .../Generated/DataConnection.Serialization.cs | 40 + .../src/Generated/DataConnection.cs | 78 + .../src/Generated/DataConnectionContent.cs | 51 + .../DataConnectionData.Serialization.cs | 51 + .../src/Generated/DataConnectionData.cs | 48 + .../src/Generated/DataConnectionFrequency.cs | 54 + .../src/Generated/DataConnectionProperties.cs | 18 + .../DependentResource.Serialization.cs | 232 ++ .../src/Generated/DependentResource.cs | 126 + .../src/Generated/DiscoGroup.Serialization.cs | 149 + .../src/Generated/DiscoGroup.cs | 79 + .../Generated/DiscoGroupData.Serialization.cs | 84 + .../src/Generated/DiscoGroupData.cs | 62 + .../Generated/DiscoRunResult.Serialization.cs | 139 + .../src/Generated/DiscoRunResult.cs | 67 + .../src/Generated/DiscoRunState.cs | 57 + .../Generated/DiscoSource.Serialization.cs | 76 + .../src/Generated/DiscoSource.cs | 32 + .../src/Generated/DiscoSourceKind.cs | 63 + .../Generated/DiscoTemplate.Serialization.cs | 115 + .../src/Generated/DiscoTemplate.cs | 69 + .../src/Generated/Docs/EasmClient.xml | 3203 +++++++++++++++ .../Generated/DomainAsset.Serialization.cs | 469 +++ .../src/Generated/DomainAsset.cs | 177 + .../DomainAssetResource.Serialization.cs | 166 + .../src/Generated/DomainAssetResource.cs | 52 + .../src/Generated/EasmClient.cs | 3491 ++++++++++++++++ .../src/Generated/EasmClientOptions.cs | 37 + .../Generated/ErrorDetail.Serialization.cs | 80 + .../src/Generated/ErrorDetail.cs | 57 + .../src/Generated/GuidPair.Serialization.cs | 69 + .../src/Generated/GuidPair.cs | 42 + .../src/Generated/HostAsset.Serialization.cs | 490 +++ .../src/Generated/HostAsset.cs | 186 + .../HostAssetResource.Serialization.cs | 166 + .../src/Generated/HostAssetResource.cs | 52 + .../src/Generated/HostCore.Serialization.cs | 405 ++ .../src/Generated/HostCore.cs | 178 + .../src/Generated/InnerError.Serialization.cs | 53 + .../src/Generated/InnerError.cs | 63 + .../src/Generated/InventoryAsset.cs | 18 + .../Generated/IpAddressAsset.Serialization.cs | 379 ++ .../src/Generated/IpAddressAsset.cs | 147 + .../IpAddressAssetResource.Serialization.cs | 166 + .../src/Generated/IpAddressAssetResource.cs | 52 + .../src/Generated/IpBlock.Serialization.cs | 99 + .../src/Generated/IpBlock.cs | 53 + .../Generated/IpBlockAsset.Serialization.cs | 446 +++ .../src/Generated/IpBlockAsset.cs | 174 + .../IpBlockAssetResource.Serialization.cs | 166 + .../src/Generated/IpBlockAssetResource.cs | 52 + .../src/Generated/Location.Serialization.cs | 122 + .../src/Generated/Location.cs | 68 + ...ogAnalyticsDataConnection.Serialization.cs | 143 + .../Generated/LogAnalyticsDataConnection.cs | 49 + ...alyticsDataConnectionData.Serialization.cs | 53 + .../LogAnalyticsDataConnectionData.cs | 42 + ...sDataConnectionProperties.Serialization.cs | 72 + .../LogAnalyticsDataConnectionProperties.cs | 32 + .../ObservedBoolean.Serialization.cs | 103 + .../src/Generated/ObservedBoolean.cs | 41 + .../Generated/ObservedHeader.Serialization.cs | 89 + .../src/Generated/ObservedHeader.cs | 38 + .../ObservedInteger.Serialization.cs | 103 + .../src/Generated/ObservedInteger.cs | 41 + .../ObservedIntegers.Serialization.cs | 108 + .../src/Generated/ObservedIntegers.cs | 42 + .../ObservedLocation.Serialization.cs | 103 + .../src/Generated/ObservedLocation.cs | 41 + .../Generated/ObservedLong.Serialization.cs | 103 + .../src/Generated/ObservedLong.cs | 41 + .../ObservedPortState.Serialization.cs | 97 + .../src/Generated/ObservedPortState.cs | 38 + .../src/Generated/ObservedPortStateValue.cs | 53 + .../Generated/ObservedString.Serialization.cs | 99 + .../src/Generated/ObservedString.cs | 41 + .../src/Generated/ObservedValue.cs | 42 + .../src/Generated/PageAsset.Serialization.cs | 854 ++++ .../src/Generated/PageAsset.cs | 318 ++ .../src/Generated/PageAssetRedirectType.cs | 56 + .../PageAssetResource.Serialization.cs | 166 + .../src/Generated/PageAssetResource.cs | 52 + .../src/Generated/PageCause.Serialization.cs | 94 + .../src/Generated/PageCause.cs | 52 + .../src/Generated/Port.Serialization.cs | 77 + .../src/Generated/Port.cs | 42 + ...eportAssetSnapshotRequest.Serialization.cs | 49 + .../Generated/ReportAssetSnapshotRequest.cs | 40 + ...ReportAssetSnapshotResult.Serialization.cs | 81 + .../Generated/ReportAssetSnapshotResult.cs | 50 + ...ReportAssetSummaryRequest.Serialization.cs | 74 + .../Generated/ReportAssetSummaryRequest.cs | 54 + .../ReportAssetSummaryResult.Serialization.cs | 52 + .../src/Generated/ReportAssetSummaryResult.cs | 32 + ...ortBillableAssetBreakdown.Serialization.cs | 56 + .../Generated/ReportBillableAssetBreakdown.cs | 32 + .../ReportBillableAssetBreakdownKind.cs | 54 + ...llableAssetSnapshotResult.Serialization.cs | 73 + .../ReportBillableAssetSnapshotResult.cs | 41 + ...illableAssetSummaryResult.Serialization.cs | 52 + .../ReportBillableAssetSummaryResult.cs | 32 + .../src/Generated/Reputation.Serialization.cs | 105 + .../src/Generated/Reputation.cs | 58 + .../Generated/ResourceUrl.Serialization.cs | 103 + .../src/Generated/ResourceUrl.cs | 53 + .../Generated/SavedFilter.Serialization.cs | 66 + .../src/Generated/SavedFilter.cs | 44 + .../SavedFilterData.Serialization.cs | 33 + .../src/Generated/SavedFilterData.cs | 34 + .../Generated/ScanMetadata.Serialization.cs | 73 + .../src/Generated/ScanMetadata.cs | 42 + .../src/Generated/Service.Serialization.cs | 169 + .../src/Generated/Service.cs | 77 + .../src/Generated/SoaRecord.Serialization.cs | 99 + .../src/Generated/SoaRecord.cs | 54 + .../src/Generated/Source.Serialization.cs | 79 + .../src/Generated/Source.cs | 46 + .../Generated/SslCertAsset.Serialization.cs | 433 ++ .../src/Generated/SslCertAsset.cs | 177 + .../SslCertAssetResource.Serialization.cs | 166 + .../src/Generated/SslCertAssetResource.cs | 52 + .../Generated/SslCertAssetValidationType.cs | 53 + .../SslServerConfig.Serialization.cs | 113 + .../src/Generated/SslServerConfig.cs | 55 + ...SubResourceIntegrityCheck.Serialization.cs | 107 + .../Generated/SubResourceIntegrityCheck.cs | 62 + .../src/Generated/Task.Serialization.cs | 122 + .../src/Generated/Task.cs | 90 + .../src/Generated/TaskPhase.cs | 54 + .../src/Generated/TaskState.cs | 66 + .../UnknownAssetResource.Serialization.cs | 160 + .../src/Generated/UnknownAssetResource.cs | 40 + .../UnknownDataConnection.Serialization.cs | 137 + .../src/Generated/UnknownDataConnection.cs | 37 + .../Generated/ValidateResult.Serialization.cs | 46 + .../src/Generated/ValidateResult.cs | 28 + .../Generated/WebComponent.Serialization.cs | 172 + .../src/Generated/WebComponent.cs | 84 + .../src/Properties/AssemblyInfo.cs | 11 + ...Azure.Analytics.Defender.Easm.Tests.csproj | 29 + .../Generated/Samples/Samples_EasmClient.cs | 3513 +++++++++++++++++ .../tsp-location.yaml | 5 + sdk/easm/ci.yml | 35 + 192 files changed, 29548 insertions(+) create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/Azure.Analytics.Defender.Easm.sln create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/CHANGELOG.md create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/Directory.Build.props create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/README.md create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Azure.Analytics.Defender.Easm.csproj create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmClientBuilderExtensions.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateTransfers.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItemKind.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionContent.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionFrequency.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionProperties.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSourceKind.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InventoryAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortStateValue.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedValue.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetRedirectType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdownKind.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetValidationType.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskPhase.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskState.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.Serialization.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/src/Properties/AssemblyInfo.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/tests/Azure.Analytics.Defender.Easm.Tests.csproj create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs create mode 100644 sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml create mode 100644 sdk/easm/ci.yml diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/Azure.Analytics.Defender.Easm.sln b/sdk/easm/Azure.Analytics.Defender.Easm/Azure.Analytics.Defender.Easm.sln new file mode 100644 index 000000000000..e25acf848d57 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/Azure.Analytics.Defender.Easm.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Analytics.Defender.Easm", "src\Azure.Analytics.Defender.Easm.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Analytics.Defender.Easm.Tests", "tests\Azure.Analytics.Defender.Easm.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/CHANGELOG.md b/sdk/easm/Azure.Analytics.Defender.Easm/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/Directory.Build.props b/sdk/easm/Azure.Analytics.Defender.Easm/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/README.md b/sdk/easm/Azure.Analytics.Defender.Easm/README.md new file mode 100644 index 000000000000..e02611eaab8e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/README.md @@ -0,0 +1,86 @@ +# Azure.Analytics.Defender.Easm client library for .NET + +Azure.Analytics.Defender.Easm is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/easm/Azure.Analytics.Defender.Easm/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Analytics.Defender.Easm --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/easm/Azure.Analytics.Defender.Easm/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/easm/Azure.Analytics.Defender.Easm/README.png) diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Azure.Analytics.Defender.Easm.csproj b/sdk/easm/Azure.Analytics.Defender.Easm/src/Azure.Analytics.Defender.Easm.csproj new file mode 100644 index 000000000000..f68bcce66d81 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Azure.Analytics.Defender.Easm.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.Analytics.Defender.Easm client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Analytics.Defender.Easm for Azure Data Plane + 1.0.0-beta.1 + Azure.Analytics.Defender.Easm + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.Serialization.cs new file mode 100644 index 000000000000..d94fa3a7acdf --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.Serialization.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AlexaInfo + { + internal static AlexaInfo DeserializeAlexaInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional alexaRank = default; + Optional category = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("alexaRank"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + alexaRank = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new AlexaInfo(Optional.ToNullable(alexaRank), category.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AlexaInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAlexaInfo(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.cs new file mode 100644 index 000000000000..2f839e4cde81 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AlexaInfo.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AlexaInfo. + public partial class AlexaInfo + { + /// Initializes a new instance of AlexaInfo. + internal AlexaInfo() + { + } + + /// Initializes a new instance of AlexaInfo. + /// + /// + /// + /// + /// + /// + internal AlexaInfo(long? alexaRank, string category, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent) + { + AlexaRank = alexaRank; + Category = category; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + } + + /// Gets the alexa rank. + public long? AlexaRank { get; } + /// Gets the category. + public string Category { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmClientBuilderExtensions.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmClientBuilderExtensions.cs new file mode 100644 index 000000000000..5450a7b6979b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmClientBuilderExtensions.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Analytics.Defender.Easm; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AnalyticsDefenderEasmClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + /// The ID of the target subscription. + /// The name of the Resource Group. + /// The name of the Workspace. + public static IAzureClientBuilder AddEasmClient(this TBuilder builder, Uri endpoint, string subscriptionId, string resourceGroupName, string workspaceName) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new EasmClient(endpoint, subscriptionId, resourceGroupName, workspaceName, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddEasmClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs new file mode 100644 index 000000000000..2090a504bd8b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AnalyticsDefenderEasmModelFactory.cs @@ -0,0 +1,1527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Analytics.Defender.Easm +{ + /// Model factory for models. + public static partial class AnalyticsDefenderEasmModelFactory + { + /// Initializes a new instance of AssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// A new instance for mocking. + public static AssetResource AssetResource(string kind = null, string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new UnknownAssetResource(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason); + } + + /// Initializes a new instance of AuditTrailItem. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The kind of asset. + /// An explanation of why this audit trail node was discovered from the previous node. + /// A new instance for mocking. + public static AuditTrailItem AuditTrailItem(string id = null, string name = null, string displayName = null, AuditTrailItemKind? kind = null, string reason = null) + { + return new AuditTrailItem(id, name, displayName, kind, reason); + } + + /// Initializes a new instance of AsAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static AsAssetResource AsAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, AsAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new AsAssetResource("as", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of AsAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AsAsset AsAsset(long? asn = null, IEnumerable asNames = null, IEnumerable orgNames = null, IEnumerable orgIds = null, IEnumerable countries = null, IEnumerable registries = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable registrarCreatedAt = null, IEnumerable registrarUpdatedAt = null, IEnumerable registrantContacts = null, IEnumerable adminContacts = null, IEnumerable technicalContacts = null, IEnumerable registrarNames = null, IEnumerable registrantNames = null, IEnumerable adminNames = null, IEnumerable technicalNames = null, IEnumerable adminOrgs = null, IEnumerable technicalOrgs = null, IEnumerable registrantPhones = null, IEnumerable adminPhones = null, IEnumerable technicalPhones = null, DateTimeOffset? detailedFromWhoisAt = null) + { + asNames ??= new List(); + orgNames ??= new List(); + orgIds ??= new List(); + countries ??= new List(); + registries ??= new List(); + sources ??= new List(); + registrarCreatedAt ??= new List(); + registrarUpdatedAt ??= new List(); + registrantContacts ??= new List(); + adminContacts ??= new List(); + technicalContacts ??= new List(); + registrarNames ??= new List(); + registrantNames ??= new List(); + adminNames ??= new List(); + technicalNames ??= new List(); + adminOrgs ??= new List(); + technicalOrgs ??= new List(); + registrantPhones ??= new List(); + adminPhones ??= new List(); + technicalPhones ??= new List(); + + return new AsAsset(asn, asNames?.ToList(), orgNames?.ToList(), orgIds?.ToList(), countries?.ToList(), registries?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, registrarCreatedAt?.ToList(), registrarUpdatedAt?.ToList(), registrantContacts?.ToList(), adminContacts?.ToList(), technicalContacts?.ToList(), registrarNames?.ToList(), registrantNames?.ToList(), adminNames?.ToList(), technicalNames?.ToList(), adminOrgs?.ToList(), technicalOrgs?.ToList(), registrantPhones?.ToList(), adminPhones?.ToList(), technicalPhones?.ToList(), detailedFromWhoisAt); + } + + /// Initializes a new instance of ObservedString. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedString ObservedString(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, string value = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new ObservedString(firstSeen, lastSeen, count, recent, value, sources?.ToList()); + } + + /// Initializes a new instance of Source. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Source Source(string sourceProperty = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, string reason = null) + { + return new Source(sourceProperty, firstSeen, lastSeen, count, reason); + } + + /// Initializes a new instance of ObservedLong. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedLong ObservedLong(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, long? value = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new ObservedLong(firstSeen, lastSeen, count, recent, value, sources?.ToList()); + } + + /// Initializes a new instance of ObservedInteger. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedInteger ObservedInteger(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, int? value = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new ObservedInteger(firstSeen, lastSeen, count, recent, value, sources?.ToList()); + } + + /// Initializes a new instance of ObservedBoolean. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedBoolean ObservedBoolean(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, bool? value = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new ObservedBoolean(firstSeen, lastSeen, count, recent, value, sources?.ToList()); + } + + /// Initializes a new instance of ObservedHeader. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedHeader ObservedHeader(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, string headerName = null, string headerValue = null) + { + return new ObservedHeader(firstSeen, lastSeen, count, recent, headerName, headerValue); + } + + /// Initializes a new instance of ObservedPortState. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedPortState ObservedPortState(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, ObservedPortStateValue? value = null, int? port = null) + { + return new ObservedPortState(firstSeen, lastSeen, count, recent, value, port); + } + + /// Initializes a new instance of ObservedLocation. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedLocation ObservedLocation(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, Location value = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new ObservedLocation(firstSeen, lastSeen, count, recent, value, sources?.ToList()); + } + + /// Initializes a new instance of Location. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Location Location(string countryCode = null, string countryName = null, string region = null, string regionName = null, string city = null, int? areaCode = null, string postalCode = null, float? latitude = null, float? longitude = null, int? dmaCode = null, int? metroCodeId = null) + { + return new Location(countryCode, countryName, region, regionName, city, areaCode, postalCode, latitude, longitude, dmaCode, metroCodeId); + } + + /// Initializes a new instance of ObservedIntegers. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ObservedIntegers ObservedIntegers(DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, IEnumerable values = null, IEnumerable sources = null) + { + values ??= new List(); + sources ??= new List(); + + return new ObservedIntegers(firstSeen, lastSeen, count, recent, values?.ToList(), sources?.ToList()); + } + + /// Initializes a new instance of ContactAsset. + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ContactAsset ContactAsset(string email = null, IEnumerable names = null, IEnumerable organizations = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null) + { + names ??= new List(); + organizations ??= new List(); + sources ??= new List(); + + return new ContactAsset(email, names?.ToList(), organizations?.ToList(), sources?.ToList(), firstSeen, lastSeen, count); + } + + /// Initializes a new instance of DomainAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static DomainAsset DomainAsset(string domain = null, long? whoisId = null, IEnumerable registrarIanaIds = null, IEnumerable registrantContacts = null, IEnumerable registrantOrgs = null, IEnumerable adminContacts = null, IEnumerable technicalContacts = null, IEnumerable alexaInfos = null, IEnumerable nameServers = null, IEnumerable mailServers = null, IEnumerable whoisServers = null, IEnumerable domainStatuses = null, IEnumerable registrarCreatedAt = null, IEnumerable registrarUpdatedAt = null, IEnumerable registrarExpiresAt = null, IEnumerable soaRecords = null, DateTimeOffset? detailedFromWhoisAt = null, IEnumerable registrarNames = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable parkedDomain = null, IEnumerable registrantNames = null, IEnumerable adminNames = null, IEnumerable technicalNames = null, IEnumerable adminOrgs = null, IEnumerable technicalOrgs = null, IEnumerable registrantPhones = null, IEnumerable adminPhones = null, IEnumerable technicalPhones = null) + { + registrarIanaIds ??= new List(); + registrantContacts ??= new List(); + registrantOrgs ??= new List(); + adminContacts ??= new List(); + technicalContacts ??= new List(); + alexaInfos ??= new List(); + nameServers ??= new List(); + mailServers ??= new List(); + whoisServers ??= new List(); + domainStatuses ??= new List(); + registrarCreatedAt ??= new List(); + registrarUpdatedAt ??= new List(); + registrarExpiresAt ??= new List(); + soaRecords ??= new List(); + registrarNames ??= new List(); + sources ??= new List(); + parkedDomain ??= new List(); + registrantNames ??= new List(); + adminNames ??= new List(); + technicalNames ??= new List(); + adminOrgs ??= new List(); + technicalOrgs ??= new List(); + registrantPhones ??= new List(); + adminPhones ??= new List(); + technicalPhones ??= new List(); + + return new DomainAsset(domain, whoisId, registrarIanaIds?.ToList(), registrantContacts?.ToList(), registrantOrgs?.ToList(), adminContacts?.ToList(), technicalContacts?.ToList(), alexaInfos?.ToList(), nameServers?.ToList(), mailServers?.ToList(), whoisServers?.ToList(), domainStatuses?.ToList(), registrarCreatedAt?.ToList(), registrarUpdatedAt?.ToList(), registrarExpiresAt?.ToList(), soaRecords?.ToList(), detailedFromWhoisAt, registrarNames?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, parkedDomain?.ToList(), registrantNames?.ToList(), adminNames?.ToList(), technicalNames?.ToList(), adminOrgs?.ToList(), technicalOrgs?.ToList(), registrantPhones?.ToList(), adminPhones?.ToList(), technicalPhones?.ToList()); + } + + /// Initializes a new instance of AlexaInfo. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AlexaInfo AlexaInfo(long? alexaRank = null, string category = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null) + { + return new AlexaInfo(alexaRank, category, firstSeen, lastSeen, count, recent); + } + + /// Initializes a new instance of SoaRecord. + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static SoaRecord SoaRecord(string nameServer = null, string email = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, long? serialNumber = null, bool? recent = null) + { + return new SoaRecord(nameServer, email, firstSeen, lastSeen, count, serialNumber, recent); + } + + /// Initializes a new instance of HostAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static HostAsset HostAsset(string host = null, string domain = null, IEnumerable ipAddresses = null, IEnumerable webComponents = null, IEnumerable headers = null, IEnumerable attributes = null, IEnumerable cookies = null, IEnumerable sslCerts = null, IEnumerable parentHosts = null, IEnumerable childHosts = null, HostCore hostCore = null, IEnumerable services = null, IEnumerable cnames = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable resourceUrls = null, IEnumerable scanMetadata = null, IEnumerable asns = null, IEnumerable ipBlocks = null, IEnumerable responseBodies = null, DomainAsset domainAsset = null, IEnumerable nsRecord = null, IEnumerable mxRecord = null, IEnumerable webserver = null, IEnumerable location = null, IEnumerable nxdomain = null, IEnumerable sslServerConfig = null, IEnumerable isWildcard = null, IEnumerable banners = null, IEnumerable ipv4 = null, IEnumerable ipv6 = null) + { + ipAddresses ??= new List(); + webComponents ??= new List(); + headers ??= new List(); + attributes ??= new List(); + cookies ??= new List(); + sslCerts ??= new List(); + parentHosts ??= new List(); + childHosts ??= new List(); + services ??= new List(); + cnames ??= new List(); + sources ??= new List(); + resourceUrls ??= new List(); + scanMetadata ??= new List(); + asns ??= new List(); + ipBlocks ??= new List(); + responseBodies ??= new List(); + nsRecord ??= new List(); + mxRecord ??= new List(); + webserver ??= new List(); + location ??= new List(); + nxdomain ??= new List(); + sslServerConfig ??= new List(); + isWildcard ??= new List(); + banners ??= new List(); + ipv4 ??= new List(); + ipv6 ??= new List(); + + return new HostAsset(host, domain, ipAddresses?.ToList(), webComponents?.ToList(), headers?.ToList(), attributes?.ToList(), cookies?.ToList(), sslCerts?.ToList(), parentHosts?.ToList(), childHosts?.ToList(), hostCore, services?.ToList(), cnames?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, resourceUrls?.ToList(), scanMetadata?.ToList(), asns?.ToList(), ipBlocks?.ToList(), responseBodies?.ToList(), domainAsset, nsRecord?.ToList(), mxRecord?.ToList(), webserver?.ToList(), location?.ToList(), nxdomain?.ToList(), sslServerConfig?.ToList(), isWildcard?.ToList(), banners?.ToList(), ipv4?.ToList(), ipv6?.ToList()); + } + + /// Initializes a new instance of WebComponent. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static WebComponent WebComponent(string name = null, string type = null, string version = null, IEnumerable ruleId = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable cve = null, long? endOfLife = null, bool? recent = null, IEnumerable ports = null, IEnumerable sources = null, string service = null) + { + ruleId ??= new List(); + cve ??= new List(); + ports ??= new List(); + sources ??= new List(); + + return new WebComponent(name, type, version, ruleId?.ToList(), firstSeen, lastSeen, count, cve?.ToList(), endOfLife, recent, ports?.ToList(), sources?.ToList(), service); + } + + /// Initializes a new instance of Cve. + /// + /// + /// + /// + /// A new instance for mocking. + public static Cve Cve(string name = null, string cweId = null, float? cvssScore = null, Cvss3Summary cvss3Summary = null) + { + return new Cve(name, cweId, cvssScore, cvss3Summary); + } + + /// Initializes a new instance of Cvss3Summary. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Cvss3Summary Cvss3Summary(string version = null, string vectorString = null, string attackVector = null, string attackComplexity = null, string privilegesRequired = null, string userInteraction = null, string scope = null, string confidentialityImpact = null, string integrityImpact = null, string availabilityImpact = null, float? baseScore = null, string baseSeverity = null, string exploitCodeMaturity = null, string remediationLevel = null, string reportConfidence = null, float? exploitabilityScore = null, float? impactScore = null) + { + return new Cvss3Summary(version, vectorString, attackVector, attackComplexity, privilegesRequired, userInteraction, scope, confidentialityImpact, integrityImpact, availabilityImpact, baseScore, baseSeverity, exploitCodeMaturity, remediationLevel, reportConfidence, exploitabilityScore, impactScore); + } + + /// Initializes a new instance of Port. + /// + /// + /// + /// + /// A new instance for mocking. + public static Port Port(int? portProperty = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null) + { + return new Port(portProperty, firstSeen, lastSeen, count); + } + + /// Initializes a new instance of Attribute. + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Attribute Attribute(string attributeType = null, string attributeValue = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null) + { + sources ??= new List(); + + return new Attribute(attributeType, attributeValue, sources?.ToList(), firstSeen, lastSeen, count, recent); + } + + /// Initializes a new instance of Cookie. + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Cookie Cookie(string cookieName = null, string cookieDomain = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, DateTimeOffset? cookieExpiryDate = null) + { + return new Cookie(cookieName, cookieDomain, firstSeen, lastSeen, count, recent, cookieExpiryDate); + } + + /// Initializes a new instance of SslCertAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static SslCertAsset SslCertAsset(string sha1 = null, IEnumerable subjectCommonNames = null, IEnumerable organizations = null, IEnumerable organizationalUnits = null, IEnumerable issuerCommonNames = null, string sigAlgName = null, DateTimeOffset? invalidAfter = null, string serialNumber = null, IEnumerable subjectAlternativeNames = null, IEnumerable issuerAlternativeNames = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, DateTimeOffset? invalidBefore = null, int? keySize = null, string keyAlgorithm = null, IEnumerable subjectLocality = null, IEnumerable subjectState = null, IEnumerable subjectCountry = null, IEnumerable issuerLocality = null, IEnumerable issuerState = null, IEnumerable issuerCountry = null, IEnumerable subjectOrganizations = null, IEnumerable subjectOrganizationalUnits = null, IEnumerable issuerOrganizations = null, IEnumerable issuerOrganizationalUnits = null, int? version = null, bool? certificateAuthority = null, bool? selfSigned = null, string sigAlgOid = null, bool? recent = null, SslCertAssetValidationType? validationType = null) + { + subjectCommonNames ??= new List(); + organizations ??= new List(); + organizationalUnits ??= new List(); + issuerCommonNames ??= new List(); + subjectAlternativeNames ??= new List(); + issuerAlternativeNames ??= new List(); + sources ??= new List(); + subjectLocality ??= new List(); + subjectState ??= new List(); + subjectCountry ??= new List(); + issuerLocality ??= new List(); + issuerState ??= new List(); + issuerCountry ??= new List(); + subjectOrganizations ??= new List(); + subjectOrganizationalUnits ??= new List(); + issuerOrganizations ??= new List(); + issuerOrganizationalUnits ??= new List(); + + return new SslCertAsset(sha1, subjectCommonNames?.ToList(), organizations?.ToList(), organizationalUnits?.ToList(), issuerCommonNames?.ToList(), sigAlgName, invalidAfter, serialNumber, subjectAlternativeNames?.ToList(), issuerAlternativeNames?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, invalidBefore, keySize, keyAlgorithm, subjectLocality?.ToList(), subjectState?.ToList(), subjectCountry?.ToList(), issuerLocality?.ToList(), issuerState?.ToList(), issuerCountry?.ToList(), subjectOrganizations?.ToList(), subjectOrganizationalUnits?.ToList(), issuerOrganizations?.ToList(), issuerOrganizationalUnits?.ToList(), version, certificateAuthority, selfSigned, sigAlgOid, recent, validationType); + } + + /// Initializes a new instance of HostCore. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static HostCore HostCore(string host = null, string domain = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, DateTimeOffset? blacklistCauseFirstSeen = null, DateTimeOffset? blacklistCauseLastSeen = null, long? blacklistCauseCount = null, DateTimeOffset? blacklistResourceFirstSeen = null, DateTimeOffset? blacklistResourceLastSeen = null, long? blacklistResourceCount = null, DateTimeOffset? blacklistSequenceFirstSeen = null, DateTimeOffset? blacklistSequenceLastSeen = null, long? blacklistSequenceCount = null, long? phishCauseCount = null, long? malwareCauseCount = null, long? spamCauseCount = null, long? scamCauseCount = null, long? phishResourceCount = null, long? malwareResourceCount = null, long? spamResourceCount = null, long? scamResourceCount = null, long? phishSequenceCount = null, long? malwareSequenceCount = null, long? spamSequenceCount = null, long? scamSequenceCount = null, int? alexaRank = null, int? hostReputationScore = null, int? hostPhishReputationScore = null, int? hostMalwareReputationScore = null, int? hostSpamReputationScore = null, int? hostScamReputationScore = null, int? domainReputationScore = null, int? domainPhishReputationScore = null, int? domainMalwareReputationScore = null, int? domainSpamReputationScore = null, int? domainScamReputationScore = null, string uuid = null) + { + return new HostCore(host, domain, firstSeen, lastSeen, count, blacklistCauseFirstSeen, blacklistCauseLastSeen, blacklistCauseCount, blacklistResourceFirstSeen, blacklistResourceLastSeen, blacklistResourceCount, blacklistSequenceFirstSeen, blacklistSequenceLastSeen, blacklistSequenceCount, phishCauseCount, malwareCauseCount, spamCauseCount, scamCauseCount, phishResourceCount, malwareResourceCount, spamResourceCount, scamResourceCount, phishSequenceCount, malwareSequenceCount, spamSequenceCount, scamSequenceCount, alexaRank, hostReputationScore, hostPhishReputationScore, hostMalwareReputationScore, hostSpamReputationScore, hostScamReputationScore, domainReputationScore, domainPhishReputationScore, domainMalwareReputationScore, domainSpamReputationScore, domainScamReputationScore, uuid); + } + + /// Initializes a new instance of Service. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Service Service(string scheme = null, int? port = null, IEnumerable webComponents = null, IEnumerable sslCerts = null, IEnumerable exceptions = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, IEnumerable portStates = null) + { + webComponents ??= new List(); + sslCerts ??= new List(); + exceptions ??= new List(); + sources ??= new List(); + portStates ??= new List(); + + return new Service(scheme, port, webComponents?.ToList(), sslCerts?.ToList(), exceptions?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, recent, portStates?.ToList()); + } + + /// Initializes a new instance of ResourceUrl. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ResourceUrl ResourceUrl(Uri url = null, IEnumerable resources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null) + { + resources ??= new List(); + + return new ResourceUrl(url, resources?.ToList(), firstSeen, lastSeen, count, recent); + } + + /// Initializes a new instance of DependentResource. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static DependentResource DependentResource(string md5 = null, long? responseBodySize = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, string firstSeenCrawlGuid = null, string firstSeenPageGuid = null, string firstSeenResourceGuid = null, string lastSeenCrawlGuid = null, string lastSeenPageGuid = null, string lastSeenResourceGuid = null, IEnumerable responseBodyMinhash = null, string contentType = null, string sha256 = null, string sha384 = null, string sha512 = null, Uri url = null, bool? cached = null, IEnumerable sriChecks = null, string host = null, DateTimeOffset? lastObservedViolation = null, DateTimeOffset? lastObservedValidation = null, string lastObservedActualSriHash = null, string lastObservedExpectedSriHash = null) + { + responseBodyMinhash ??= new List(); + sriChecks ??= new List(); + + return new DependentResource(md5, responseBodySize, firstSeen, lastSeen, count, firstSeenCrawlGuid, firstSeenPageGuid, firstSeenResourceGuid, lastSeenCrawlGuid, lastSeenPageGuid, lastSeenResourceGuid, responseBodyMinhash?.ToList(), contentType, sha256, sha384, sha512, url, cached, sriChecks?.ToList(), host, lastObservedViolation, lastObservedValidation, lastObservedActualSriHash, lastObservedExpectedSriHash); + } + + /// Initializes a new instance of SubResourceIntegrityCheck. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static SubResourceIntegrityCheck SubResourceIntegrityCheck(bool? violation = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, string causePageUrl = null, string crawlGuid = null, string pageGuid = null, string resourceGuid = null, string expectedHash = null) + { + return new SubResourceIntegrityCheck(violation, firstSeen, lastSeen, count, causePageUrl, crawlGuid, pageGuid, resourceGuid, expectedHash); + } + + /// Initializes a new instance of ScanMetadata. + /// + /// + /// + /// + /// A new instance for mocking. + public static ScanMetadata ScanMetadata(int? port = null, string bannerMetadata = null, DateTimeOffset? startScan = null, DateTimeOffset? endScan = null) + { + return new ScanMetadata(port, bannerMetadata, startScan, endScan); + } + + /// Initializes a new instance of IpBlock. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static IpBlock IpBlock(string ipBlockProperty = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null) + { + sources ??= new List(); + + return new IpBlock(ipBlockProperty, sources?.ToList(), firstSeen, lastSeen, count, recent); + } + + /// Initializes a new instance of SslServerConfig. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static SslServerConfig SslServerConfig(IEnumerable tlsVersions = null, IEnumerable cipherSuites = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable sources = null) + { + tlsVersions ??= new List(); + cipherSuites ??= new List(); + sources ??= new List(); + + return new SslServerConfig(tlsVersions?.ToList(), cipherSuites?.ToList(), firstSeen, lastSeen, count, sources?.ToList()); + } + + /// Initializes a new instance of Banner. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Banner Banner(int? port = null, string bannerProperty = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, string scanType = null, string bannerMetadata = null, bool? recent = null, string sha256 = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new Banner(port, bannerProperty, firstSeen, lastSeen, count, scanType, bannerMetadata, recent, sha256, sources?.ToList()); + } + + /// Initializes a new instance of IpAddressAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static IpAddressAsset IpAddressAsset(string ipAddress = null, IEnumerable asns = null, IEnumerable reputations = null, IEnumerable webComponents = null, IEnumerable netRanges = null, IEnumerable headers = null, IEnumerable attributes = null, IEnumerable cookies = null, IEnumerable sslCerts = null, IEnumerable services = null, IEnumerable ipBlocks = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable banners = null, IEnumerable scanMetadata = null, IEnumerable nsRecord = null, IEnumerable mxRecord = null, IEnumerable location = null, IEnumerable hosts = null, IEnumerable nxdomain = null, IEnumerable sslServerConfig = null, bool? ipv4 = null, bool? ipv6 = null) + { + asns ??= new List(); + reputations ??= new List(); + webComponents ??= new List(); + netRanges ??= new List(); + headers ??= new List(); + attributes ??= new List(); + cookies ??= new List(); + sslCerts ??= new List(); + services ??= new List(); + ipBlocks ??= new List(); + sources ??= new List(); + banners ??= new List(); + scanMetadata ??= new List(); + nsRecord ??= new List(); + mxRecord ??= new List(); + location ??= new List(); + hosts ??= new List(); + nxdomain ??= new List(); + sslServerConfig ??= new List(); + + return new IpAddressAsset(ipAddress, asns?.ToList(), reputations?.ToList(), webComponents?.ToList(), netRanges?.ToList(), headers?.ToList(), attributes?.ToList(), cookies?.ToList(), sslCerts?.ToList(), services?.ToList(), ipBlocks?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, banners?.ToList(), scanMetadata?.ToList(), nsRecord?.ToList(), mxRecord?.ToList(), location?.ToList(), hosts?.ToList(), nxdomain?.ToList(), sslServerConfig?.ToList(), ipv4, ipv6); + } + + /// Initializes a new instance of Reputation. + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static Reputation Reputation(string listName = null, string threatType = null, bool? trusted = null, string cidr = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, DateTimeOffset? listUpdatedAt = null, bool? recent = null) + { + return new Reputation(listName, threatType, trusted, cidr, firstSeen, lastSeen, listUpdatedAt, recent); + } + + /// Initializes a new instance of IpBlockAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static IpBlockAsset IpBlockAsset(string ipBlock = null, IEnumerable asns = null, IEnumerable bgpPrefixes = null, IEnumerable netNames = null, IEnumerable registrantContacts = null, IEnumerable registrantOrgs = null, IEnumerable adminContacts = null, IEnumerable technicalContacts = null, IEnumerable registrarCreatedAt = null, IEnumerable registrarUpdatedAt = null, IEnumerable netRanges = null, string startIp = null, string endIp = null, IEnumerable reputations = null, DateTimeOffset? detailedFromWhoisAt = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, IEnumerable location = null, IEnumerable registrarExpiresAt = null, IEnumerable registrantNames = null, IEnumerable adminNames = null, IEnumerable technicalNames = null, IEnumerable adminOrgs = null, IEnumerable technicalOrgs = null, IEnumerable registrantPhones = null, IEnumerable adminPhones = null, IEnumerable technicalPhones = null, bool? ipv4 = null, bool? ipv6 = null) + { + asns ??= new List(); + bgpPrefixes ??= new List(); + netNames ??= new List(); + registrantContacts ??= new List(); + registrantOrgs ??= new List(); + adminContacts ??= new List(); + technicalContacts ??= new List(); + registrarCreatedAt ??= new List(); + registrarUpdatedAt ??= new List(); + netRanges ??= new List(); + reputations ??= new List(); + sources ??= new List(); + location ??= new List(); + registrarExpiresAt ??= new List(); + registrantNames ??= new List(); + adminNames ??= new List(); + technicalNames ??= new List(); + adminOrgs ??= new List(); + technicalOrgs ??= new List(); + registrantPhones ??= new List(); + adminPhones ??= new List(); + technicalPhones ??= new List(); + + return new IpBlockAsset(ipBlock, asns?.ToList(), bgpPrefixes?.ToList(), netNames?.ToList(), registrantContacts?.ToList(), registrantOrgs?.ToList(), adminContacts?.ToList(), technicalContacts?.ToList(), registrarCreatedAt?.ToList(), registrarUpdatedAt?.ToList(), netRanges?.ToList(), startIp, endIp, reputations?.ToList(), detailedFromWhoisAt, sources?.ToList(), firstSeen, lastSeen, count, location?.ToList(), registrarExpiresAt?.ToList(), registrantNames?.ToList(), adminNames?.ToList(), technicalNames?.ToList(), adminOrgs?.ToList(), technicalOrgs?.ToList(), registrantPhones?.ToList(), adminPhones?.ToList(), technicalPhones?.ToList(), ipv4, ipv6); + } + + /// Initializes a new instance of PageAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static PageAsset PageAsset(Uri url = null, string httpMethod = null, string service = null, IEnumerable ipAddresses = null, IEnumerable successful = null, IEnumerable httpResponseCodes = null, IEnumerable httpResponseMessages = null, IEnumerable responseTimes = null, IEnumerable frames = null, IEnumerable windows = null, IEnumerable nonHtmlFrames = null, IEnumerable undirectedContent = null, IEnumerable contentTypes = null, IEnumerable contentLengths = null, IEnumerable windowNames = null, IEnumerable charsets = null, IEnumerable titles = null, IEnumerable languages = null, IEnumerable responseHeaders = null, IEnumerable cookies = null, IEnumerable webComponents = null, IEnumerable attributes = null, IEnumerable assetSecurityPolicies = null, IEnumerable responseBodyMinhashSignatures = null, IEnumerable fullDomMinhashSignatures = null, IEnumerable responseBodyHashSignatures = null, IEnumerable errors = null, IEnumerable sslCerts = null, IEnumerable sources = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, PageCause cause = null, string referrer = null, IEnumerable redirectUrls = null, PageAssetRedirectType? redirectType = null, IEnumerable finalUrls = null, IEnumerable finalResponseCodes = null, IEnumerable parkedPage = null, IEnumerable resourceUrls = null, IEnumerable guids = null, IEnumerable finalIpAddresses = null, IEnumerable asns = null, IEnumerable ipBlocks = null, IEnumerable finalAsns = null, IEnumerable finalIpBlocks = null, IEnumerable responseBodies = null, DomainAsset domainAsset = null, ObservedBoolean rootUrl = null, bool? isRootUrl = null, IEnumerable location = null, IEnumerable services = null, string siteStatus = null, IEnumerable cnames = null, IEnumerable cdns = null, string host = null, string domain = null, IEnumerable sslServerConfig = null, IEnumerable gdprAssetSecurityPolicies = null, IEnumerable ipv4 = null, IEnumerable ipv6 = null) + { + ipAddresses ??= new List(); + successful ??= new List(); + httpResponseCodes ??= new List(); + httpResponseMessages ??= new List(); + responseTimes ??= new List(); + frames ??= new List(); + windows ??= new List(); + nonHtmlFrames ??= new List(); + undirectedContent ??= new List(); + contentTypes ??= new List(); + contentLengths ??= new List(); + windowNames ??= new List(); + charsets ??= new List(); + titles ??= new List(); + languages ??= new List(); + responseHeaders ??= new List(); + cookies ??= new List(); + webComponents ??= new List(); + attributes ??= new List(); + assetSecurityPolicies ??= new List(); + responseBodyMinhashSignatures ??= new List(); + fullDomMinhashSignatures ??= new List(); + responseBodyHashSignatures ??= new List(); + errors ??= new List(); + sslCerts ??= new List(); + sources ??= new List(); + redirectUrls ??= new List(); + finalUrls ??= new List(); + finalResponseCodes ??= new List(); + parkedPage ??= new List(); + resourceUrls ??= new List(); + guids ??= new List(); + finalIpAddresses ??= new List(); + asns ??= new List(); + ipBlocks ??= new List(); + finalAsns ??= new List(); + finalIpBlocks ??= new List(); + responseBodies ??= new List(); + location ??= new List(); + services ??= new List(); + cnames ??= new List(); + cdns ??= new List(); + sslServerConfig ??= new List(); + gdprAssetSecurityPolicies ??= new List(); + ipv4 ??= new List(); + ipv6 ??= new List(); + + return new PageAsset(url, httpMethod, service, ipAddresses?.ToList(), successful?.ToList(), httpResponseCodes?.ToList(), httpResponseMessages?.ToList(), responseTimes?.ToList(), frames?.ToList(), windows?.ToList(), nonHtmlFrames?.ToList(), undirectedContent?.ToList(), contentTypes?.ToList(), contentLengths?.ToList(), windowNames?.ToList(), charsets?.ToList(), titles?.ToList(), languages?.ToList(), responseHeaders?.ToList(), cookies?.ToList(), webComponents?.ToList(), attributes?.ToList(), assetSecurityPolicies?.ToList(), responseBodyMinhashSignatures?.ToList(), fullDomMinhashSignatures?.ToList(), responseBodyHashSignatures?.ToList(), errors?.ToList(), sslCerts?.ToList(), sources?.ToList(), firstSeen, lastSeen, count, cause, referrer, redirectUrls?.ToList(), redirectType, finalUrls?.ToList(), finalResponseCodes?.ToList(), parkedPage?.ToList(), resourceUrls?.ToList(), guids?.ToList(), finalIpAddresses?.ToList(), asns?.ToList(), ipBlocks?.ToList(), finalAsns?.ToList(), finalIpBlocks?.ToList(), responseBodies?.ToList(), domainAsset, rootUrl, isRootUrl, location?.ToList(), services?.ToList(), siteStatus, cnames?.ToList(), cdns?.ToList(), host, domain, sslServerConfig?.ToList(), gdprAssetSecurityPolicies?.ToList(), ipv4?.ToList(), ipv6?.ToList()); + } + + /// Initializes a new instance of AssetSecurityPolicy. + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AssetSecurityPolicy AssetSecurityPolicy(string policyName = null, bool? isAffected = null, string description = null, DateTimeOffset? firstSeen = null, DateTimeOffset? lastSeen = null, long? count = null, bool? recent = null, IEnumerable sources = null) + { + sources ??= new List(); + + return new AssetSecurityPolicy(policyName, isAffected, description, firstSeen, lastSeen, count, recent, sources?.ToList()); + } + + /// Initializes a new instance of PageCause. + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static PageCause PageCause(string cause = null, string causeElementXPath = null, string location = null, int? possibleMatches = null, bool? loopDetected = null, int? version = null, int? domChangeIndex = null) + { + return new PageCause(cause, causeElementXPath, location, possibleMatches, loopDetected, version, domChangeIndex); + } + + /// Initializes a new instance of GuidPair. + /// + /// + /// + /// + /// A new instance for mocking. + public static GuidPair GuidPair(string pageGuid = null, string crawlStateGuid = null, DateTimeOffset? loadDate = null, bool? recent = null) + { + return new GuidPair(pageGuid, crawlStateGuid, loadDate, recent); + } + + /// Initializes a new instance of ContactAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static ContactAssetResource ContactAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, ContactAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new ContactAssetResource("contact", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of DomainAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static DomainAssetResource DomainAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, DomainAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new DomainAssetResource("domain", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of HostAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static HostAssetResource HostAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, HostAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new HostAssetResource("host", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of IpAddressAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static IpAddressAssetResource IpAddressAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, IpAddressAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new IpAddressAssetResource("ipAddress", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of IpBlockAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static IpBlockAssetResource IpBlockAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, IpBlockAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new IpBlockAssetResource("ipBlock", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of PageAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static PageAssetResource PageAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, PageAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new PageAssetResource("page", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of SslCertAssetResource. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + /// A new instance for mocking. + public static SslCertAssetResource SslCertAssetResource(string id = null, string name = null, string displayName = null, Guid? uuid = null, DateTimeOffset? createdDate = null, DateTimeOffset? updatedDate = null, AssetState? state = null, string externalId = null, IEnumerable labels = null, bool? wildcard = null, string discoGroupName = null, IEnumerable auditTrail = null, string reason = null, SslCertAsset asset = null) + { + labels ??= new List(); + auditTrail ??= new List(); + + return new SslCertAssetResource("sslCert", id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels?.ToList(), wildcard, discoGroupName, auditTrail?.ToList(), reason, asset); + } + + /// Initializes a new instance of Task. + /// The unique identifier of the task. + /// The time the task started. + /// The time the task completed. + /// The last time the status of the task was updated. + /// The state the task is in. + /// The phase the task is in. + /// The reason the task was moved into its current state, if the task wasn't completed. + /// Attributes unique to the task. This differs by task type. + /// A new instance for mocking. + public static Task Task(string id = null, DateTimeOffset? startedAt = null, DateTimeOffset? completedAt = null, DateTimeOffset? lastPolledAt = null, TaskState? state = null, TaskPhase? phase = null, string reason = null, IReadOnlyDictionary metadata = null) + { + metadata ??= new Dictionary(); + + return new Task(id, startedAt, completedAt, lastPolledAt, state, phase, reason, metadata); + } + + /// Initializes a new instance of DataConnection. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + /// A new instance for mocking. + public static DataConnection DataConnection(string kind = null, string id = null, string name = null, string displayName = null, DataConnectionContent? content = null, DateTimeOffset? createdDate = null, DataConnectionFrequency? frequency = null, int? frequencyOffset = null, DateTimeOffset? updatedDate = null, DateTimeOffset? userUpdatedAt = null, bool? active = null, string inactiveMessage = null) + { + return new UnknownDataConnection(kind, id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage); + } + + /// Initializes a new instance of LogAnalyticsDataConnection. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + /// properties. + /// A new instance for mocking. + public static LogAnalyticsDataConnection LogAnalyticsDataConnection(string id = null, string name = null, string displayName = null, DataConnectionContent? content = null, DateTimeOffset? createdDate = null, DataConnectionFrequency? frequency = null, int? frequencyOffset = null, DateTimeOffset? updatedDate = null, DateTimeOffset? userUpdatedAt = null, bool? active = null, string inactiveMessage = null, LogAnalyticsDataConnectionProperties properties = null) + { + return new LogAnalyticsDataConnection("logAnalytics", id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage, properties); + } + + /// Initializes a new instance of AzureDataExplorerDataConnection. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + /// properties. + /// A new instance for mocking. + public static AzureDataExplorerDataConnection AzureDataExplorerDataConnection(string id = null, string name = null, string displayName = null, DataConnectionContent? content = null, DateTimeOffset? createdDate = null, DataConnectionFrequency? frequency = null, int? frequencyOffset = null, DateTimeOffset? updatedDate = null, DateTimeOffset? userUpdatedAt = null, bool? active = null, string inactiveMessage = null, AzureDataExplorerDataConnectionProperties properties = null) + { + return new AzureDataExplorerDataConnection("azureDataExplorer", id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage, properties); + } + + /// Initializes a new instance of ValidateResult. + /// This is the top-level error object whose code matches the x-ms-error-code response header. + /// A new instance for mocking. + public static ValidateResult ValidateResult(ErrorDetail error = null) + { + return new ValidateResult(error); + } + + /// Initializes a new instance of ErrorDetail. + /// This is one of a server-defined set of error codes. + /// This is a human-readable representation of the error. + /// This is the error target. + /// This is an array of details about specific errors that led to this reported error. + /// This is an object containing more specific information than the current object about the error. + /// A new instance for mocking. + public static ErrorDetail ErrorDetail(string code = null, string message = null, string target = null, IEnumerable details = null, InnerError innererror = null) + { + details ??= new List(); + + return new ErrorDetail(code, message, target, details?.ToList(), innererror); + } + + /// Initializes a new instance of InnerError. + /// This is a more specific error code than was provided by the containing error. + /// This is an additional field representing the value that caused the error to help with debugging. + /// A new instance for mocking. + public static InnerError InnerError(string code = null, BinaryData value = null) + { + return new InnerError(code, value); + } + + /// Initializes a new instance of DiscoGroup. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The description for a disco group. + /// The tier for the disco group which will affect the algorithm used for the disco runs in this group. + /// The frequency at which the disco group is supposed to be rerun in milliseconds. + /// The list of seeds used for the disco group runs. + /// The list of names used for the disco group runs. + /// The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + /// The latest run of this disco group with some limited information, null if the group has never been run. + /// The date for the disco group was created. + /// The unique identifier for the disco template used for the disco group creation. + /// A new instance for mocking. + public static DiscoGroup DiscoGroup(string id = null, string name = null, string displayName = null, string description = null, string tier = null, long? frequencyMilliseconds = null, IEnumerable seeds = null, IEnumerable names = null, IEnumerable excludes = null, DiscoRunResult latestRun = null, DateTimeOffset? createdDate = null, string templateId = null) + { + seeds ??= new List(); + names ??= new List(); + excludes ??= new List(); + + return new DiscoGroup(id, name, displayName, description, tier, frequencyMilliseconds, seeds?.ToList(), names?.ToList(), excludes?.ToList(), latestRun, createdDate, templateId); + } + + /// Initializes a new instance of DiscoRunResult. + /// The date for when the disco run was created in the system. + /// The date for when the disco run was actually started by the system. + /// The date for when the disco run was completed by the system. + /// The tier which will affect the algorithm used for the disco run. + /// The State of the disco run. + /// The total count of assets that were found this disco run. + /// The list of seeds used for the disco run. + /// The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. + /// The list of names used for the disco run. + /// A new instance for mocking. + public static DiscoRunResult DiscoRunResult(DateTimeOffset? submittedDate = null, DateTimeOffset? startedDate = null, DateTimeOffset? completedDate = null, string tier = null, DiscoRunState? state = null, long? totalAssetsFoundCount = null, IEnumerable seeds = null, IEnumerable excludes = null, IEnumerable names = null) + { + seeds ??= new List(); + excludes ??= new List(); + names ??= new List(); + + return new DiscoRunResult(submittedDate, startedDate, completedDate, tier, state, totalAssetsFoundCount, seeds?.ToList(), excludes?.ToList(), names?.ToList()); + } + + /// Initializes a new instance of DiscoTemplate. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The name of the industry. + /// The name of the region. + /// The country code. + /// The state code. + /// The name of the city. + /// The list of disco template seeds. + /// The list of disco template names. + /// A new instance for mocking. + public static DiscoTemplate DiscoTemplate(string id = null, string name = null, string displayName = null, string industry = null, string region = null, string countryCode = null, string stateCode = null, string city = null, IEnumerable seeds = null, IEnumerable names = null) + { + seeds ??= new List(); + names ??= new List(); + + return new DiscoTemplate(id, name, displayName, industry, region, countryCode, stateCode, city, seeds?.ToList(), names?.ToList()); + } + + /// Initializes a new instance of ReportBillableAssetSummaryResult. + /// + /// A new instance for mocking. + public static ReportBillableAssetSummaryResult ReportBillableAssetSummaryResult(IEnumerable assetSummaries = null) + { + assetSummaries ??= new List(); + + return new ReportBillableAssetSummaryResult(assetSummaries?.ToList()); + } + + /// Initializes a new instance of ReportBillableAssetSnapshotResult. + /// The date these assets were billed on. + /// The total number of billable assets for this date. + /// The breakdown of billable asset counts for each asset type. + /// A new instance for mocking. + public static ReportBillableAssetSnapshotResult ReportBillableAssetSnapshotResult(DateTimeOffset? date = null, long? total = null, IEnumerable assetBreakdown = null) + { + assetBreakdown ??= new List(); + + return new ReportBillableAssetSnapshotResult(date, total, assetBreakdown?.ToList()); + } + + /// Initializes a new instance of ReportBillableAssetBreakdown. + /// The kind of billable asset. + /// The number of assets of this type. + /// A new instance for mocking. + public static ReportBillableAssetBreakdown ReportBillableAssetBreakdown(ReportBillableAssetBreakdownKind? kind = null, long? count = null) + { + return new ReportBillableAssetBreakdown(kind, count); + } + + /// Initializes a new instance of ReportAssetSnapshotResult. + /// The name of the metric. + /// The unique metric name. + /// The customer label that was filtered on, if one was provided. + /// The last time this asset data was updated on this metric. + /// A description of what the metric represents. + /// The page of assets that match the provided metric. + /// A new instance for mocking. + public static ReportAssetSnapshotResult ReportAssetSnapshotResult(string displayName = null, string metric = null, string labelName = null, DateTimeOffset? updatedAt = null, string description = null, AssetPageResult assets = null) + { + return new ReportAssetSnapshotResult(displayName, metric, labelName, updatedAt, description, assets); + } + + /// Initializes a new instance of AssetPageResult. + /// The total number of items available in the full result set. + /// The cursor mark to be used on the next request. Not set if using paging. + /// The link to access the next page of results. Not set if at the end of the result set. + /// The items in the current page of results. + /// A new instance for mocking. + public static AssetPageResult AssetPageResult(long? totalElements = null, string mark = null, string nextLink = null, IEnumerable value = null) + { + value ??= new List(); + + return new AssetPageResult(totalElements, mark, nextLink, value?.ToList()); + } + + /// Initializes a new instance of ReportAssetSummaryResult. + /// The collection of asset summaries. + /// A new instance for mocking. + public static ReportAssetSummaryResult ReportAssetSummaryResult(IEnumerable assetSummaries = null) + { + assetSummaries ??= new List(); + + return new ReportAssetSummaryResult(assetSummaries?.ToList()); + } + + /// Initializes a new instance of AssetSummaryResult. + /// The name of the summary response. Depending on the request time this will either be the asset filter, risk category, or risk metric. + /// The description of the summary response. Filters don't have a description. + /// The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, which always pull the live asset data. + /// If the request is for a metric category, this will contain the requested unique category name. + /// If the request is for a metric, this will contain the requested unique metric name. + /// If the request is for an asset filter, this will contain the corresponding filter. + /// An optional label used to filter requests results. + /// The count of assets matching the request parameters. + /// The link to the corresponding asset details. + /// The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and segmentBy this will contain facets. + /// A new instance for mocking. + public static AssetSummaryResult AssetSummaryResult(string displayName = null, string description = null, DateTimeOffset? updatedAt = null, string metricCategory = null, string metric = null, string filter = null, string labelName = null, long? count = null, string link = null, IEnumerable children = null) + { + children ??= new List(); + + return new AssetSummaryResult(displayName, description, updatedAt, metricCategory, metric, filter, labelName, count, link, children?.ToList()); + } + + /// Initializes a new instance of SavedFilter. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// + /// + /// A new instance for mocking. + public static SavedFilter SavedFilter(string id = null, string name = null, string displayName = null, string filter = null, string description = null) + { + return new SavedFilter(id, name, displayName, filter, description); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.Serialization.cs new file mode 100644 index 000000000000..74984f6f2bed --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.Serialization.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AsAsset + { + internal static AsAsset DeserializeAsAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional asn = default; + Optional> asNames = default; + Optional> orgNames = default; + Optional> orgIds = default; + Optional> countries = default; + Optional> registries = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> registrarCreatedAt = default; + Optional> registrarUpdatedAt = default; + Optional> registrantContacts = default; + Optional> adminContacts = default; + Optional> technicalContacts = default; + Optional> registrarNames = default; + Optional> registrantNames = default; + Optional> adminNames = default; + Optional> technicalNames = default; + Optional> adminOrgs = default; + Optional> technicalOrgs = default; + Optional> registrantPhones = default; + Optional> adminPhones = default; + Optional> technicalPhones = default; + Optional detailedFromWhoisAt = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asn"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asn = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("asNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + asNames = array; + continue; + } + if (property.NameEquals("orgNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + orgNames = array; + continue; + } + if (property.NameEquals("orgIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + orgIds = array; + continue; + } + if (property.NameEquals("countries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + countries = array; + continue; + } + if (property.NameEquals("registries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registries = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("registrarCreatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarCreatedAt = array; + continue; + } + if (property.NameEquals("registrarUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarUpdatedAt = array; + continue; + } + if (property.NameEquals("registrantContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantContacts = array; + continue; + } + if (property.NameEquals("adminContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminContacts = array; + continue; + } + if (property.NameEquals("technicalContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalContacts = array; + continue; + } + if (property.NameEquals("registrarNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrarNames = array; + continue; + } + if (property.NameEquals("registrantNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantNames = array; + continue; + } + if (property.NameEquals("adminNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminNames = array; + continue; + } + if (property.NameEquals("technicalNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalNames = array; + continue; + } + if (property.NameEquals("adminOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminOrgs = array; + continue; + } + if (property.NameEquals("technicalOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalOrgs = array; + continue; + } + if (property.NameEquals("registrantPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantPhones = array; + continue; + } + if (property.NameEquals("adminPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminPhones = array; + continue; + } + if (property.NameEquals("technicalPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalPhones = array; + continue; + } + if (property.NameEquals("detailedFromWhoisAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detailedFromWhoisAt = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new AsAsset(Optional.ToNullable(asn), Optional.ToList(asNames), Optional.ToList(orgNames), Optional.ToList(orgIds), Optional.ToList(countries), Optional.ToList(registries), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(registrarCreatedAt), Optional.ToList(registrarUpdatedAt), Optional.ToList(registrantContacts), Optional.ToList(adminContacts), Optional.ToList(technicalContacts), Optional.ToList(registrarNames), Optional.ToList(registrantNames), Optional.ToList(adminNames), Optional.ToList(technicalNames), Optional.ToList(adminOrgs), Optional.ToList(technicalOrgs), Optional.ToList(registrantPhones), Optional.ToList(adminPhones), Optional.ToList(technicalPhones), Optional.ToNullable(detailedFromWhoisAt)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AsAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAsAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.cs new file mode 100644 index 000000000000..80f0f62c8873 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAsset.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AsAsset. + public partial class AsAsset : InventoryAsset + { + /// Initializes a new instance of AsAsset. + internal AsAsset() + { + AsNames = new ChangeTrackingList(); + OrgNames = new ChangeTrackingList(); + OrgIds = new ChangeTrackingList(); + Countries = new ChangeTrackingList(); + Registries = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + RegistrarCreatedAt = new ChangeTrackingList(); + RegistrarUpdatedAt = new ChangeTrackingList(); + RegistrantContacts = new ChangeTrackingList(); + AdminContacts = new ChangeTrackingList(); + TechnicalContacts = new ChangeTrackingList(); + RegistrarNames = new ChangeTrackingList(); + RegistrantNames = new ChangeTrackingList(); + AdminNames = new ChangeTrackingList(); + TechnicalNames = new ChangeTrackingList(); + AdminOrgs = new ChangeTrackingList(); + TechnicalOrgs = new ChangeTrackingList(); + RegistrantPhones = new ChangeTrackingList(); + AdminPhones = new ChangeTrackingList(); + TechnicalPhones = new ChangeTrackingList(); + } + + /// Initializes a new instance of AsAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal AsAsset(long? asn, IReadOnlyList asNames, IReadOnlyList orgNames, IReadOnlyList orgIds, IReadOnlyList countries, IReadOnlyList registries, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList registrarCreatedAt, IReadOnlyList registrarUpdatedAt, IReadOnlyList registrantContacts, IReadOnlyList adminContacts, IReadOnlyList technicalContacts, IReadOnlyList registrarNames, IReadOnlyList registrantNames, IReadOnlyList adminNames, IReadOnlyList technicalNames, IReadOnlyList adminOrgs, IReadOnlyList technicalOrgs, IReadOnlyList registrantPhones, IReadOnlyList adminPhones, IReadOnlyList technicalPhones, DateTimeOffset? detailedFromWhoisAt) + { + Asn = asn; + AsNames = asNames; + OrgNames = orgNames; + OrgIds = orgIds; + Countries = countries; + Registries = registries; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + RegistrarCreatedAt = registrarCreatedAt; + RegistrarUpdatedAt = registrarUpdatedAt; + RegistrantContacts = registrantContacts; + AdminContacts = adminContacts; + TechnicalContacts = technicalContacts; + RegistrarNames = registrarNames; + RegistrantNames = registrantNames; + AdminNames = adminNames; + TechnicalNames = technicalNames; + AdminOrgs = adminOrgs; + TechnicalOrgs = technicalOrgs; + RegistrantPhones = registrantPhones; + AdminPhones = adminPhones; + TechnicalPhones = technicalPhones; + DetailedFromWhoisAt = detailedFromWhoisAt; + } + + /// Gets the asn. + public long? Asn { get; } + /// Gets the as names. + public IReadOnlyList AsNames { get; } + /// Gets the org names. + public IReadOnlyList OrgNames { get; } + /// Gets the org ids. + public IReadOnlyList OrgIds { get; } + /// Gets the countries. + public IReadOnlyList Countries { get; } + /// Gets the registries. + public IReadOnlyList Registries { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the registrar created at. + public IReadOnlyList RegistrarCreatedAt { get; } + /// Gets the registrar updated at. + public IReadOnlyList RegistrarUpdatedAt { get; } + /// Gets the registrant contacts. + public IReadOnlyList RegistrantContacts { get; } + /// Gets the admin contacts. + public IReadOnlyList AdminContacts { get; } + /// Gets the technical contacts. + public IReadOnlyList TechnicalContacts { get; } + /// Gets the registrar names. + public IReadOnlyList RegistrarNames { get; } + /// Gets the registrant names. + public IReadOnlyList RegistrantNames { get; } + /// Gets the admin names. + public IReadOnlyList AdminNames { get; } + /// Gets the technical names. + public IReadOnlyList TechnicalNames { get; } + /// Gets the admin orgs. + public IReadOnlyList AdminOrgs { get; } + /// Gets the technical orgs. + public IReadOnlyList TechnicalOrgs { get; } + /// Gets the registrant phones. + public IReadOnlyList RegistrantPhones { get; } + /// Gets the admin phones. + public IReadOnlyList AdminPhones { get; } + /// Gets the technical phones. + public IReadOnlyList TechnicalPhones { get; } + /// Gets the detailed from whois at. + public DateTimeOffset? DetailedFromWhoisAt { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.Serialization.cs new file mode 100644 index 000000000000..22f34323667b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AsAssetResource + { + internal static AsAssetResource DeserializeAsAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AsAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = AsAsset.DeserializeAsAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new AsAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AsAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAsAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.cs new file mode 100644 index 000000000000..2d70a2882cf9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AsAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AsAssetResource. + public partial class AsAssetResource : AssetResource + { + /// Initializes a new instance of AsAssetResource. + /// asset. + /// is null. + internal AsAssetResource(AsAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "as"; + Asset = asset; + } + + /// Initializes a new instance of AsAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal AsAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, AsAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public AsAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.Serialization.cs new file mode 100644 index 000000000000..b35ea3926455 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetPageResult + { + internal static AssetPageResult DeserializeAssetPageResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional totalElements = default; + Optional mark = default; + Optional nextLink = default; + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalElements"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalElements = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("mark"u8)) + { + mark = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetResource.DeserializeAssetResource(item)); + } + value = array; + continue; + } + } + return new AssetPageResult(Optional.ToNullable(totalElements), mark.Value, nextLink.Value, Optional.ToList(value)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetPageResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssetPageResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.cs new file mode 100644 index 000000000000..758867148943 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetPageResult.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The page of assets that match the provided metric. + public partial class AssetPageResult + { + /// Initializes a new instance of AssetPageResult. + internal AssetPageResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssetPageResult. + /// The total number of items available in the full result set. + /// The cursor mark to be used on the next request. Not set if using paging. + /// The link to access the next page of results. Not set if at the end of the result set. + /// The items in the current page of results. + internal AssetPageResult(long? totalElements, string mark, string nextLink, IReadOnlyList value) + { + TotalElements = totalElements; + Mark = mark; + NextLink = nextLink; + Value = value; + } + + /// The total number of items available in the full result set. + public long? TotalElements { get; } + /// The cursor mark to be used on the next request. Not set if using paging. + public string Mark { get; } + /// The link to access the next page of results. Not set if at the end of the result set. + public string NextLink { get; } + /// + /// The items in the current page of results. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.Serialization.cs new file mode 100644 index 000000000000..a08a4eb380d9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetResource + { + internal static AssetResource DeserializeAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "as": return AsAssetResource.DeserializeAsAssetResource(element); + case "contact": return ContactAssetResource.DeserializeContactAssetResource(element); + case "domain": return DomainAssetResource.DeserializeDomainAssetResource(element); + case "host": return HostAssetResource.DeserializeHostAssetResource(element); + case "ipAddress": return IpAddressAssetResource.DeserializeIpAddressAssetResource(element); + case "ipBlock": return IpBlockAssetResource.DeserializeIpBlockAssetResource(element); + case "page": return PageAssetResource.DeserializePageAssetResource(element); + case "sslCert": return SslCertAssetResource.DeserializeSslCertAssetResource(element); + } + } + return UnknownAssetResource.DeserializeUnknownAssetResource(element); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.cs new file mode 100644 index 000000000000..b08fbac6bc6c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetResource.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// + /// The items in the current page of results. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , and . + /// + public abstract partial class AssetResource + { + /// Initializes a new instance of AssetResource. + protected AssetResource() + { + Labels = new ChangeTrackingList(); + AuditTrail = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + internal AssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason) + { + Kind = kind; + Id = id; + Name = name; + DisplayName = displayName; + Uuid = uuid; + CreatedDate = createdDate; + UpdatedDate = updatedDate; + State = state; + ExternalId = externalId; + Labels = labels; + Wildcard = wildcard; + DiscoGroupName = discoGroupName; + AuditTrail = auditTrail; + Reason = reason; + } + + /// Discriminator. + internal string Kind { get; set; } + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// Global UUID for the asset. + public Guid? Uuid { get; } + /// The date this asset was first added to this workspace. + public DateTimeOffset? CreatedDate { get; } + /// The date this asset was last updated for this workspace. + public DateTimeOffset? UpdatedDate { get; } + /// Gets the state. + public AssetState? State { get; } + /// An optional customer provided identifier for this asset. + public string ExternalId { get; } + /// Customer labels assigned to this asset. + public IReadOnlyList Labels { get; } + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + public bool? Wildcard { get; } + /// The name of the DiscoGroup that brought added this asset to the workspace. + public string DiscoGroupName { get; } + /// The history of how this asset was pulled into the workspace through the discovery process. + public IReadOnlyList AuditTrail { get; } + /// Gets the reason. + public string Reason { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.Serialization.cs new file mode 100644 index 000000000000..3f31cff5cdcd --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetSecurityPolicy + { + internal static AssetSecurityPolicy DeserializeAssetSecurityPolicy(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional policyName = default; + Optional isAffected = default; + Optional description = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + Optional> sources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyName"u8)) + { + policyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAffected"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAffected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + } + return new AssetSecurityPolicy(policyName.Value, Optional.ToNullable(isAffected), description.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetSecurityPolicy FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssetSecurityPolicy(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.cs new file mode 100644 index 000000000000..1419ad6ac8c8 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSecurityPolicy.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AssetSecurityPolicy. + public partial class AssetSecurityPolicy + { + /// Initializes a new instance of AssetSecurityPolicy. + internal AssetSecurityPolicy() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssetSecurityPolicy. + /// + /// + /// + /// + /// + /// + /// + /// + internal AssetSecurityPolicy(string policyName, bool? isAffected, string description, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, IReadOnlyList sources) + { + PolicyName = policyName; + IsAffected = isAffected; + Description = description; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + Sources = sources; + } + + /// Gets the policy name. + public string PolicyName { get; } + /// Gets the is affected. + public bool? IsAffected { get; } + /// Gets the description. + public string Description { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetState.cs new file mode 100644 index 000000000000..adedb6e77bce --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetState.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + public readonly partial struct AssetState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CandidateValue = "candidate"; + private const string ConfirmedValue = "confirmed"; + private const string DismissedValue = "dismissed"; + private const string CandidateInvestigateValue = "candidateInvestigate"; + private const string AssociatedPartnerValue = "associatedPartner"; + private const string AssociatedThirdpartyValue = "associatedThirdparty"; + private const string ArchivedValue = "archived"; + + /// candidate. + public static AssetState Candidate { get; } = new AssetState(CandidateValue); + /// confirmed. + public static AssetState Confirmed { get; } = new AssetState(ConfirmedValue); + /// dismissed. + public static AssetState Dismissed { get; } = new AssetState(DismissedValue); + /// candidateInvestigate. + public static AssetState CandidateInvestigate { get; } = new AssetState(CandidateInvestigateValue); + /// associatedPartner. + public static AssetState AssociatedPartner { get; } = new AssetState(AssociatedPartnerValue); + /// associatedThirdparty. + public static AssetState AssociatedThirdparty { get; } = new AssetState(AssociatedThirdpartyValue); + /// archived. + public static AssetState Archived { get; } = new AssetState(ArchivedValue); + /// Determines if two values are the same. + public static bool operator ==(AssetState left, AssetState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetState left, AssetState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AssetState(string value) => new AssetState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetState other && Equals(other); + /// + public bool Equals(AssetState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.Serialization.cs new file mode 100644 index 000000000000..610ba8100b52 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetSummaryResult + { + internal static AssetSummaryResult DeserializeAssetSummaryResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional displayName = default; + Optional description = default; + Optional updatedAt = default; + Optional metricCategory = default; + Optional metric = default; + Optional filter = default; + Optional labelName = default; + Optional count = default; + Optional link = default; + Optional> children = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("updatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("metricCategory"u8)) + { + metricCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("metric"u8)) + { + metric = property.Value.GetString(); + continue; + } + if (property.NameEquals("filter"u8)) + { + filter = property.Value.GetString(); + continue; + } + if (property.NameEquals("labelName"u8)) + { + labelName = property.Value.GetString(); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("link"u8)) + { + link = property.Value.GetString(); + continue; + } + if (property.NameEquals("children"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeAssetSummaryResult(item)); + } + children = array; + continue; + } + } + return new AssetSummaryResult(displayName.Value, description.Value, Optional.ToNullable(updatedAt), metricCategory.Value, metric.Value, filter.Value, labelName.Value, Optional.ToNullable(count), link.Value, Optional.ToList(children)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AssetSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAssetSummaryResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.cs new file mode 100644 index 000000000000..92aebafb2dcd --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetSummaryResult.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The collection of asset summaries. + public partial class AssetSummaryResult + { + /// Initializes a new instance of AssetSummaryResult. + internal AssetSummaryResult() + { + Children = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssetSummaryResult. + /// The name of the summary response. Depending on the request time this will either be the asset filter, risk category, or risk metric. + /// The description of the summary response. Filters don't have a description. + /// The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, which always pull the live asset data. + /// If the request is for a metric category, this will contain the requested unique category name. + /// If the request is for a metric, this will contain the requested unique metric name. + /// If the request is for an asset filter, this will contain the corresponding filter. + /// An optional label used to filter requests results. + /// The count of assets matching the request parameters. + /// The link to the corresponding asset details. + /// The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and segmentBy this will contain facets. + internal AssetSummaryResult(string displayName, string description, DateTimeOffset? updatedAt, string metricCategory, string metric, string filter, string labelName, long? count, string link, IReadOnlyList children) + { + DisplayName = displayName; + Description = description; + UpdatedAt = updatedAt; + MetricCategory = metricCategory; + Metric = metric; + Filter = filter; + LabelName = labelName; + Count = count; + Link = link; + Children = children; + } + + /// The name of the summary response. Depending on the request time this will either be the asset filter, risk category, or risk metric. + public string DisplayName { get; } + /// The description of the summary response. Filters don't have a description. + public string Description { get; } + /// The last time risk categories or risk metrics were captured. Set to the current time for asset filter requests, which always pull the live asset data. + public DateTimeOffset? UpdatedAt { get; } + /// If the request is for a metric category, this will contain the requested unique category name. + public string MetricCategory { get; } + /// If the request is for a metric, this will contain the requested unique metric name. + public string Metric { get; } + /// If the request is for an asset filter, this will contain the corresponding filter. + public string Filter { get; } + /// An optional label used to filter requests results. + public string LabelName { get; } + /// The count of assets matching the request parameters. + public long? Count { get; } + /// The link to the corresponding asset details. + public string Link { get; } + /// The corresponding child entities. For metric categories this will contain metrics. For filters with groupBy and segmentBy this will contain facets. + public IReadOnlyList Children { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.Serialization.cs new file mode 100644 index 000000000000..79b926973913 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AssetUpdateData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(ExternalId)) + { + writer.WritePropertyName("externalId"u8); + writer.WriteStringValue(ExternalId); + } + if (Optional.IsCollectionDefined(Labels)) + { + writer.WritePropertyName("labels"u8); + writer.WriteStartObject(); + foreach (var item in Labels) + { + writer.WritePropertyName(item.Key); + writer.WriteBooleanValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Transfers)) + { + writer.WritePropertyName("transfers"u8); + writer.WriteStringValue(Transfers.Value.ToString()); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.cs new file mode 100644 index 000000000000..5666d7f36877 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateData.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to update an asset. + public partial class AssetUpdateData + { + /// Initializes a new instance of AssetUpdateData. + public AssetUpdateData() + { + Labels = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of AssetUpdateData. + /// The state to update the asset to. + /// A string which can be used to identify the asset in external systems. + /// Any Labels to update the asset with. + /// A list of asset types to cascade the updates to. + internal AssetUpdateData(AssetUpdateState? state, string externalId, IDictionary labels, AssetUpdateTransfers? transfers) + { + State = state; + ExternalId = externalId; + Labels = labels; + Transfers = transfers; + } + + /// The state to update the asset to. + public AssetUpdateState? State { get; set; } + /// A string which can be used to identify the asset in external systems. + public string ExternalId { get; set; } + /// Any Labels to update the asset with. + public IDictionary Labels { get; } + /// A list of asset types to cascade the updates to. + public AssetUpdateTransfers? Transfers { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateState.cs new file mode 100644 index 000000000000..fc5652e055a9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The state to update the asset to. + public readonly partial struct AssetUpdateState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetUpdateState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CandidateValue = "candidate"; + private const string ConfirmedValue = "confirmed"; + private const string DismissedValue = "dismissed"; + private const string CandidateInvestigateValue = "candidateInvestigate"; + private const string AssociatedPartnerValue = "associatedPartner"; + private const string AssociatedThirdpartyValue = "associatedThirdparty"; + + /// candidate. + public static AssetUpdateState Candidate { get; } = new AssetUpdateState(CandidateValue); + /// confirmed. + public static AssetUpdateState Confirmed { get; } = new AssetUpdateState(ConfirmedValue); + /// dismissed. + public static AssetUpdateState Dismissed { get; } = new AssetUpdateState(DismissedValue); + /// candidateInvestigate. + public static AssetUpdateState CandidateInvestigate { get; } = new AssetUpdateState(CandidateInvestigateValue); + /// associatedPartner. + public static AssetUpdateState AssociatedPartner { get; } = new AssetUpdateState(AssociatedPartnerValue); + /// associatedThirdparty. + public static AssetUpdateState AssociatedThirdparty { get; } = new AssetUpdateState(AssociatedThirdpartyValue); + /// Determines if two values are the same. + public static bool operator ==(AssetUpdateState left, AssetUpdateState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetUpdateState left, AssetUpdateState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AssetUpdateState(string value) => new AssetUpdateState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetUpdateState other && Equals(other); + /// + public bool Equals(AssetUpdateState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateTransfers.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateTransfers.cs new file mode 100644 index 000000000000..2b00c2ec0ae1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AssetUpdateTransfers.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// A list of asset types to cascade the updates to. + public readonly partial struct AssetUpdateTransfers : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssetUpdateTransfers(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsValue = "as"; + private const string ContactValue = "contact"; + private const string DomainValue = "domain"; + private const string HostValue = "host"; + private const string IpAddressValue = "ipAddress"; + private const string IpBlockValue = "ipBlock"; + private const string PageValue = "page"; + private const string SslCertValue = "sslCert"; + + /// as. + public static AssetUpdateTransfers As { get; } = new AssetUpdateTransfers(AsValue); + /// contact. + public static AssetUpdateTransfers Contact { get; } = new AssetUpdateTransfers(ContactValue); + /// domain. + public static AssetUpdateTransfers Domain { get; } = new AssetUpdateTransfers(DomainValue); + /// host. + public static AssetUpdateTransfers Host { get; } = new AssetUpdateTransfers(HostValue); + /// ipAddress. + public static AssetUpdateTransfers IpAddress { get; } = new AssetUpdateTransfers(IpAddressValue); + /// ipBlock. + public static AssetUpdateTransfers IpBlock { get; } = new AssetUpdateTransfers(IpBlockValue); + /// page. + public static AssetUpdateTransfers Page { get; } = new AssetUpdateTransfers(PageValue); + /// sslCert. + public static AssetUpdateTransfers SslCert { get; } = new AssetUpdateTransfers(SslCertValue); + /// Determines if two values are the same. + public static bool operator ==(AssetUpdateTransfers left, AssetUpdateTransfers right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetUpdateTransfers left, AssetUpdateTransfers right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AssetUpdateTransfers(string value) => new AssetUpdateTransfers(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetUpdateTransfers other && Equals(other); + /// + public bool Equals(AssetUpdateTransfers other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.Serialization.cs new file mode 100644 index 000000000000..501b96f4a4b6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Attribute + { + internal static Attribute DeserializeAttribute(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional attributeType = default; + Optional attributeValue = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("attributeType"u8)) + { + attributeType = property.Value.GetString(); + continue; + } + if (property.NameEquals("attributeValue"u8)) + { + attributeValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new Attribute(attributeType.Value, attributeValue.Value, Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Attribute FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAttribute(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.cs new file mode 100644 index 000000000000..cde909308d1e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Attribute.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Attribute. + public partial class Attribute + { + /// Initializes a new instance of Attribute. + internal Attribute() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of Attribute. + /// + /// + /// + /// + /// + /// + /// + internal Attribute(string attributeType, string attributeValue, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent) + { + AttributeType = attributeType; + AttributeValue = attributeValue; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + } + + /// Gets the attribute type. + public string AttributeType { get; } + /// Gets the attribute value. + public string AttributeValue { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.Serialization.cs new file mode 100644 index 000000000000..a8654ca126b2 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AuditTrailItem + { + internal static AuditTrailItem DeserializeAuditTrailItem(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + Optional name = default; + Optional displayName = default; + Optional kind = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new AuditTrailItemKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new AuditTrailItem(id.Value, name.Value, displayName.Value, Optional.ToNullable(kind), reason.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AuditTrailItem FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAuditTrailItem(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs new file mode 100644 index 000000000000..0d0eb8cce10a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItem.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The history of how this asset was pulled into the workspace through the discovery process. + public partial class AuditTrailItem + { + /// Initializes a new instance of AuditTrailItem. + internal AuditTrailItem() + { + } + + /// Initializes a new instance of AuditTrailItem. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The kind of asset. + /// An explanation of why this audit trail node was discovered from the previous node. + internal AuditTrailItem(string id, string name, string displayName, AuditTrailItemKind? kind, string reason) + { + Id = id; + Name = name; + DisplayName = displayName; + Kind = kind; + Reason = reason; + } + + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// The kind of asset. + public AuditTrailItemKind? Kind { get; } + /// An explanation of why this audit trail node was discovered from the previous node. + public string Reason { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItemKind.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItemKind.cs new file mode 100644 index 000000000000..385eaeb3010e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AuditTrailItemKind.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The kind of asset. + public readonly partial struct AuditTrailItemKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AuditTrailItemKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsValue = "as"; + private const string ContactValue = "contact"; + private const string DomainValue = "domain"; + private const string HostValue = "host"; + private const string IpAddressValue = "ipAddress"; + private const string IpBlockValue = "ipBlock"; + private const string PageValue = "page"; + private const string SslCertValue = "sslCert"; + + /// as. + public static AuditTrailItemKind As { get; } = new AuditTrailItemKind(AsValue); + /// contact. + public static AuditTrailItemKind Contact { get; } = new AuditTrailItemKind(ContactValue); + /// domain. + public static AuditTrailItemKind Domain { get; } = new AuditTrailItemKind(DomainValue); + /// host. + public static AuditTrailItemKind Host { get; } = new AuditTrailItemKind(HostValue); + /// ipAddress. + public static AuditTrailItemKind IpAddress { get; } = new AuditTrailItemKind(IpAddressValue); + /// ipBlock. + public static AuditTrailItemKind IpBlock { get; } = new AuditTrailItemKind(IpBlockValue); + /// page. + public static AuditTrailItemKind Page { get; } = new AuditTrailItemKind(PageValue); + /// sslCert. + public static AuditTrailItemKind SslCert { get; } = new AuditTrailItemKind(SslCertValue); + /// Determines if two values are the same. + public static bool operator ==(AuditTrailItemKind left, AuditTrailItemKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AuditTrailItemKind left, AuditTrailItemKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AuditTrailItemKind(string value) => new AuditTrailItemKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AuditTrailItemKind other && Equals(other); + /// + public bool Equals(AuditTrailItemKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.Serialization.cs new file mode 100644 index 000000000000..f25feb897325 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AzureDataExplorerDataConnection + { + internal static AzureDataExplorerDataConnection DeserializeAzureDataExplorerDataConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureDataExplorerDataConnectionProperties properties = default; + string kind = default; + Optional id = default; + string name = default; + Optional displayName = default; + Optional content = default; + Optional createdDate = default; + Optional frequency = default; + Optional frequencyOffset = default; + Optional updatedDate = default; + Optional userUpdatedAt = default; + Optional active = default; + Optional inactiveMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = AzureDataExplorerDataConnectionProperties.DeserializeAzureDataExplorerDataConnectionProperties(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = new DataConnectionContent(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequency = new DataConnectionFrequency(property.Value.GetString()); + continue; + } + if (property.NameEquals("frequencyOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userUpdatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("active"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + active = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("inactiveMessage"u8)) + { + inactiveMessage = property.Value.GetString(); + continue; + } + } + return new AzureDataExplorerDataConnection(kind, id.Value, name, displayName.Value, Optional.ToNullable(content), Optional.ToNullable(createdDate), Optional.ToNullable(frequency), Optional.ToNullable(frequencyOffset), Optional.ToNullable(updatedDate), Optional.ToNullable(userUpdatedAt), Optional.ToNullable(active), inactiveMessage.Value, properties); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new AzureDataExplorerDataConnection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureDataExplorerDataConnection(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs new file mode 100644 index 000000000000..e0211b3ef337 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnection.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AzureDataExplorerDataConnection. + public partial class AzureDataExplorerDataConnection : DataConnection + { + /// Initializes a new instance of AzureDataExplorerDataConnection. + /// properties. + /// is null. + internal AzureDataExplorerDataConnection(AzureDataExplorerDataConnectionProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Kind = "azureDataExplorer"; + Properties = properties; + } + + /// Initializes a new instance of AzureDataExplorerDataConnection. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + /// properties. + internal AzureDataExplorerDataConnection(string kind, string id, string name, string displayName, DataConnectionContent? content, DateTimeOffset? createdDate, DataConnectionFrequency? frequency, int? frequencyOffset, DateTimeOffset? updatedDate, DateTimeOffset? userUpdatedAt, bool? active, string inactiveMessage, AzureDataExplorerDataConnectionProperties properties) : base(kind, id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage) + { + Properties = properties; + } + + /// properties. + public AzureDataExplorerDataConnectionProperties Properties { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.Serialization.cs new file mode 100644 index 000000000000..177fc1e102e5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AzureDataExplorerDataConnectionData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content.Value.ToString()); + } + if (Optional.IsDefined(Frequency)) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.Value.ToString()); + } + if (Optional.IsDefined(FrequencyOffset)) + { + writer.WritePropertyName("frequencyOffset"u8); + writer.WriteNumberValue(FrequencyOffset.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.cs new file mode 100644 index 000000000000..78a9c596703b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionData.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The AzureDataExplorerDataConnectionData. + public partial class AzureDataExplorerDataConnectionData : DataConnectionData + { + /// Initializes a new instance of AzureDataExplorerDataConnectionData. + /// properties. + /// is null. + public AzureDataExplorerDataConnectionData(AzureDataExplorerDataConnectionProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Kind = "azureDataExplorer"; + Properties = properties; + } + + /// Initializes a new instance of AzureDataExplorerDataConnectionData. + /// Discriminator. + /// The name of data connection. + /// The type of data the data connection will transfer. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + /// properties. + internal AzureDataExplorerDataConnectionData(string kind, string name, DataConnectionContent? content, DataConnectionFrequency? frequency, int? frequencyOffset, AzureDataExplorerDataConnectionProperties properties) : base(kind, name, content, frequency, frequencyOffset) + { + Properties = properties; + } + + /// properties. + public AzureDataExplorerDataConnectionProperties Properties { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..ec7ef5aee29f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.Serialization.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class AzureDataExplorerDataConnectionProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ClusterName)) + { + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + } + if (Optional.IsDefined(Region)) + { + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + } + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + writer.WriteEndObject(); + } + + internal static AzureDataExplorerDataConnectionProperties DeserializeAzureDataExplorerDataConnectionProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional clusterName = default; + Optional region = default; + Optional databaseName = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + } + return new AzureDataExplorerDataConnectionProperties(clusterName.Value, region.Value, databaseName.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AzureDataExplorerDataConnectionProperties FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAzureDataExplorerDataConnectionProperties(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.cs new file mode 100644 index 000000000000..ffa3faf966a3 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/AzureDataExplorerDataConnectionProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The AzureDataExplorerDataConnectionProperties. + public partial class AzureDataExplorerDataConnectionProperties : DataConnectionProperties + { + /// Initializes a new instance of AzureDataExplorerDataConnectionProperties. + public AzureDataExplorerDataConnectionProperties() + { + } + + /// Initializes a new instance of AzureDataExplorerDataConnectionProperties. + /// The azure data explorer cluster name. + /// The azure data explorer region. + /// The azure data explorer database name. + internal AzureDataExplorerDataConnectionProperties(string clusterName, string region, string databaseName) + { + ClusterName = clusterName; + Region = region; + DatabaseName = databaseName; + } + + /// The azure data explorer cluster name. + public string ClusterName { get; set; } + /// The azure data explorer region. + public string Region { get; set; } + /// The azure data explorer database name. + public string DatabaseName { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.Serialization.cs new file mode 100644 index 000000000000..ff3ac0da7837 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Banner + { + internal static Banner DeserializeBanner(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional port = default; + Optional banner = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional scanType = default; + Optional bannerMetadata = default; + Optional recent = default; + Optional sha256 = default; + Optional> sources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("banner"u8)) + { + banner = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("scanType"u8)) + { + scanType = property.Value.GetString(); + continue; + } + if (property.NameEquals("bannerMetadata"u8)) + { + bannerMetadata = property.Value.GetString(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sha256"u8)) + { + sha256 = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + } + return new Banner(Optional.ToNullable(port), banner.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), scanType.Value, bannerMetadata.Value, Optional.ToNullable(recent), sha256.Value, Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Banner FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeBanner(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.cs new file mode 100644 index 000000000000..db2de9dd7c2a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Banner.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Banner. + public partial class Banner + { + /// Initializes a new instance of Banner. + internal Banner() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of Banner. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal Banner(int? port, string bannerProperty, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, string scanType, string bannerMetadata, bool? recent, string sha256, IReadOnlyList sources) + { + Port = port; + BannerProperty = bannerProperty; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + ScanType = scanType; + BannerMetadata = bannerMetadata; + Recent = recent; + Sha256 = sha256; + Sources = sources; + } + + /// Gets the port. + public int? Port { get; } + /// Gets the banner property. + public string BannerProperty { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the scan type. + public string ScanType { get; } + /// Gets the banner metadata. + public string BannerMetadata { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the sha 256. + public string Sha256 { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.Serialization.cs new file mode 100644 index 000000000000..72815443ae7d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ContactAsset + { + internal static ContactAsset DeserializeContactAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional email = default; + Optional> names = default; + Optional> organizations = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("names"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + names = array; + continue; + } + if (property.NameEquals("organizations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + organizations = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + } + return new ContactAsset(email.Value, Optional.ToList(names), Optional.ToList(organizations), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ContactAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContactAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.cs new file mode 100644 index 000000000000..c80d935fa475 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAsset.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ContactAsset. + public partial class ContactAsset : InventoryAsset + { + /// Initializes a new instance of ContactAsset. + internal ContactAsset() + { + Names = new ChangeTrackingList(); + Organizations = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ContactAsset. + /// + /// + /// + /// + /// + /// + /// + internal ContactAsset(string email, IReadOnlyList names, IReadOnlyList organizations, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count) + { + Email = email; + Names = names; + Organizations = organizations; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + } + + /// Gets the email. + public string Email { get; } + /// Gets the names. + public IReadOnlyList Names { get; } + /// Gets the organizations. + public IReadOnlyList Organizations { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.Serialization.cs new file mode 100644 index 000000000000..23e137b30470 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ContactAssetResource + { + internal static ContactAssetResource DeserializeContactAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContactAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = ContactAsset.DeserializeContactAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new ContactAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new ContactAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeContactAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.cs new file mode 100644 index 000000000000..bcae2048551e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ContactAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ContactAssetResource. + public partial class ContactAssetResource : AssetResource + { + /// Initializes a new instance of ContactAssetResource. + /// asset. + /// is null. + internal ContactAssetResource(ContactAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "contact"; + Asset = asset; + } + + /// Initializes a new instance of ContactAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal ContactAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, ContactAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public ContactAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.Serialization.cs new file mode 100644 index 000000000000..24ca0fa5e584 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Cookie + { + internal static Cookie DeserializeCookie(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional cookieName = default; + Optional cookieDomain = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + Optional cookieExpiryDate = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cookieName"u8)) + { + cookieName = property.Value.GetString(); + continue; + } + if (property.NameEquals("cookieDomain"u8)) + { + cookieDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cookieExpiryDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cookieExpiryDate = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new Cookie(cookieName.Value, cookieDomain.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToNullable(cookieExpiryDate)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Cookie FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCookie(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.cs new file mode 100644 index 000000000000..2090f5e28f3a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cookie.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Cookie. + public partial class Cookie + { + /// Initializes a new instance of Cookie. + internal Cookie() + { + } + + /// Initializes a new instance of Cookie. + /// + /// + /// + /// + /// + /// + /// + internal Cookie(string cookieName, string cookieDomain, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, DateTimeOffset? cookieExpiryDate) + { + CookieName = cookieName; + CookieDomain = cookieDomain; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + CookieExpiryDate = cookieExpiryDate; + } + + /// Gets the cookie name. + public string CookieName { get; } + /// Gets the cookie domain. + public string CookieDomain { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the cookie expiry date. + public DateTimeOffset? CookieExpiryDate { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.Serialization.cs new file mode 100644 index 000000000000..46ecc2c53efa --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Cve + { + internal static Cve DeserializeCve(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional cweId = default; + Optional cvssScore = default; + Optional cvss3Summary = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("cweId"u8)) + { + cweId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cvssScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cvssScore = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("cvss3Summary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cvss3Summary = Cvss3Summary.DeserializeCvss3Summary(property.Value); + continue; + } + } + return new Cve(name.Value, cweId.Value, Optional.ToNullable(cvssScore), cvss3Summary.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Cve FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCve(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.cs new file mode 100644 index 000000000000..26e3faea2b0b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cve.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The Cve. + public partial class Cve + { + /// Initializes a new instance of Cve. + internal Cve() + { + } + + /// Initializes a new instance of Cve. + /// + /// + /// + /// + internal Cve(string name, string cweId, float? cvssScore, Cvss3Summary cvss3Summary) + { + Name = name; + CweId = cweId; + CvssScore = cvssScore; + Cvss3Summary = cvss3Summary; + } + + /// Gets the name. + public string Name { get; } + /// Gets the cwe id. + public string CweId { get; } + /// Gets the cvss score. + public float? CvssScore { get; } + /// Gets the cvss 3 summary. + public Cvss3Summary Cvss3Summary { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.Serialization.cs new file mode 100644 index 000000000000..b0572c0113c7 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.Serialization.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Cvss3Summary + { + internal static Cvss3Summary DeserializeCvss3Summary(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional version = default; + Optional vectorString = default; + Optional attackVector = default; + Optional attackComplexity = default; + Optional privilegesRequired = default; + Optional userInteraction = default; + Optional scope = default; + Optional confidentialityImpact = default; + Optional integrityImpact = default; + Optional availabilityImpact = default; + Optional baseScore = default; + Optional baseSeverity = default; + Optional exploitCodeMaturity = default; + Optional remediationLevel = default; + Optional reportConfidence = default; + Optional exploitabilityScore = default; + Optional impactScore = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("vectorString"u8)) + { + vectorString = property.Value.GetString(); + continue; + } + if (property.NameEquals("attackVector"u8)) + { + attackVector = property.Value.GetString(); + continue; + } + if (property.NameEquals("attackComplexity"u8)) + { + attackComplexity = property.Value.GetString(); + continue; + } + if (property.NameEquals("privilegesRequired"u8)) + { + privilegesRequired = property.Value.GetString(); + continue; + } + if (property.NameEquals("userInteraction"u8)) + { + userInteraction = property.Value.GetString(); + continue; + } + if (property.NameEquals("scope"u8)) + { + scope = property.Value.GetString(); + continue; + } + if (property.NameEquals("confidentialityImpact"u8)) + { + confidentialityImpact = property.Value.GetString(); + continue; + } + if (property.NameEquals("integrityImpact"u8)) + { + integrityImpact = property.Value.GetString(); + continue; + } + if (property.NameEquals("availabilityImpact"u8)) + { + availabilityImpact = property.Value.GetString(); + continue; + } + if (property.NameEquals("baseScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + baseScore = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("baseSeverity"u8)) + { + baseSeverity = property.Value.GetString(); + continue; + } + if (property.NameEquals("exploitCodeMaturity"u8)) + { + exploitCodeMaturity = property.Value.GetString(); + continue; + } + if (property.NameEquals("remediationLevel"u8)) + { + remediationLevel = property.Value.GetString(); + continue; + } + if (property.NameEquals("reportConfidence"u8)) + { + reportConfidence = property.Value.GetString(); + continue; + } + if (property.NameEquals("exploitabilityScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exploitabilityScore = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("impactScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + impactScore = property.Value.GetSingle(); + continue; + } + } + return new Cvss3Summary(version.Value, vectorString.Value, attackVector.Value, attackComplexity.Value, privilegesRequired.Value, userInteraction.Value, scope.Value, confidentialityImpact.Value, integrityImpact.Value, availabilityImpact.Value, Optional.ToNullable(baseScore), baseSeverity.Value, exploitCodeMaturity.Value, remediationLevel.Value, reportConfidence.Value, Optional.ToNullable(exploitabilityScore), Optional.ToNullable(impactScore)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Cvss3Summary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCvss3Summary(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.cs new file mode 100644 index 000000000000..0dfe03e9a163 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Cvss3Summary.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The Cvss3Summary. + public partial class Cvss3Summary + { + /// Initializes a new instance of Cvss3Summary. + internal Cvss3Summary() + { + } + + /// Initializes a new instance of Cvss3Summary. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal Cvss3Summary(string version, string vectorString, string attackVector, string attackComplexity, string privilegesRequired, string userInteraction, string scope, string confidentialityImpact, string integrityImpact, string availabilityImpact, float? baseScore, string baseSeverity, string exploitCodeMaturity, string remediationLevel, string reportConfidence, float? exploitabilityScore, float? impactScore) + { + Version = version; + VectorString = vectorString; + AttackVector = attackVector; + AttackComplexity = attackComplexity; + PrivilegesRequired = privilegesRequired; + UserInteraction = userInteraction; + Scope = scope; + ConfidentialityImpact = confidentialityImpact; + IntegrityImpact = integrityImpact; + AvailabilityImpact = availabilityImpact; + BaseScore = baseScore; + BaseSeverity = baseSeverity; + ExploitCodeMaturity = exploitCodeMaturity; + RemediationLevel = remediationLevel; + ReportConfidence = reportConfidence; + ExploitabilityScore = exploitabilityScore; + ImpactScore = impactScore; + } + + /// Gets the version. + public string Version { get; } + /// Gets the vector string. + public string VectorString { get; } + /// Gets the attack vector. + public string AttackVector { get; } + /// Gets the attack complexity. + public string AttackComplexity { get; } + /// Gets the privileges required. + public string PrivilegesRequired { get; } + /// Gets the user interaction. + public string UserInteraction { get; } + /// Gets the scope. + public string Scope { get; } + /// Gets the confidentiality impact. + public string ConfidentialityImpact { get; } + /// Gets the integrity impact. + public string IntegrityImpact { get; } + /// Gets the availability impact. + public string AvailabilityImpact { get; } + /// Gets the base score. + public float? BaseScore { get; } + /// Gets the base severity. + public string BaseSeverity { get; } + /// Gets the exploit code maturity. + public string ExploitCodeMaturity { get; } + /// Gets the remediation level. + public string RemediationLevel { get; } + /// Gets the report confidence. + public string ReportConfidence { get; } + /// Gets the exploitability score. + public float? ExploitabilityScore { get; } + /// Gets the impact score. + public float? ImpactScore { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.Serialization.cs new file mode 100644 index 000000000000..d404f290d285 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DataConnection + { + internal static DataConnection DeserializeDataConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("kind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "logAnalytics": return LogAnalyticsDataConnection.DeserializeLogAnalyticsDataConnection(element); + case "azureDataExplorer": return AzureDataExplorerDataConnection.DeserializeAzureDataExplorerDataConnection(element); + } + } + return UnknownDataConnection.DeserializeUnknownDataConnection(element); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DataConnection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDataConnection(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs new file mode 100644 index 000000000000..22e870f5b2dd --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnection.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// + /// The DataConnection. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataConnection + { + /// Initializes a new instance of DataConnection. + protected DataConnection() + { + } + + /// Initializes a new instance of DataConnection. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + internal DataConnection(string kind, string id, string name, string displayName, DataConnectionContent? content, DateTimeOffset? createdDate, DataConnectionFrequency? frequency, int? frequencyOffset, DateTimeOffset? updatedDate, DateTimeOffset? userUpdatedAt, bool? active, string inactiveMessage) + { + Kind = kind; + Id = id; + Name = name; + DisplayName = displayName; + Content = content; + CreatedDate = createdDate; + Frequency = frequency; + FrequencyOffset = frequencyOffset; + UpdatedDate = updatedDate; + UserUpdatedAt = userUpdatedAt; + Active = active; + InactiveMessage = inactiveMessage; + } + + /// Discriminator. + internal string Kind { get; set; } + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// The type of data the data connection will transfer. + public DataConnectionContent? Content { get; } + /// The date the data connection was created. + public DateTimeOffset? CreatedDate { get; } + /// The rate at which the data connection will receive updates. + public DataConnectionFrequency? Frequency { get; } + /// The day to update the data connection on. + public int? FrequencyOffset { get; } + /// The date the data connection was last updated. + public DateTimeOffset? UpdatedDate { get; } + /// The date the data connection was last updated by user. + public DateTimeOffset? UserUpdatedAt { get; } + /// An indicator of whether the data connection is active. + public bool? Active { get; } + /// A message that specifies details about data connection if inactive. + public string InactiveMessage { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionContent.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionContent.cs new file mode 100644 index 000000000000..57e23b550634 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionContent.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The type of data the data connection will transfer. + public readonly partial struct DataConnectionContent : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataConnectionContent(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AssetsValue = "assets"; + private const string AttackSurfaceInsightsValue = "attackSurfaceInsights"; + + /// assets. + public static DataConnectionContent Assets { get; } = new DataConnectionContent(AssetsValue); + /// attackSurfaceInsights. + public static DataConnectionContent AttackSurfaceInsights { get; } = new DataConnectionContent(AttackSurfaceInsightsValue); + /// Determines if two values are the same. + public static bool operator ==(DataConnectionContent left, DataConnectionContent right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataConnectionContent left, DataConnectionContent right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataConnectionContent(string value) => new DataConnectionContent(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataConnectionContent other && Equals(other); + /// + public bool Equals(DataConnectionContent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.Serialization.cs new file mode 100644 index 000000000000..71b4f704d619 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DataConnectionData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content.Value.ToString()); + } + if (Optional.IsDefined(Frequency)) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.Value.ToString()); + } + if (Optional.IsDefined(FrequencyOffset)) + { + writer.WritePropertyName("frequencyOffset"u8); + writer.WriteNumberValue(FrequencyOffset.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.cs new file mode 100644 index 000000000000..8e11423778b0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionData.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// + /// The DataConnectionData. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataConnectionData + { + /// Initializes a new instance of DataConnectionData. + protected DataConnectionData() + { + } + + /// Initializes a new instance of DataConnectionData. + /// Discriminator. + /// The name of data connection. + /// The type of data the data connection will transfer. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + internal DataConnectionData(string kind, string name, DataConnectionContent? content, DataConnectionFrequency? frequency, int? frequencyOffset) + { + Kind = kind; + Name = name; + Content = content; + Frequency = frequency; + FrequencyOffset = frequencyOffset; + } + + /// Discriminator. + internal string Kind { get; set; } + /// The name of data connection. + public string Name { get; set; } + /// The type of data the data connection will transfer. + public DataConnectionContent? Content { get; set; } + /// The rate at which the data connection will receive updates. + public DataConnectionFrequency? Frequency { get; set; } + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + public int? FrequencyOffset { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionFrequency.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionFrequency.cs new file mode 100644 index 000000000000..bb16b9147894 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionFrequency.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The rate at which the data connection will receive updates. + public readonly partial struct DataConnectionFrequency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataConnectionFrequency(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DailyValue = "daily"; + private const string WeeklyValue = "weekly"; + private const string MonthlyValue = "monthly"; + + /// daily. + public static DataConnectionFrequency Daily { get; } = new DataConnectionFrequency(DailyValue); + /// weekly. + public static DataConnectionFrequency Weekly { get; } = new DataConnectionFrequency(WeeklyValue); + /// monthly. + public static DataConnectionFrequency Monthly { get; } = new DataConnectionFrequency(MonthlyValue); + /// Determines if two values are the same. + public static bool operator ==(DataConnectionFrequency left, DataConnectionFrequency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataConnectionFrequency left, DataConnectionFrequency right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DataConnectionFrequency(string value) => new DataConnectionFrequency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataConnectionFrequency other && Equals(other); + /// + public bool Equals(DataConnectionFrequency other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionProperties.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionProperties.cs new file mode 100644 index 000000000000..53d1ca9b5749 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DataConnectionProperties.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The properties required to establish connection to a particular service. + public partial class DataConnectionProperties + { + /// Initializes a new instance of DataConnectionProperties. + internal DataConnectionProperties() + { + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.Serialization.cs new file mode 100644 index 000000000000..3dc0af931846 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DependentResource + { + internal static DependentResource DeserializeDependentResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional md5 = default; + Optional responseBodySize = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional firstSeenCrawlGuid = default; + Optional firstSeenPageGuid = default; + Optional firstSeenResourceGuid = default; + Optional lastSeenCrawlGuid = default; + Optional lastSeenPageGuid = default; + Optional lastSeenResourceGuid = default; + Optional> responseBodyMinhash = default; + Optional contentType = default; + Optional sha256 = default; + Optional sha384 = default; + Optional sha512 = default; + Optional url = default; + Optional cached = default; + Optional> sriChecks = default; + Optional host = default; + Optional lastObservedViolation = default; + Optional lastObservedValidation = default; + Optional lastObservedActualSriHash = default; + Optional lastObservedExpectedSriHash = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("md5"u8)) + { + md5 = property.Value.GetString(); + continue; + } + if (property.NameEquals("responseBodySize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseBodySize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("firstSeenCrawlGuid"u8)) + { + firstSeenCrawlGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeenPageGuid"u8)) + { + firstSeenPageGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeenResourceGuid"u8)) + { + firstSeenResourceGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastSeenCrawlGuid"u8)) + { + lastSeenCrawlGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastSeenPageGuid"u8)) + { + lastSeenPageGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastSeenResourceGuid"u8)) + { + lastSeenResourceGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("responseBodyMinhash"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + responseBodyMinhash = array; + continue; + } + if (property.NameEquals("contentType"u8)) + { + contentType = property.Value.GetString(); + continue; + } + if (property.NameEquals("sha256"u8)) + { + sha256 = property.Value.GetString(); + continue; + } + if (property.NameEquals("sha384"u8)) + { + sha384 = property.Value.GetString(); + continue; + } + if (property.NameEquals("sha512"u8)) + { + sha512 = property.Value.GetString(); + continue; + } + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("cached"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cached = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sriChecks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SubResourceIntegrityCheck.DeserializeSubResourceIntegrityCheck(item)); + } + sriChecks = array; + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastObservedViolation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastObservedViolation = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastObservedValidation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastObservedValidation = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastObservedActualSriHash"u8)) + { + lastObservedActualSriHash = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastObservedExpectedSriHash"u8)) + { + lastObservedExpectedSriHash = property.Value.GetString(); + continue; + } + } + return new DependentResource(md5.Value, Optional.ToNullable(responseBodySize), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), firstSeenCrawlGuid.Value, firstSeenPageGuid.Value, firstSeenResourceGuid.Value, lastSeenCrawlGuid.Value, lastSeenPageGuid.Value, lastSeenResourceGuid.Value, Optional.ToList(responseBodyMinhash), contentType.Value, sha256.Value, sha384.Value, sha512.Value, url.Value, Optional.ToNullable(cached), Optional.ToList(sriChecks), host.Value, Optional.ToNullable(lastObservedViolation), Optional.ToNullable(lastObservedValidation), lastObservedActualSriHash.Value, lastObservedExpectedSriHash.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DependentResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDependentResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.cs new file mode 100644 index 000000000000..d42b1747920d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DependentResource.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The DependentResource. + public partial class DependentResource + { + /// Initializes a new instance of DependentResource. + internal DependentResource() + { + ResponseBodyMinhash = new ChangeTrackingList(); + SriChecks = new ChangeTrackingList(); + } + + /// Initializes a new instance of DependentResource. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal DependentResource(string md5, long? responseBodySize, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, string firstSeenCrawlGuid, string firstSeenPageGuid, string firstSeenResourceGuid, string lastSeenCrawlGuid, string lastSeenPageGuid, string lastSeenResourceGuid, IReadOnlyList responseBodyMinhash, string contentType, string sha256, string sha384, string sha512, Uri url, bool? cached, IReadOnlyList sriChecks, string host, DateTimeOffset? lastObservedViolation, DateTimeOffset? lastObservedValidation, string lastObservedActualSriHash, string lastObservedExpectedSriHash) + { + Md5 = md5; + ResponseBodySize = responseBodySize; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + FirstSeenCrawlGuid = firstSeenCrawlGuid; + FirstSeenPageGuid = firstSeenPageGuid; + FirstSeenResourceGuid = firstSeenResourceGuid; + LastSeenCrawlGuid = lastSeenCrawlGuid; + LastSeenPageGuid = lastSeenPageGuid; + LastSeenResourceGuid = lastSeenResourceGuid; + ResponseBodyMinhash = responseBodyMinhash; + ContentType = contentType; + Sha256 = sha256; + Sha384 = sha384; + Sha512 = sha512; + Url = url; + Cached = cached; + SriChecks = sriChecks; + Host = host; + LastObservedViolation = lastObservedViolation; + LastObservedValidation = lastObservedValidation; + LastObservedActualSriHash = lastObservedActualSriHash; + LastObservedExpectedSriHash = lastObservedExpectedSriHash; + } + + /// Gets the md 5. + public string Md5 { get; } + /// Gets the response body size. + public long? ResponseBodySize { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the first seen crawl guid. + public string FirstSeenCrawlGuid { get; } + /// Gets the first seen page guid. + public string FirstSeenPageGuid { get; } + /// Gets the first seen resource guid. + public string FirstSeenResourceGuid { get; } + /// Gets the last seen crawl guid. + public string LastSeenCrawlGuid { get; } + /// Gets the last seen page guid. + public string LastSeenPageGuid { get; } + /// Gets the last seen resource guid. + public string LastSeenResourceGuid { get; } + /// Gets the response body minhash. + public IReadOnlyList ResponseBodyMinhash { get; } + /// Gets the content type. + public string ContentType { get; } + /// Gets the sha 256. + public string Sha256 { get; } + /// Gets the sha 384. + public string Sha384 { get; } + /// Gets the sha 512. + public string Sha512 { get; } + /// Gets the url. + public Uri Url { get; } + /// Gets the cached. + public bool? Cached { get; } + /// Gets the sri checks. + public IReadOnlyList SriChecks { get; } + /// Gets the host. + public string Host { get; } + /// Gets the last observed violation. + public DateTimeOffset? LastObservedViolation { get; } + /// Gets the last observed validation. + public DateTimeOffset? LastObservedValidation { get; } + /// Gets the last observed actual sri hash. + public string LastObservedActualSriHash { get; } + /// Gets the last observed expected sri hash. + public string LastObservedExpectedSriHash { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.Serialization.cs new file mode 100644 index 000000000000..a18a4f6b0050 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DiscoGroup + { + internal static DiscoGroup DeserializeDiscoGroup(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + string name = default; + Optional displayName = default; + Optional description = default; + Optional tier = default; + Optional frequencyMilliseconds = default; + Optional> seeds = default; + Optional> names = default; + Optional> excludes = default; + Optional latestRun = default; + Optional createdDate = default; + Optional templateId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("tier"u8)) + { + tier = property.Value.GetString(); + continue; + } + if (property.NameEquals("frequencyMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyMilliseconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("seeds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoSource.DeserializeDiscoSource(item)); + } + seeds = array; + continue; + } + if (property.NameEquals("names"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + names = array; + continue; + } + if (property.NameEquals("excludes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoSource.DeserializeDiscoSource(item)); + } + excludes = array; + continue; + } + if (property.NameEquals("latestRun"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestRun = DiscoRunResult.DeserializeDiscoRunResult(property.Value); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("templateId"u8)) + { + templateId = property.Value.GetString(); + continue; + } + } + return new DiscoGroup(id.Value, name, displayName.Value, description.Value, tier.Value, Optional.ToNullable(frequencyMilliseconds), Optional.ToList(seeds), Optional.ToList(names), Optional.ToList(excludes), latestRun.Value, Optional.ToNullable(createdDate), templateId.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DiscoGroup FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDiscoGroup(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.cs new file mode 100644 index 000000000000..8079c54302ee --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroup.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The DiscoGroup. + public partial class DiscoGroup + { + /// Initializes a new instance of DiscoGroup. + internal DiscoGroup() + { + Seeds = new ChangeTrackingList(); + Names = new ChangeTrackingList(); + Excludes = new ChangeTrackingList(); + } + + /// Initializes a new instance of DiscoGroup. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The description for a disco group. + /// The tier for the disco group which will affect the algorithm used for the disco runs in this group. + /// The frequency at which the disco group is supposed to be rerun in milliseconds. + /// The list of seeds used for the disco group runs. + /// The list of names used for the disco group runs. + /// The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + /// The latest run of this disco group with some limited information, null if the group has never been run. + /// The date for the disco group was created. + /// The unique identifier for the disco template used for the disco group creation. + internal DiscoGroup(string id, string name, string displayName, string description, string tier, long? frequencyMilliseconds, IReadOnlyList seeds, IReadOnlyList names, IReadOnlyList excludes, DiscoRunResult latestRun, DateTimeOffset? createdDate, string templateId) + { + Id = id; + Name = name; + DisplayName = displayName; + Description = description; + Tier = tier; + FrequencyMilliseconds = frequencyMilliseconds; + Seeds = seeds; + Names = names; + Excludes = excludes; + LatestRun = latestRun; + CreatedDate = createdDate; + TemplateId = templateId; + } + + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// The description for a disco group. + public string Description { get; } + /// The tier for the disco group which will affect the algorithm used for the disco runs in this group. + public string Tier { get; } + /// The frequency at which the disco group is supposed to be rerun in milliseconds. + public long? FrequencyMilliseconds { get; } + /// The list of seeds used for the disco group runs. + public IReadOnlyList Seeds { get; } + /// The list of names used for the disco group runs. + public IReadOnlyList Names { get; } + /// The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + public IReadOnlyList Excludes { get; } + /// The latest run of this disco group with some limited information, null if the group has never been run. + public DiscoRunResult LatestRun { get; } + /// The date for the disco group was created. + public DateTimeOffset? CreatedDate { get; } + /// The unique identifier for the disco template used for the disco group creation. + public string TemplateId { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.Serialization.cs new file mode 100644 index 000000000000..adbc7429c6b6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.Serialization.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DiscoGroupData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier); + } + if (Optional.IsDefined(FrequencyMilliseconds)) + { + writer.WritePropertyName("frequencyMilliseconds"u8); + writer.WriteNumberValue(FrequencyMilliseconds.Value); + } + if (Optional.IsCollectionDefined(Seeds)) + { + writer.WritePropertyName("seeds"u8); + writer.WriteStartArray(); + foreach (var item in Seeds) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Names)) + { + writer.WritePropertyName("names"u8); + writer.WriteStartArray(); + foreach (var item in Names) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Excludes)) + { + writer.WritePropertyName("excludes"u8); + writer.WriteStartArray(); + foreach (var item in Excludes) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TemplateId)) + { + writer.WritePropertyName("templateId"u8); + writer.WriteStringValue(TemplateId); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.cs new file mode 100644 index 000000000000..e7ac0578ca0c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoGroupData.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to create a discovery group. + public partial class DiscoGroupData + { + /// Initializes a new instance of DiscoGroupData. + public DiscoGroupData() + { + Seeds = new ChangeTrackingList(); + Names = new ChangeTrackingList(); + Excludes = new ChangeTrackingList(); + } + + /// Initializes a new instance of DiscoGroupData. + /// The name for a disco group. + /// The description for a disco group. + /// The tier for the disco group which will affect the algorithm used for the disco runs in this group. + /// The frequency at which the disco group is supposed to be rerun in milliseconds. + /// The list of seeds used for the disco group runs. + /// The list of names used for the disco group runs. + /// The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + /// The unique identifier for the disco template used for the disco group creation. + internal DiscoGroupData(string name, string description, string tier, long? frequencyMilliseconds, IList seeds, IList names, IList excludes, string templateId) + { + Name = name; + Description = description; + Tier = tier; + FrequencyMilliseconds = frequencyMilliseconds; + Seeds = seeds; + Names = names; + Excludes = excludes; + TemplateId = templateId; + } + + /// The name for a disco group. + public string Name { get; set; } + /// The description for a disco group. + public string Description { get; set; } + /// The tier for the disco group which will affect the algorithm used for the disco runs in this group. + public string Tier { get; set; } + /// The frequency at which the disco group is supposed to be rerun in milliseconds. + public long? FrequencyMilliseconds { get; set; } + /// The list of seeds used for the disco group runs. + public IList Seeds { get; } + /// The list of names used for the disco group runs. + public IList Names { get; } + /// The list of excludes used for the disco group runs, aka assets to exclude from the discovery algorithm. + public IList Excludes { get; } + /// The unique identifier for the disco template used for the disco group creation. + public string TemplateId { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.Serialization.cs new file mode 100644 index 000000000000..862764794d2a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.Serialization.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DiscoRunResult + { + internal static DiscoRunResult DeserializeDiscoRunResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional submittedDate = default; + Optional startedDate = default; + Optional completedDate = default; + Optional tier = default; + Optional state = default; + Optional totalAssetsFoundCount = default; + Optional> seeds = default; + Optional> excludes = default; + Optional> names = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("submittedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + submittedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("startedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("completedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("tier"u8)) + { + tier = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new DiscoRunState(property.Value.GetString()); + continue; + } + if (property.NameEquals("totalAssetsFoundCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalAssetsFoundCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("seeds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoSource.DeserializeDiscoSource(item)); + } + seeds = array; + continue; + } + if (property.NameEquals("excludes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoSource.DeserializeDiscoSource(item)); + } + excludes = array; + continue; + } + if (property.NameEquals("names"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + names = array; + continue; + } + } + return new DiscoRunResult(Optional.ToNullable(submittedDate), Optional.ToNullable(startedDate), Optional.ToNullable(completedDate), tier.Value, Optional.ToNullable(state), Optional.ToNullable(totalAssetsFoundCount), Optional.ToList(seeds), Optional.ToList(excludes), Optional.ToList(names)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DiscoRunResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDiscoRunResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.cs new file mode 100644 index 000000000000..cd155226aac3 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunResult.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The latest run of this disco group with some limited information, null if the group has never been run. + public partial class DiscoRunResult + { + /// Initializes a new instance of DiscoRunResult. + internal DiscoRunResult() + { + Seeds = new ChangeTrackingList(); + Excludes = new ChangeTrackingList(); + Names = new ChangeTrackingList(); + } + + /// Initializes a new instance of DiscoRunResult. + /// The date for when the disco run was created in the system. + /// The date for when the disco run was actually started by the system. + /// The date for when the disco run was completed by the system. + /// The tier which will affect the algorithm used for the disco run. + /// The State of the disco run. + /// The total count of assets that were found this disco run. + /// The list of seeds used for the disco run. + /// The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. + /// The list of names used for the disco run. + internal DiscoRunResult(DateTimeOffset? submittedDate, DateTimeOffset? startedDate, DateTimeOffset? completedDate, string tier, DiscoRunState? state, long? totalAssetsFoundCount, IReadOnlyList seeds, IReadOnlyList excludes, IReadOnlyList names) + { + SubmittedDate = submittedDate; + StartedDate = startedDate; + CompletedDate = completedDate; + Tier = tier; + State = state; + TotalAssetsFoundCount = totalAssetsFoundCount; + Seeds = seeds; + Excludes = excludes; + Names = names; + } + + /// The date for when the disco run was created in the system. + public DateTimeOffset? SubmittedDate { get; } + /// The date for when the disco run was actually started by the system. + public DateTimeOffset? StartedDate { get; } + /// The date for when the disco run was completed by the system. + public DateTimeOffset? CompletedDate { get; } + /// The tier which will affect the algorithm used for the disco run. + public string Tier { get; } + /// The State of the disco run. + public DiscoRunState? State { get; } + /// The total count of assets that were found this disco run. + public long? TotalAssetsFoundCount { get; } + /// The list of seeds used for the disco run. + public IReadOnlyList Seeds { get; } + /// The list of excludes used for the disco run, aka assets to exclude from the discovery algorithm. + public IReadOnlyList Excludes { get; } + /// The list of names used for the disco run. + public IReadOnlyList Names { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunState.cs new file mode 100644 index 000000000000..be67f9d46144 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoRunState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The State of the disco run. + public readonly partial struct DiscoRunState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiscoRunState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "pending"; + private const string RunningValue = "running"; + private const string CompletedValue = "completed"; + private const string FailedValue = "failed"; + + /// pending. + public static DiscoRunState Pending { get; } = new DiscoRunState(PendingValue); + /// running. + public static DiscoRunState Running { get; } = new DiscoRunState(RunningValue); + /// completed. + public static DiscoRunState Completed { get; } = new DiscoRunState(CompletedValue); + /// failed. + public static DiscoRunState Failed { get; } = new DiscoRunState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(DiscoRunState left, DiscoRunState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiscoRunState left, DiscoRunState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DiscoRunState(string value) => new DiscoRunState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiscoRunState other && Equals(other); + /// + public bool Equals(DiscoRunState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.Serialization.cs new file mode 100644 index 000000000000..0c9dea174473 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.Serialization.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DiscoSource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static DiscoSource DeserializeDiscoSource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + Optional name = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new DiscoSourceKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + } + return new DiscoSource(Optional.ToNullable(kind), name.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DiscoSource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDiscoSource(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.cs new file mode 100644 index 000000000000..3b1ee2d734db --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSource.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// Source entity used to drive discovery. + public partial class DiscoSource + { + /// Initializes a new instance of DiscoSource. + public DiscoSource() + { + } + + /// Initializes a new instance of DiscoSource. + /// The kind of disco source. + /// The name for the disco source. + internal DiscoSource(DiscoSourceKind? kind, string name) + { + Kind = kind; + Name = name; + } + + /// The kind of disco source. + public DiscoSourceKind? Kind { get; set; } + /// The name for the disco source. + public string Name { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSourceKind.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSourceKind.cs new file mode 100644 index 000000000000..3e389425920a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoSourceKind.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The kind of disco source. + public readonly partial struct DiscoSourceKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiscoSourceKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AsValue = "as"; + private const string AttributeValue = "attribute"; + private const string ContactValue = "contact"; + private const string DomainValue = "domain"; + private const string HostValue = "host"; + private const string IpBlockValue = "ipBlock"; + + /// as. + public static DiscoSourceKind As { get; } = new DiscoSourceKind(AsValue); + /// attribute. + public static DiscoSourceKind Attribute { get; } = new DiscoSourceKind(AttributeValue); + /// contact. + public static DiscoSourceKind Contact { get; } = new DiscoSourceKind(ContactValue); + /// domain. + public static DiscoSourceKind Domain { get; } = new DiscoSourceKind(DomainValue); + /// host. + public static DiscoSourceKind Host { get; } = new DiscoSourceKind(HostValue); + /// ipBlock. + public static DiscoSourceKind IpBlock { get; } = new DiscoSourceKind(IpBlockValue); + /// Determines if two values are the same. + public static bool operator ==(DiscoSourceKind left, DiscoSourceKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiscoSourceKind left, DiscoSourceKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DiscoSourceKind(string value) => new DiscoSourceKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiscoSourceKind other && Equals(other); + /// + public bool Equals(DiscoSourceKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.Serialization.cs new file mode 100644 index 000000000000..006dabc9c35e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DiscoTemplate + { + internal static DiscoTemplate DeserializeDiscoTemplate(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional name = default; + Optional displayName = default; + Optional industry = default; + Optional region = default; + Optional countryCode = default; + Optional stateCode = default; + Optional city = default; + Optional> seeds = default; + Optional> names = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("industry"u8)) + { + industry = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (property.NameEquals("countryCode"u8)) + { + countryCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("stateCode"u8)) + { + stateCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("seeds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiscoSource.DeserializeDiscoSource(item)); + } + seeds = array; + continue; + } + if (property.NameEquals("names"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + names = array; + continue; + } + } + return new DiscoTemplate(id, name.Value, displayName.Value, industry.Value, region.Value, countryCode.Value, stateCode.Value, city.Value, Optional.ToList(seeds), Optional.ToList(names)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DiscoTemplate FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDiscoTemplate(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.cs new file mode 100644 index 000000000000..5150fed5d15d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DiscoTemplate.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The items in the current page of results. + public partial class DiscoTemplate + { + /// Initializes a new instance of DiscoTemplate. + internal DiscoTemplate() + { + Seeds = new ChangeTrackingList(); + Names = new ChangeTrackingList(); + } + + /// Initializes a new instance of DiscoTemplate. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The name of the industry. + /// The name of the region. + /// The country code. + /// The state code. + /// The name of the city. + /// The list of disco template seeds. + /// The list of disco template names. + internal DiscoTemplate(string id, string name, string displayName, string industry, string region, string countryCode, string stateCode, string city, IReadOnlyList seeds, IReadOnlyList names) + { + Id = id; + Name = name; + DisplayName = displayName; + Industry = industry; + Region = region; + CountryCode = countryCode; + StateCode = stateCode; + City = city; + Seeds = seeds; + Names = names; + } + + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// The name of the industry. + public string Industry { get; } + /// The name of the region. + public string Region { get; } + /// The country code. + public string CountryCode { get; } + /// The state code. + public string StateCode { get; } + /// The name of the city. + public string City { get; } + /// The list of disco template seeds. + public IReadOnlyList Seeds { get; } + /// The list of disco template names. + public IReadOnlyList Names { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml new file mode 100644 index 000000000000..8d6cde2c1abc --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml @@ -0,0 +1,3203 @@ + + + + + +This sample shows how to call UpdateAssetsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +AssetUpdateData assetUpdateData = new AssetUpdateData(); +Response response = await client.UpdateAssetsAsync("", assetUpdateData); +]]> +This sample shows how to call UpdateAssetsAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +AssetUpdateData assetUpdateData = new AssetUpdateData +{ + State = AssetUpdateState.Candidate, + ExternalId = "", + Labels = + { + ["key"] = true + }, + Transfers = AssetUpdateTransfers.As, +}; +Response response = await client.UpdateAssetsAsync("", assetUpdateData); +]]> + + + +This sample shows how to call UpdateAssets. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +AssetUpdateData assetUpdateData = new AssetUpdateData(); +Response response = client.UpdateAssets("", assetUpdateData); +]]> +This sample shows how to call UpdateAssets with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +AssetUpdateData assetUpdateData = new AssetUpdateData +{ + State = AssetUpdateState.Candidate, + ExternalId = "", + Labels = + { + ["key"] = true + }, + Transfers = AssetUpdateTransfers.As, +}; +Response response = client.UpdateAssets("", assetUpdateData); +]]> + + + +This sample shows how to call UpdateAssetsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.UpdateAssetsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call UpdateAssetsAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + state = "candidate", + externalId = "", + labels = new + { + key = true, + }, + transfers = "as", +}); +Response response = await client.UpdateAssetsAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call UpdateAssets and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.UpdateAssets("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call UpdateAssets with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + state = "candidate", + externalId = "", + labels = new + { + key = true, + }, + transfers = "as", +}); +Response response = client.UpdateAssets("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetAssetResourceAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetAssetResourceAsync(""); +]]> +This sample shows how to call GetAssetResourceAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetAssetResourceAsync(""); +]]> + + + +This sample shows how to call GetAssetResource. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetAssetResource(""); +]]> +This sample shows how to call GetAssetResource with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetAssetResource(""); +]]> + + + +This sample shows how to call GetAssetResourceAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetAssetResourceAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetAssetResourceAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetAssetResourceAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("uuid").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("externalId").ToString()); +Console.WriteLine(result.GetProperty("labels")[0].ToString()); +Console.WriteLine(result.GetProperty("wildcard").ToString()); +Console.WriteLine(result.GetProperty("discoGroupName").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +]]> + + + +This sample shows how to call GetAssetResource and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetAssetResource("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetAssetResource with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetAssetResource("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("uuid").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("externalId").ToString()); +Console.WriteLine(result.GetProperty("labels")[0].ToString()); +Console.WriteLine(result.GetProperty("wildcard").ToString()); +Console.WriteLine(result.GetProperty("discoGroupName").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +]]> + + + +This sample shows how to call ValidateDataConnectionAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); +Response response = await client.ValidateDataConnectionAsync(dataConnectionData); +]]> +This sample shows how to call ValidateDataConnectionAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties +{ + ApiKey = "", + WorkspaceId = "", +}) +{ + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, +}; +Response response = await client.ValidateDataConnectionAsync(dataConnectionData); +]]> + + + +This sample shows how to call ValidateDataConnection. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); +Response response = client.ValidateDataConnection(dataConnectionData); +]]> +This sample shows how to call ValidateDataConnection with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties +{ + ApiKey = "", + WorkspaceId = "", +}) +{ + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, +}; +Response response = client.ValidateDataConnection(dataConnectionData); +]]> + + + +This sample shows how to call ValidateDataConnectionAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new object(), + kind = "logAnalytics", +}); +Response response = await client.ValidateDataConnectionAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ValidateDataConnectionAsync with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, +}); +Response response = await client.ValidateDataConnectionAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +]]> + + + +This sample shows how to call ValidateDataConnection and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new object(), + kind = "logAnalytics", +}); +Response response = client.ValidateDataConnection(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ValidateDataConnection with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, +}); +Response response = client.ValidateDataConnection(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +]]> + + + +This sample shows how to call GetDataConnectionAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDataConnectionAsync(""); +]]> +This sample shows how to call GetDataConnectionAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDataConnectionAsync(""); +]]> + + + +This sample shows how to call GetDataConnection. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDataConnection(""); +]]> +This sample shows how to call GetDataConnection with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDataConnection(""); +]]> + + + +This sample shows how to call GetDataConnectionAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDataConnectionAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDataConnectionAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDataConnectionAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("content").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("frequency").ToString()); +Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); +Console.WriteLine(result.GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +]]> + + + +This sample shows how to call GetDataConnection and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDataConnection("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDataConnection with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDataConnection("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("content").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("frequency").ToString()); +Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); +Console.WriteLine(result.GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceDataConnectionAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); +Response response = await client.CreateOrReplaceDataConnectionAsync("", dataConnectionData); +]]> +This sample shows how to call CreateOrReplaceDataConnectionAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties +{ + ApiKey = "", + WorkspaceId = "", +}) +{ + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, +}; +Response response = await client.CreateOrReplaceDataConnectionAsync("", dataConnectionData); +]]> + + + +This sample shows how to call CreateOrReplaceDataConnection. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); +Response response = client.CreateOrReplaceDataConnection("", dataConnectionData); +]]> +This sample shows how to call CreateOrReplaceDataConnection with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties +{ + ApiKey = "", + WorkspaceId = "", +}) +{ + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, +}; +Response response = client.CreateOrReplaceDataConnection("", dataConnectionData); +]]> + + + +This sample shows how to call CreateOrReplaceDataConnectionAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new object(), + kind = "logAnalytics", +}); +Response response = await client.CreateOrReplaceDataConnectionAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceDataConnectionAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, +}); +Response response = await client.CreateOrReplaceDataConnectionAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("content").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("frequency").ToString()); +Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); +Console.WriteLine(result.GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceDataConnection and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new object(), + kind = "logAnalytics", +}); +Response response = client.CreateOrReplaceDataConnection("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceDataConnection with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, +}); +Response response = client.CreateOrReplaceDataConnection("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("content").ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("frequency").ToString()); +Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); +Console.WriteLine(result.GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); +Console.WriteLine(result.GetProperty("active").ToString()); +Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +]]> + + + +This sample shows how to call DeleteDataConnectionAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.DeleteDataConnectionAsync(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteDataConnectionAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.DeleteDataConnectionAsync(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteDataConnection. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.DeleteDataConnection(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteDataConnection with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.DeleteDataConnection(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call ValidateDiscoGroupAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData(); +Response response = await client.ValidateDiscoGroupAsync(discoGroupData); +]]> +This sample shows how to call ValidateDiscoGroupAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData +{ + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource + { + Kind = DiscoSourceKind.As, + Name = "", + }}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", +}; +Response response = await client.ValidateDiscoGroupAsync(discoGroupData); +]]> + + + +This sample shows how to call ValidateDiscoGroup. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData(); +Response response = client.ValidateDiscoGroup(discoGroupData); +]]> +This sample shows how to call ValidateDiscoGroup with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData +{ + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource + { + Kind = DiscoSourceKind.As, + Name = "", + }}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", +}; +Response response = client.ValidateDiscoGroup(discoGroupData); +]]> + + + +This sample shows how to call ValidateDiscoGroupAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.ValidateDiscoGroupAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ValidateDiscoGroupAsync with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { + new + { + kind = "as", + name = "", + } + }, + names = new object[] + { + "" + }, + excludes = new object[] + { + null + }, + templateId = "", +}); +Response response = await client.ValidateDiscoGroupAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +]]> + + + +This sample shows how to call ValidateDiscoGroup and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.ValidateDiscoGroup(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call ValidateDiscoGroup with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { + new + { + kind = "as", + name = "", + } + }, + names = new object[] + { + "" + }, + excludes = new object[] + { + null + }, + templateId = "", +}); +Response response = client.ValidateDiscoGroup(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); +Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +]]> + + + +This sample shows how to call GetDiscoGroupAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoGroupAsync(""); +]]> +This sample shows how to call GetDiscoGroupAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoGroupAsync(""); +]]> + + + +This sample shows how to call GetDiscoGroup. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoGroup(""); +]]> +This sample shows how to call GetDiscoGroup with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoGroup(""); +]]> + + + +This sample shows how to call GetDiscoGroupAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoGroupAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDiscoGroupAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoGroupAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("templateId").ToString()); +]]> + + + +This sample shows how to call GetDiscoGroup and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoGroup("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDiscoGroup with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoGroup("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("templateId").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceDiscoGroupAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData(); +Response response = await client.CreateOrReplaceDiscoGroupAsync("", discoGroupData); +]]> +This sample shows how to call CreateOrReplaceDiscoGroupAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData +{ + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource + { + Kind = DiscoSourceKind.As, + Name = "", + }}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", +}; +Response response = await client.CreateOrReplaceDiscoGroupAsync("", discoGroupData); +]]> + + + +This sample shows how to call CreateOrReplaceDiscoGroup. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData(); +Response response = client.CreateOrReplaceDiscoGroup("", discoGroupData); +]]> +This sample shows how to call CreateOrReplaceDiscoGroup with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +DiscoGroupData discoGroupData = new DiscoGroupData +{ + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource + { + Kind = DiscoSourceKind.As, + Name = "", + }}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", +}; +Response response = client.CreateOrReplaceDiscoGroup("", discoGroupData); +]]> + + + +This sample shows how to call CreateOrReplaceDiscoGroupAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.CreateOrReplaceDiscoGroupAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceDiscoGroupAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { + new + { + kind = "as", + name = "", + } + }, + names = new object[] + { + "" + }, + excludes = new object[] + { + null + }, + templateId = "", +}); +Response response = await client.CreateOrReplaceDiscoGroupAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("templateId").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceDiscoGroup and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.CreateOrReplaceDiscoGroup("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceDiscoGroup with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { + new + { + kind = "as", + name = "", + } + }, + names = new object[] + { + "" + }, + excludes = new object[] + { + null + }, + templateId = "", +}); +Response response = client.CreateOrReplaceDiscoGroup("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); +Console.WriteLine(result.GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("templateId").ToString()); +]]> + + + +This sample shows how to call RunDiscoGroupAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.RunDiscoGroupAsync(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call RunDiscoGroupAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.RunDiscoGroupAsync(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call RunDiscoGroup. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.RunDiscoGroup(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call RunDiscoGroup with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.RunDiscoGroup(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetDiscoTemplateAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoTemplateAsync(""); +]]> +This sample shows how to call GetDiscoTemplateAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoTemplateAsync(""); +]]> + + + +This sample shows how to call GetDiscoTemplate. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoTemplate(""); +]]> +This sample shows how to call GetDiscoTemplate with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoTemplate(""); +]]> + + + +This sample shows how to call GetDiscoTemplateAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoTemplateAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetDiscoTemplateAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetDiscoTemplateAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("industry").ToString()); +Console.WriteLine(result.GetProperty("region").ToString()); +Console.WriteLine(result.GetProperty("countryCode").ToString()); +Console.WriteLine(result.GetProperty("stateCode").ToString()); +Console.WriteLine(result.GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +]]> + + + +This sample shows how to call GetDiscoTemplate and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoTemplate("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetDiscoTemplate with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetDiscoTemplate("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("industry").ToString()); +Console.WriteLine(result.GetProperty("region").ToString()); +Console.WriteLine(result.GetProperty("countryCode").ToString()); +Console.WriteLine(result.GetProperty("stateCode").ToString()); +Console.WriteLine(result.GetProperty("city").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("names")[0].ToString()); +]]> + + + +This sample shows how to call GetBillableAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetBillableAsync(); +]]> +This sample shows how to call GetBillableAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetBillableAsync(); +]]> + + + +This sample shows how to call GetBillable. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetBillable(); +]]> +This sample shows how to call GetBillable with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetBillable(); +]]> + + + +This sample shows how to call GetBillableAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetBillableAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetBillableAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetBillableAsync(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("date").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("total").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("count").ToString()); +]]> + + + +This sample shows how to call GetBillable and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetBillable(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetBillable with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetBillable(null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("date").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("total").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("count").ToString()); +]]> + + + +This sample shows how to call GetSnapshotAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest(); +Response response = await client.GetSnapshotAsync(reportAssetSnapshotRequest); +]]> +This sample shows how to call GetSnapshotAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest +{ + Metric = "", + LabelName = "", + Size = 1234, + Page = 1234, +}; +Response response = await client.GetSnapshotAsync(reportAssetSnapshotRequest); +]]> + + + +This sample shows how to call GetSnapshot. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest(); +Response response = client.GetSnapshot(reportAssetSnapshotRequest); +]]> +This sample shows how to call GetSnapshot with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest +{ + Metric = "", + LabelName = "", + Size = 1234, + Page = 1234, +}; +Response response = client.GetSnapshot(reportAssetSnapshotRequest); +]]> + + + +This sample shows how to call GetSnapshotAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.GetSnapshotAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetSnapshotAsync with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "", + labelName = "", + size = 1234, + page = 1234, +}); +Response response = await client.GetSnapshotAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("metric").ToString()); +Console.WriteLine(result.GetProperty("labelName").ToString()); +Console.WriteLine(result.GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("totalElements").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("mark").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("nextLink").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("uuid").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("externalId").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("labels")[0].ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("wildcard").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("discoGroupName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("reason").ToString()); +]]> + + + +This sample shows how to call GetSnapshot and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.GetSnapshot(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetSnapshot with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + metric = "", + labelName = "", + size = 1234, + page = 1234, +}); +Response response = client.GetSnapshot(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("metric").ToString()); +Console.WriteLine(result.GetProperty("labelName").ToString()); +Console.WriteLine(result.GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("totalElements").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("mark").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("nextLink").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("uuid").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("createdDate").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("updatedDate").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("externalId").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("labels")[0].ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("wildcard").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("discoGroupName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("kind").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("reason").ToString()); +]]> + + + +This sample shows how to call GetSummaryAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest(); +Response response = await client.GetSummaryAsync(reportAssetSummaryRequest); +]]> +This sample shows how to call GetSummaryAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest +{ + MetricCategories = { "" }, + Metrics = { "" }, + Filters = { "" }, + GroupBy = "", + SegmentBy = "", + LabelName = "", +}; +Response response = await client.GetSummaryAsync(reportAssetSummaryRequest); +]]> + + + +This sample shows how to call GetSummary. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest(); +Response response = client.GetSummary(reportAssetSummaryRequest); +]]> +This sample shows how to call GetSummary with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest +{ + MetricCategories = { "" }, + Metrics = { "" }, + Filters = { "" }, + GroupBy = "", + SegmentBy = "", + LabelName = "", +}; +Response response = client.GetSummary(reportAssetSummaryRequest); +]]> + + + +This sample shows how to call GetSummaryAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.GetSummaryAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetSummaryAsync with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + metricCategories = new object[] + { + "" + }, + metrics = new object[] + { + "" + }, + filters = new object[] + { + "" + }, + groupBy = "", + segmentBy = "", + labelName = "", +}); +Response response = await client.GetSummaryAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metricCategory").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metric").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("labelName").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("count").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("link").ToString()); +]]> + + + +This sample shows how to call GetSummary and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.GetSummary(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetSummary with all request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + metricCategories = new object[] + { + "" + }, + metrics = new object[] + { + "" + }, + filters = new object[] + { + "" + }, + groupBy = "", + segmentBy = "", + labelName = "", +}); +Response response = client.GetSummary(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("updatedAt").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metricCategory").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metric").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("labelName").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("count").ToString()); +Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("link").ToString()); +]]> + + + +This sample shows how to call GetSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetSavedFilterAsync(""); +]]> +This sample shows how to call GetSavedFilterAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetSavedFilterAsync(""); +]]> + + + +This sample shows how to call GetSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetSavedFilter(""); +]]> +This sample shows how to call GetSavedFilter with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetSavedFilter(""); +]]> + + + +This sample shows how to call GetSavedFilterAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetSavedFilterAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetSavedFilterAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetSavedFilterAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +]]> + + + +This sample shows how to call GetSavedFilter and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetSavedFilter("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetSavedFilter with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetSavedFilter("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +SavedFilterData savedFilterData = new SavedFilterData("", ""); +Response response = await client.CreateOrReplaceSavedFilterAsync("", savedFilterData); +]]> +This sample shows how to call CreateOrReplaceSavedFilterAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +SavedFilterData savedFilterData = new SavedFilterData("", ""); +Response response = await client.CreateOrReplaceSavedFilterAsync("", savedFilterData); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +SavedFilterData savedFilterData = new SavedFilterData("", ""); +Response response = client.CreateOrReplaceSavedFilter("", savedFilterData); +]]> +This sample shows how to call CreateOrReplaceSavedFilter with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +SavedFilterData savedFilterData = new SavedFilterData("", ""); +Response response = client.CreateOrReplaceSavedFilter("", savedFilterData); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilterAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "", + description = "", +}); +Response response = await client.CreateOrReplaceSavedFilterAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceSavedFilterAsync with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "", + description = "", +}); +Response response = await client.CreateOrReplaceSavedFilterAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +]]> + + + +This sample shows how to call CreateOrReplaceSavedFilter and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "", + description = "", +}); +Response response = client.CreateOrReplaceSavedFilter("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call CreateOrReplaceSavedFilter with all parameters and request content and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +using RequestContent content = RequestContent.Create(new +{ + filter = "", + description = "", +}); +Response response = client.CreateOrReplaceSavedFilter("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("filter").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +]]> + + + +This sample shows how to call DeleteSavedFilterAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.DeleteSavedFilterAsync(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteSavedFilterAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.DeleteSavedFilterAsync(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteSavedFilter. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.DeleteSavedFilter(""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteSavedFilter with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.DeleteSavedFilter(""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call GetTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetTaskAsync(""); +]]> +This sample shows how to call GetTaskAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetTaskAsync(""); +]]> + + + +This sample shows how to call GetTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetTask(""); +]]> +This sample shows how to call GetTask with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetTask(""); +]]> + + + +This sample shows how to call GetTaskAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetTaskAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetTaskAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.GetTaskAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetTask and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetTask("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call GetTask with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.GetTask("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CancelTaskAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.CancelTaskAsync(""); +]]> +This sample shows how to call CancelTaskAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.CancelTaskAsync(""); +]]> + + + +This sample shows how to call CancelTask. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.CancelTask(""); +]]> +This sample shows how to call CancelTask with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.CancelTask(""); +]]> + + + +This sample shows how to call CancelTaskAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.CancelTaskAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call CancelTaskAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = await client.CancelTaskAsync("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CancelTask and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.CancelTask("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +]]> +This sample shows how to call CancelTask with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +Response response = client.CancelTask("", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("startedAt").ToString()); +Console.WriteLine(result.GetProperty("completedAt").ToString()); +Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); +Console.WriteLine(result.GetProperty("state").ToString()); +Console.WriteLine(result.GetProperty("phase").ToString()); +Console.WriteLine(result.GetProperty("reason").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetAssetResourcesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (AssetResource item in client.GetAssetResourcesAsync()) +{ +} +]]> +This sample shows how to call GetAssetResourcesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (AssetResource item in client.GetAssetResourcesAsync(filter: "", orderby: "", skip: 1234, maxpagesize: 1234, mark: "")) +{ +} +]]> + + + +This sample shows how to call GetAssetResources. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (AssetResource item in client.GetAssetResources()) +{ +} +]]> +This sample shows how to call GetAssetResources with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (AssetResource item in client.GetAssetResources(filter: "", orderby: "", skip: 1234, maxpagesize: 1234, mark: "")) +{ +} +]]> + + + +This sample shows how to call GetAssetResourcesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetAssetResourcesAsync(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetAssetResourcesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetAssetResourcesAsync("", "", 1234, 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); +} +]]> + + + +This sample shows how to call GetAssetResources and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetAssetResources(null, null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetAssetResources with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetAssetResources("", "", 1234, 1234, "", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); +} +]]> + + + +This sample shows how to call GetDataConnectionsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DataConnection item in client.GetDataConnectionsAsync()) +{ +} +]]> +This sample shows how to call GetDataConnectionsAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DataConnection item in client.GetDataConnectionsAsync(skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDataConnections. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DataConnection item in client.GetDataConnections()) +{ +} +]]> +This sample shows how to call GetDataConnections with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DataConnection item in client.GetDataConnections(skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDataConnectionsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDataConnectionsAsync(null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDataConnectionsAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDataConnectionsAsync(1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +} +]]> + + + +This sample shows how to call GetDataConnections and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDataConnections(null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDataConnections with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDataConnections(1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); +} +]]> + + + +This sample shows how to call GetDiscoGroupsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoGroup item in client.GetDiscoGroupsAsync()) +{ +} +]]> +This sample shows how to call GetDiscoGroupsAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoGroup item in client.GetDiscoGroupsAsync(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDiscoGroups. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoGroup item in client.GetDiscoGroups()) +{ +} +]]> +This sample shows how to call GetDiscoGroups with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoGroup item in client.GetDiscoGroups(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDiscoGroupsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDiscoGroupsAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDiscoGroupsAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDiscoGroupsAsync("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); +} +]]> + + + +This sample shows how to call GetDiscoGroups and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDiscoGroups(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDiscoGroups with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDiscoGroups("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); +} +]]> + + + +This sample shows how to call GetRunsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoRunResult item in client.GetRunsAsync("")) +{ +} +]]> +This sample shows how to call GetRunsAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoRunResult item in client.GetRunsAsync("", filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetRuns. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoRunResult item in client.GetRuns("")) +{ +} +]]> +This sample shows how to call GetRuns with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoRunResult item in client.GetRuns("", filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetRunsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetRunsAsync("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); +} +]]> +This sample shows how to call GetRunsAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetRunsAsync("", "", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); +} +]]> + + + +This sample shows how to call GetRuns and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetRuns("", null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); +} +]]> +This sample shows how to call GetRuns with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetRuns("", "", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); +} +]]> + + + +This sample shows how to call GetDiscoTemplatesAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoTemplate item in client.GetDiscoTemplatesAsync()) +{ +} +]]> +This sample shows how to call GetDiscoTemplatesAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (DiscoTemplate item in client.GetDiscoTemplatesAsync(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDiscoTemplates. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoTemplate item in client.GetDiscoTemplates()) +{ +} +]]> +This sample shows how to call GetDiscoTemplates with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (DiscoTemplate item in client.GetDiscoTemplates(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDiscoTemplatesAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDiscoTemplatesAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetDiscoTemplatesAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetDiscoTemplatesAsync("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); +} +]]> + + + +This sample shows how to call GetDiscoTemplates and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDiscoTemplates(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetDiscoTemplates with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetDiscoTemplates("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); +} +]]> + + + +This sample shows how to call GetSavedFiltersAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (SavedFilter item in client.GetSavedFiltersAsync()) +{ +} +]]> +This sample shows how to call GetSavedFiltersAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (SavedFilter item in client.GetSavedFiltersAsync(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSavedFilters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (SavedFilter item in client.GetSavedFilters()) +{ +} +]]> +This sample shows how to call GetSavedFilters with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (SavedFilter item in client.GetSavedFilters(filter: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetSavedFiltersAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetSavedFiltersAsync(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetSavedFiltersAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetSavedFiltersAsync("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); +} +]]> + + + +This sample shows how to call GetSavedFilters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetSavedFilters(null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetSavedFilters with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetSavedFilters("", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); +} +]]> + + + +This sample shows how to call GetTasksAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (Task item in client.GetTasksAsync()) +{ +} +]]> +This sample shows how to call GetTasksAsync with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (Task item in client.GetTasksAsync(filter: "", orderby: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTasks. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (Task item in client.GetTasks()) +{ +} +]]> +This sample shows how to call GetTasks with all parameters. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (Task item in client.GetTasks(filter: "", orderby: "", skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetTasksAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetTasksAsync(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetTasksAsync with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +await foreach (BinaryData item in client.GetTasksAsync("", "", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetTasks and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetTasks(null, null, null, null, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); +} +]]> +This sample shows how to call GetTasks with all parameters and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +EasmClient client = new EasmClient(endpoint, "", "", "", credential); + +foreach (BinaryData item in client.GetTasks("", "", 1234, 1234, null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.Serialization.cs new file mode 100644 index 000000000000..f4cd52939216 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.Serialization.cs @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DomainAsset + { + internal static DomainAsset DeserializeDomainAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional domain = default; + Optional whoisId = default; + Optional> registrarIanaIds = default; + Optional> registrantContacts = default; + Optional> registrantOrgs = default; + Optional> adminContacts = default; + Optional> technicalContacts = default; + Optional> alexaInfos = default; + Optional> nameServers = default; + Optional> mailServers = default; + Optional> whoisServers = default; + Optional> domainStatuses = default; + Optional> registrarCreatedAt = default; + Optional> registrarUpdatedAt = default; + Optional> registrarExpiresAt = default; + Optional> soaRecords = default; + Optional detailedFromWhoisAt = default; + Optional> registrarNames = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> parkedDomain = default; + Optional> registrantNames = default; + Optional> adminNames = default; + Optional> technicalNames = default; + Optional> adminOrgs = default; + Optional> technicalOrgs = default; + Optional> registrantPhones = default; + Optional> adminPhones = default; + Optional> technicalPhones = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("whoisId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + whoisId = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("registrarIanaIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedInteger.DeserializeObservedInteger(item)); + } + registrarIanaIds = array; + continue; + } + if (property.NameEquals("registrantContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantContacts = array; + continue; + } + if (property.NameEquals("registrantOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantOrgs = array; + continue; + } + if (property.NameEquals("adminContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminContacts = array; + continue; + } + if (property.NameEquals("technicalContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalContacts = array; + continue; + } + if (property.NameEquals("alexaInfos"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AlexaInfo.DeserializeAlexaInfo(item)); + } + alexaInfos = array; + continue; + } + if (property.NameEquals("nameServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + nameServers = array; + continue; + } + if (property.NameEquals("mailServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + mailServers = array; + continue; + } + if (property.NameEquals("whoisServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + whoisServers = array; + continue; + } + if (property.NameEquals("domainStatuses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + domainStatuses = array; + continue; + } + if (property.NameEquals("registrarCreatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarCreatedAt = array; + continue; + } + if (property.NameEquals("registrarUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarUpdatedAt = array; + continue; + } + if (property.NameEquals("registrarExpiresAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarExpiresAt = array; + continue; + } + if (property.NameEquals("soaRecords"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SoaRecord.DeserializeSoaRecord(item)); + } + soaRecords = array; + continue; + } + if (property.NameEquals("detailedFromWhoisAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detailedFromWhoisAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("registrarNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrarNames = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("parkedDomain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + parkedDomain = array; + continue; + } + if (property.NameEquals("registrantNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantNames = array; + continue; + } + if (property.NameEquals("adminNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminNames = array; + continue; + } + if (property.NameEquals("technicalNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalNames = array; + continue; + } + if (property.NameEquals("adminOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminOrgs = array; + continue; + } + if (property.NameEquals("technicalOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalOrgs = array; + continue; + } + if (property.NameEquals("registrantPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantPhones = array; + continue; + } + if (property.NameEquals("adminPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminPhones = array; + continue; + } + if (property.NameEquals("technicalPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalPhones = array; + continue; + } + } + return new DomainAsset(domain.Value, Optional.ToNullable(whoisId), Optional.ToList(registrarIanaIds), Optional.ToList(registrantContacts), Optional.ToList(registrantOrgs), Optional.ToList(adminContacts), Optional.ToList(technicalContacts), Optional.ToList(alexaInfos), Optional.ToList(nameServers), Optional.ToList(mailServers), Optional.ToList(whoisServers), Optional.ToList(domainStatuses), Optional.ToList(registrarCreatedAt), Optional.ToList(registrarUpdatedAt), Optional.ToList(registrarExpiresAt), Optional.ToList(soaRecords), Optional.ToNullable(detailedFromWhoisAt), Optional.ToList(registrarNames), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(parkedDomain), Optional.ToList(registrantNames), Optional.ToList(adminNames), Optional.ToList(technicalNames), Optional.ToList(adminOrgs), Optional.ToList(technicalOrgs), Optional.ToList(registrantPhones), Optional.ToList(adminPhones), Optional.ToList(technicalPhones)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DomainAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDomainAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.cs new file mode 100644 index 000000000000..bacb0f5152d6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAsset.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The DomainAsset. + public partial class DomainAsset : InventoryAsset + { + /// Initializes a new instance of DomainAsset. + internal DomainAsset() + { + RegistrarIanaIds = new ChangeTrackingList(); + RegistrantContacts = new ChangeTrackingList(); + RegistrantOrgs = new ChangeTrackingList(); + AdminContacts = new ChangeTrackingList(); + TechnicalContacts = new ChangeTrackingList(); + AlexaInfos = new ChangeTrackingList(); + NameServers = new ChangeTrackingList(); + MailServers = new ChangeTrackingList(); + WhoisServers = new ChangeTrackingList(); + DomainStatuses = new ChangeTrackingList(); + RegistrarCreatedAt = new ChangeTrackingList(); + RegistrarUpdatedAt = new ChangeTrackingList(); + RegistrarExpiresAt = new ChangeTrackingList(); + SoaRecords = new ChangeTrackingList(); + RegistrarNames = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + ParkedDomain = new ChangeTrackingList(); + RegistrantNames = new ChangeTrackingList(); + AdminNames = new ChangeTrackingList(); + TechnicalNames = new ChangeTrackingList(); + AdminOrgs = new ChangeTrackingList(); + TechnicalOrgs = new ChangeTrackingList(); + RegistrantPhones = new ChangeTrackingList(); + AdminPhones = new ChangeTrackingList(); + TechnicalPhones = new ChangeTrackingList(); + } + + /// Initializes a new instance of DomainAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal DomainAsset(string domain, long? whoisId, IReadOnlyList registrarIanaIds, IReadOnlyList registrantContacts, IReadOnlyList registrantOrgs, IReadOnlyList adminContacts, IReadOnlyList technicalContacts, IReadOnlyList alexaInfos, IReadOnlyList nameServers, IReadOnlyList mailServers, IReadOnlyList whoisServers, IReadOnlyList domainStatuses, IReadOnlyList registrarCreatedAt, IReadOnlyList registrarUpdatedAt, IReadOnlyList registrarExpiresAt, IReadOnlyList soaRecords, DateTimeOffset? detailedFromWhoisAt, IReadOnlyList registrarNames, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList parkedDomain, IReadOnlyList registrantNames, IReadOnlyList adminNames, IReadOnlyList technicalNames, IReadOnlyList adminOrgs, IReadOnlyList technicalOrgs, IReadOnlyList registrantPhones, IReadOnlyList adminPhones, IReadOnlyList technicalPhones) + { + Domain = domain; + WhoisId = whoisId; + RegistrarIanaIds = registrarIanaIds; + RegistrantContacts = registrantContacts; + RegistrantOrgs = registrantOrgs; + AdminContacts = adminContacts; + TechnicalContacts = technicalContacts; + AlexaInfos = alexaInfos; + NameServers = nameServers; + MailServers = mailServers; + WhoisServers = whoisServers; + DomainStatuses = domainStatuses; + RegistrarCreatedAt = registrarCreatedAt; + RegistrarUpdatedAt = registrarUpdatedAt; + RegistrarExpiresAt = registrarExpiresAt; + SoaRecords = soaRecords; + DetailedFromWhoisAt = detailedFromWhoisAt; + RegistrarNames = registrarNames; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + ParkedDomain = parkedDomain; + RegistrantNames = registrantNames; + AdminNames = adminNames; + TechnicalNames = technicalNames; + AdminOrgs = adminOrgs; + TechnicalOrgs = technicalOrgs; + RegistrantPhones = registrantPhones; + AdminPhones = adminPhones; + TechnicalPhones = technicalPhones; + } + + /// Gets the domain. + public string Domain { get; } + /// Gets the whois id. + public long? WhoisId { get; } + /// Gets the registrar iana ids. + public IReadOnlyList RegistrarIanaIds { get; } + /// Gets the registrant contacts. + public IReadOnlyList RegistrantContacts { get; } + /// Gets the registrant orgs. + public IReadOnlyList RegistrantOrgs { get; } + /// Gets the admin contacts. + public IReadOnlyList AdminContacts { get; } + /// Gets the technical contacts. + public IReadOnlyList TechnicalContacts { get; } + /// Gets the alexa infos. + public IReadOnlyList AlexaInfos { get; } + /// Gets the name servers. + public IReadOnlyList NameServers { get; } + /// Gets the mail servers. + public IReadOnlyList MailServers { get; } + /// Gets the whois servers. + public IReadOnlyList WhoisServers { get; } + /// Gets the domain statuses. + public IReadOnlyList DomainStatuses { get; } + /// Gets the registrar created at. + public IReadOnlyList RegistrarCreatedAt { get; } + /// Gets the registrar updated at. + public IReadOnlyList RegistrarUpdatedAt { get; } + /// Gets the registrar expires at. + public IReadOnlyList RegistrarExpiresAt { get; } + /// Gets the soa records. + public IReadOnlyList SoaRecords { get; } + /// Gets the detailed from whois at. + public DateTimeOffset? DetailedFromWhoisAt { get; } + /// Gets the registrar names. + public IReadOnlyList RegistrarNames { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the parked domain. + public IReadOnlyList ParkedDomain { get; } + /// Gets the registrant names. + public IReadOnlyList RegistrantNames { get; } + /// Gets the admin names. + public IReadOnlyList AdminNames { get; } + /// Gets the technical names. + public IReadOnlyList TechnicalNames { get; } + /// Gets the admin orgs. + public IReadOnlyList AdminOrgs { get; } + /// Gets the technical orgs. + public IReadOnlyList TechnicalOrgs { get; } + /// Gets the registrant phones. + public IReadOnlyList RegistrantPhones { get; } + /// Gets the admin phones. + public IReadOnlyList AdminPhones { get; } + /// Gets the technical phones. + public IReadOnlyList TechnicalPhones { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.Serialization.cs new file mode 100644 index 000000000000..8fef152eed78 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class DomainAssetResource + { + internal static DomainAssetResource DeserializeDomainAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DomainAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = DomainAsset.DeserializeDomainAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new DomainAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new DomainAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDomainAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.cs new file mode 100644 index 000000000000..0388f75cb401 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/DomainAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The DomainAssetResource. + public partial class DomainAssetResource : AssetResource + { + /// Initializes a new instance of DomainAssetResource. + /// asset. + /// is null. + internal DomainAssetResource(DomainAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "domain"; + Asset = asset; + } + + /// Initializes a new instance of DomainAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal DomainAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, DomainAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public DomainAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs new file mode 100644 index 000000000000..2e582a0080ca --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClient.cs @@ -0,0 +1,3491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Analytics.Defender.Easm +{ + // Data plane generated client. + /// Provides access to inventory assets. + public partial class EasmClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://easm.defender.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _workspaceName; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of EasmClient for mocking. + protected EasmClient() + { + } + + /// Initializes a new instance of EasmClient. + /// The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + /// The ID of the target subscription. + /// The name of the Resource Group. + /// The name of the Workspace. + /// A credential used to authenticate to an Azure Service. + /// , , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public EasmClient(Uri endpoint, string subscriptionId, string resourceGroupName, string workspaceName, TokenCredential credential) : this(endpoint, subscriptionId, resourceGroupName, workspaceName, credential, new EasmClientOptions()) + { + } + + /// Initializes a new instance of EasmClient. + /// The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com. + /// The ID of the target subscription. + /// The name of the Resource Group. + /// The name of the Workspace. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// , , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public EasmClient(Uri endpoint, string subscriptionId, string resourceGroupName, string workspaceName, TokenCredential credential, EasmClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new EasmClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _workspaceName = workspaceName; + _apiVersion = options.Version; + } + + /// Update labels on assets matching the provided filter. + /// An expression on the resource type that selects the resources to be returned. + /// A request body used to update an asset. + /// The cancellation token to use. + /// or is null. + /// + public virtual async Task> UpdateAssetsAsync(string filter, AssetUpdateData assetUpdateData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(filter, nameof(filter)); + Argument.AssertNotNull(assetUpdateData, nameof(assetUpdateData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = assetUpdateData.ToRequestContent(); + Response response = await UpdateAssetsAsync(filter, content, context).ConfigureAwait(false); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// Update labels on assets matching the provided filter. + /// An expression on the resource type that selects the resources to be returned. + /// A request body used to update an asset. + /// The cancellation token to use. + /// or is null. + /// + public virtual Response UpdateAssets(string filter, AssetUpdateData assetUpdateData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(filter, nameof(filter)); + Argument.AssertNotNull(assetUpdateData, nameof(assetUpdateData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = assetUpdateData.ToRequestContent(); + Response response = UpdateAssets(filter, content, context); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// + /// [Protocol Method] Update labels on assets matching the provided filter. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// An expression on the resource type that selects the resources to be returned. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateAssetsAsync(string filter, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(filter, nameof(filter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.UpdateAssets"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateAssetsRequest(filter, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Update labels on assets matching the provided filter. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// An expression on the resource type that selects the resources to be returned. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response UpdateAssets(string filter, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(filter, nameof(filter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.UpdateAssets"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateAssetsRequest(filter, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve an asset by assetId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetAssetResourceAsync(string assetId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetAssetResourceAsync(assetId, context).ConfigureAwait(false); + return Response.FromValue(AssetResource.FromResponse(response), response); + } + + /// Retrieve an asset by assetId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetAssetResource(string assetId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetAssetResource(assetId, context); + return Response.FromValue(AssetResource.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve an asset by assetId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetAssetResourceAsync(string assetId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssetResourceRequest(assetId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve an asset by assetId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetAssetResource(string assetId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(assetId, nameof(assetId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetAssetResource"); + scope.Start(); + try + { + using HttpMessage message = CreateGetAssetResourceRequest(assetId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Validate a data connection with a given dataConnectionName. + /// The DataConnectionData to use. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ValidateDataConnectionAsync(DataConnectionData dataConnectionData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataConnectionData, nameof(dataConnectionData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = dataConnectionData.ToRequestContent(); + Response response = await ValidateDataConnectionAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// Validate a data connection with a given dataConnectionName. + /// The DataConnectionData to use. + /// The cancellation token to use. + /// is null. + /// + public virtual Response ValidateDataConnection(DataConnectionData dataConnectionData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataConnectionData, nameof(dataConnectionData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = dataConnectionData.ToRequestContent(); + Response response = ValidateDataConnection(content, context); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ValidateDataConnectionAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Validate a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ValidateDataConnection(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDataConnectionRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDataConnectionAsync(string dataConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDataConnectionAsync(dataConnectionName, context).ConfigureAwait(false); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// Retrieve a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDataConnection(string dataConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDataConnection(dataConnectionName, context); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDataConnectionAsync(string dataConnectionName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDataConnection(string dataConnectionName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDataConnectionRequest(dataConnectionName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or replace a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The DataConnectionData to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceDataConnectionAsync(string dataConnectionName, DataConnectionData dataConnectionData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(dataConnectionData, nameof(dataConnectionData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = dataConnectionData.ToRequestContent(); + Response response = await CreateOrReplaceDataConnectionAsync(dataConnectionName, content, context).ConfigureAwait(false); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// Create or replace a data connection with a given dataConnectionName. + /// The caller provided unique name for the resource. + /// The DataConnectionData to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, DataConnectionData dataConnectionData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(dataConnectionData, nameof(dataConnectionData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = dataConnectionData.ToRequestContent(); + Response response = CreateOrReplaceDataConnection(dataConnectionName, content, context); + return Response.FromValue(DataConnection.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceDataConnectionAsync(string dataConnectionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or replace a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceDataConnection(string dataConnectionName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDataConnectionRequest(dataConnectionName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteDataConnectionAsync(string dataConnectionName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a data connection with a given dataConnectionName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteDataConnection(string dataConnectionName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(dataConnectionName, nameof(dataConnectionName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteDataConnection"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteDataConnectionRequest(dataConnectionName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Validate a discovery group with a given groupName. + /// A request body used to create a discovery group. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> ValidateDiscoGroupAsync(DiscoGroupData discoGroupData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(discoGroupData, nameof(discoGroupData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = discoGroupData.ToRequestContent(); + Response response = await ValidateDiscoGroupAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// Validate a discovery group with a given groupName. + /// A request body used to create a discovery group. + /// The cancellation token to use. + /// is null. + /// + public virtual Response ValidateDiscoGroup(DiscoGroupData discoGroupData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(discoGroupData, nameof(discoGroupData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = discoGroupData.ToRequestContent(); + Response response = ValidateDiscoGroup(content, context); + return Response.FromValue(ValidateResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Validate a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ValidateDiscoGroupAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDiscoGroupRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Validate a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ValidateDiscoGroup(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.ValidateDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateValidateDiscoGroupRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDiscoGroupAsync(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDiscoGroupAsync(groupName, context).ConfigureAwait(false); + return Response.FromValue(DiscoGroup.FromResponse(response), response); + } + + /// Retrieve a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDiscoGroup(string groupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDiscoGroup(groupName, context); + return Response.FromValue(DiscoGroup.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDiscoGroupAsync(string groupName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoGroupRequest(groupName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDiscoGroup(string groupName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoGroupRequest(groupName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// A request body used to create a discovery group. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceDiscoGroupAsync(string groupName, DiscoGroupData discoGroupData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(discoGroupData, nameof(discoGroupData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = discoGroupData.ToRequestContent(); + Response response = await CreateOrReplaceDiscoGroupAsync(groupName, content, context).ConfigureAwait(false); + return Response.FromValue(DiscoGroup.FromResponse(response), response); + } + + /// Create a discovery group with a given groupName. + /// The caller provided unique name for the resource. + /// A request body used to create a discovery group. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceDiscoGroup(string groupName, DiscoGroupData discoGroupData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(discoGroupData, nameof(discoGroupData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = discoGroupData.ToRequestContent(); + Response response = CreateOrReplaceDiscoGroup(groupName, content, context); + return Response.FromValue(DiscoGroup.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceDiscoGroupAsync(string groupName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDiscoGroupRequest(groupName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceDiscoGroup(string groupName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceDiscoGroupRequest(groupName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Run a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task RunDiscoGroupAsync(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateRunDiscoGroupRequest(groupName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Run a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response RunDiscoGroup(string groupName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.RunDiscoGroup"); + scope.Start(); + try + { + using HttpMessage message = CreateRunDiscoGroupRequest(groupName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a disco template with a given templateId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetDiscoTemplateAsync(string templateId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetDiscoTemplateAsync(templateId, context).ConfigureAwait(false); + return Response.FromValue(DiscoTemplate.FromResponse(response), response); + } + + /// Retrieve a disco template with a given templateId. + /// The system generated unique id for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetDiscoTemplate(string templateId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetDiscoTemplate(templateId, context); + return Response.FromValue(DiscoTemplate.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a disco template with a given templateId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetDiscoTemplateAsync(string templateId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoTemplate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoTemplateRequest(templateId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a disco template with a given templateId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The system generated unique id for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetDiscoTemplate(string templateId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(templateId, nameof(templateId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetDiscoTemplate"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDiscoTemplateRequest(templateId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get billable assets summary for the workspace. + /// The cancellation token to use. + /// + public virtual async Task> GetBillableAsync(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetBillableAsync(context).ConfigureAwait(false); + return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + } + + /// Get billable assets summary for the workspace. + /// The cancellation token to use. + /// + public virtual Response GetBillable(CancellationToken cancellationToken = default) + { + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetBillable(context); + return Response.FromValue(ReportBillableAssetSummaryResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get billable assets summary for the workspace. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetBillableAsync(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBillableRequest(context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get billable assets summary for the workspace. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetBillable(RequestContext context) + { + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetBillable"); + scope.Start(); + try + { + using HttpMessage message = CreateGetBillableRequest(context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get the most recent snapshot of asset summary values for the snapshot request. + /// A request body used to retrieve an asset report snapshot. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetSnapshotAsync(ReportAssetSnapshotRequest reportAssetSnapshotRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(reportAssetSnapshotRequest, nameof(reportAssetSnapshotRequest)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = reportAssetSnapshotRequest.ToRequestContent(); + Response response = await GetSnapshotAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); + } + + /// Get the most recent snapshot of asset summary values for the snapshot request. + /// A request body used to retrieve an asset report snapshot. + /// The cancellation token to use. + /// is null. + /// + public virtual Response GetSnapshot(ReportAssetSnapshotRequest reportAssetSnapshotRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(reportAssetSnapshotRequest, nameof(reportAssetSnapshotRequest)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = reportAssetSnapshotRequest.ToRequestContent(); + Response response = GetSnapshot(content, context); + return Response.FromValue(ReportAssetSnapshotResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSnapshotAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSnapshotRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get the most recent snapshot of asset summary values for the snapshot request. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSnapshot(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSnapshot"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSnapshotRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get asset summary details for the summary request. + /// A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories. + /// The cancellation token to use. + /// is null. + /// + public virtual async Task> GetSummaryAsync(ReportAssetSummaryRequest reportAssetSummaryRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(reportAssetSummaryRequest, nameof(reportAssetSummaryRequest)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = reportAssetSummaryRequest.ToRequestContent(); + Response response = await GetSummaryAsync(content, context).ConfigureAwait(false); + return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + } + + /// Get asset summary details for the summary request. + /// A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories. + /// The cancellation token to use. + /// is null. + /// + public virtual Response GetSummary(ReportAssetSummaryRequest reportAssetSummaryRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(reportAssetSummaryRequest, nameof(reportAssetSummaryRequest)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = reportAssetSummaryRequest.ToRequestContent(); + Response response = GetSummary(content, context); + return Response.FromValue(ReportAssetSummaryResult.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get asset summary details for the summary request. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSummaryAsync(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSummaryRequest(content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get asset summary details for the summary request. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSummary(RequestContent content, RequestContext context = null) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSummary"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSummaryRequest(content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a saved filter by filterName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetSavedFilterAsync(string filterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetSavedFilterAsync(filterName, context).ConfigureAwait(false); + return Response.FromValue(SavedFilter.FromResponse(response), response); + } + + /// Retrieve a saved filter by filterName. + /// The caller provided unique name for the resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetSavedFilter(string filterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetSavedFilter(filterName, context); + return Response.FromValue(SavedFilter.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a saved filter by filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetSavedFilterAsync(string filterName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a saved filter by filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetSavedFilter(string filterName, RequestContext context) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateGetSavedFilterRequest(filterName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or replace a saved filter with a given filterName. + /// The caller provided unique name for the resource. + /// A request body used to create a saved filter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateOrReplaceSavedFilterAsync(string filterName, SavedFilterData savedFilterData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNull(savedFilterData, nameof(savedFilterData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = savedFilterData.ToRequestContent(); + Response response = await CreateOrReplaceSavedFilterAsync(filterName, content, context).ConfigureAwait(false); + return Response.FromValue(SavedFilter.FromResponse(response), response); + } + + /// Create or replace a saved filter with a given filterName. + /// The caller provided unique name for the resource. + /// A request body used to create a saved filter. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateOrReplaceSavedFilter(string filterName, SavedFilterData savedFilterData, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNull(savedFilterData, nameof(savedFilterData)); + + RequestContext context = FromCancellationToken(cancellationToken); + using RequestContent content = savedFilterData.ToRequestContent(); + Response response = CreateOrReplaceSavedFilter(filterName, content, context); + return Response.FromValue(SavedFilter.FromResponse(response), response); + } + + /// + /// [Protocol Method] Create or replace a saved filter with a given filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrReplaceSavedFilterAsync(string filterName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Create or replace a saved filter with a given filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrReplaceSavedFilter(string filterName, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CreateOrReplaceSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrReplaceSavedFilterRequest(filterName, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a saved filter with a given filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task DeleteSavedFilterAsync(string filterName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method + /// + /// [Protocol Method] Delete a saved filter with a given filterName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The caller provided unique name for the resource. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response DeleteSavedFilter(string filterName, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(filterName, nameof(filterName)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.DeleteSavedFilter"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteSavedFilterRequest(filterName, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a task by taskId. + /// The unique identifier of the task. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTaskAsync(string taskId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// Retrieve a task by taskId. + /// The unique identifier of the task. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTask(string taskId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTask(taskId, context); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// + /// [Protocol Method] Retrieve a task by taskId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier of the task. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTaskAsync(string taskId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskRequest(taskId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Retrieve a task by taskId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier of the task. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTask(string taskId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.GetTask"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTaskRequest(taskId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Cancel a task by taskId. + /// The unique identifier of the task. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CancelTaskAsync(string taskId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CancelTaskAsync(taskId, context).ConfigureAwait(false); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// Cancel a task by taskId. + /// The unique identifier of the task. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response CancelTask(string taskId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CancelTask(taskId, context); + return Response.FromValue(Task.FromResponse(response), response); + } + + /// + /// [Protocol Method] Cancel a task by taskId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier of the task. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CancelTaskAsync(string taskId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTaskRequest(taskId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Cancel a task by taskId. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier of the task. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CancelTask(string taskId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(taskId, nameof(taskId)); + + using var scope = ClientDiagnostics.CreateScope("EasmClient.CancelTask"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelTaskRequest(taskId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Retrieve a list of assets for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetAssetResourcesAsync(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, maxpagesize, mark, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, mark, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AssetResource.DeserializeAssetResource, ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", context); + } + + /// Retrieve a list of assets for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// The cancellation token to use. + /// + public virtual Pageable GetAssetResources(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, string mark = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, maxpagesize, mark, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, mark, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AssetResource.DeserializeAssetResource, ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of assets for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetAssetResourcesAsync(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, maxpagesize, mark, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, mark, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of assets for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetAssetResources(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetAssetResourcesRequest(filter, orderby, skip, maxpagesize, mark, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetAssetResourcesNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, mark, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetAssetResources", "value", "nextLink", context); + } + + /// Retrieve a list of data connections. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetDataConnectionsAsync(int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDataConnectionsRequest(skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDataConnectionsNextPageRequest(nextLink, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DataConnection.DeserializeDataConnection, ClientDiagnostics, _pipeline, "EasmClient.GetDataConnections", "value", "nextLink", context); + } + + /// Retrieve a list of data connections. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetDataConnections(int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDataConnectionsRequest(skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDataConnectionsNextPageRequest(nextLink, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DataConnection.DeserializeDataConnection, ClientDiagnostics, _pipeline, "EasmClient.GetDataConnections", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of data connections. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetDataConnectionsAsync(int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDataConnectionsRequest(skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDataConnectionsNextPageRequest(nextLink, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDataConnections", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of data connections. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetDataConnections(int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDataConnectionsRequest(skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDataConnectionsNextPageRequest(nextLink, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDataConnections", "value", "nextLink", context); + } + + /// Retrieve a list of discovery group for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetDiscoGroupsAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoGroup.DeserializeDiscoGroup, ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", context); + } + + /// Retrieve a list of discovery group for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetDiscoGroups(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoGroup.DeserializeDiscoGroup, ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of discovery group for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetDiscoGroupsAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of discovery group for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetDiscoGroups(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoGroupsRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoGroupsNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoGroups", "value", "nextLink", context); + } + + /// Retrieve a collection of discovery run results for a discovery group with a given groupName. + /// The unique identifier for the discovery group. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetRunsAsync(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoRunResult.DeserializeDiscoRunResult, ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", context); + } + + /// Retrieve a collection of discovery run results for a discovery group with a given groupName. + /// The unique identifier for the discovery group. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetRuns(string groupName, string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoRunResult.DeserializeDiscoRunResult, ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a collection of discovery run results for a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier for the discovery group. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetRunsAsync(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a collection of discovery run results for a discovery group with a given groupName. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The unique identifier for the discovery group. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetRuns(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + { + Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetRunsRequest(groupName, filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetRunsNextPageRequest(nextLink, groupName, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetRuns", "value", "nextLink", context); + } + + /// Retrieve a list of disco templates for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetDiscoTemplatesAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoTemplate.DeserializeDiscoTemplate, ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", context); + } + + /// Retrieve a list of disco templates for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetDiscoTemplates(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoTemplate.DeserializeDiscoTemplate, ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of disco templates for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetDiscoTemplatesAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of disco templates for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetDiscoTemplates(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetDiscoTemplatesRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetDiscoTemplatesNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetDiscoTemplates", "value", "nextLink", context); + } + + /// Retrieve a list of saved filters for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetSavedFiltersAsync(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSavedFiltersRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSavedFiltersNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SavedFilter.DeserializeSavedFilter, ClientDiagnostics, _pipeline, "EasmClient.GetSavedFilters", "value", "nextLink", context); + } + + /// Retrieve a list of saved filters for the provided search parameters. + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetSavedFilters(string filter = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSavedFiltersRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSavedFiltersNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SavedFilter.DeserializeSavedFilter, ClientDiagnostics, _pipeline, "EasmClient.GetSavedFilters", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of saved filters for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetSavedFiltersAsync(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSavedFiltersRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSavedFiltersNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetSavedFilters", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of saved filters for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetSavedFilters(string filter, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetSavedFiltersRequest(filter, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetSavedFiltersNextPageRequest(nextLink, filter, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetSavedFilters", "value", "nextLink", context); + } + + /// Retrieve a list of tasks for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual AsyncPageable GetTasksAsync(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, Task.DeserializeTask, ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", context); + } + + /// Retrieve a list of tasks for the provided search parameters. + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The cancellation token to use. + /// + public virtual Pageable GetTasks(string filter = null, string orderby = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default) + { + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, Task.DeserializeTask, ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of tasks for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTasksAsync(string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", context); + } + + /// + /// [Protocol Method] Retrieve a list of tasks for the provided search parameters. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// Filter the result list using the given expression. + /// A list of expressions that specify the order of the returned resources. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTasks(string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTasksRequest(filter, orderby, skip, maxpagesize, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTasksNextPageRequest(nextLink, filter, orderby, skip, maxpagesize, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EasmClient.GetTasks", "value", "nextLink", context); + } + + internal HttpMessage CreateGetAssetResourcesRequest(string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/assets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (orderby != null) + { + uri.AppendQuery("orderby", orderby, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (mark != null) + { + uri.AppendQuery("mark", mark, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateUpdateAssetsRequest(string filter, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/assets", false); + uri.AppendQuery("filter", filter, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetAssetResourceRequest(string assetId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/assets/", false); + uri.AppendPath(assetId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDataConnectionsRequest(int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/dataConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateValidateDataConnectionRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/dataConnections:validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDataConnectionRequest(string dataConnectionName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/dataConnections/", false); + uri.AppendPath(dataConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrReplaceDataConnectionRequest(string dataConnectionName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/dataConnections/", false); + uri.AppendPath(dataConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteDataConnectionRequest(string dataConnectionName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/dataConnections/", false); + uri.AppendPath(dataConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDiscoGroupsRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateValidateDiscoGroupRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups:validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetDiscoGroupRequest(string groupName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrReplaceDiscoGroupRequest(string groupName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups/", false); + uri.AppendPath(groupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateRunDiscoGroupRequest(string groupName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath(":run", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetRunsRequest(string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoGroups/", false); + uri.AppendPath(groupName, true); + uri.AppendPath("/runs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDiscoTemplatesRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoTemplates", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDiscoTemplateRequest(string templateId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/discoTemplates/", false); + uri.AppendPath(templateId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetBillableRequest(RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/reports/assets:getBillable", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSnapshotRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/reports/assets:getSnapshot", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSummaryRequest(RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/reports/assets:getSummary", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetSavedFiltersRequest(string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/savedFilters", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSavedFilterRequest(string filterName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/savedFilters/", false); + uri.AppendPath(filterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrReplaceSavedFilterRequest(string filterName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/savedFilters/", false); + uri.AppendPath(filterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteSavedFilterRequest(string filterName, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/savedFilters/", false); + uri.AppendPath(filterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTasksRequest(string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/tasks", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + if (orderby != null) + { + uri.AppendQuery("orderby", orderby, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTaskRequest(string taskId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCancelTaskRequest(string taskId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendPath("/tasks/", false); + uri.AppendPath(taskId, true); + uri.AppendPath(":cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAssetResourcesNextPageRequest(string nextLink, string filter, string orderby, int? skip, int? maxpagesize, string mark, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDataConnectionsNextPageRequest(string nextLink, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDiscoGroupsNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetRunsNextPageRequest(string nextLink, string groupName, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDiscoTemplatesNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetSavedFiltersNextPageRequest(string nextLink, string filter, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTasksNextPageRequest(string nextLink, string filter, string orderby, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/subscriptions/", false); + uri.AppendRaw(_subscriptionId, true); + uri.AppendRaw("/resourceGroups/", false); + uri.AppendRaw(_resourceGroupName, true); + uri.AppendRaw("/workspaces/", false); + uri.AppendRaw(_workspaceName, true); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + private static ResponseClassifier _responseClassifier204; + private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs new file mode 100644 index 000000000000..e5ea46ee7b0b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/EasmClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// Client options for EasmClient. + public partial class EasmClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2023_03_01_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2023-03-01-preview". + V2023_03_01_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of EasmClientOptions. + public EasmClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2023_03_01_Preview => "2023-03-01-preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.Serialization.cs new file mode 100644 index 000000000000..ac32a7de55d4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.Serialization.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ErrorDetail + { + internal static ErrorDetail DeserializeErrorDetail(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + Optional target = default; + Optional> details = default; + Optional innererror = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeErrorDetail(item)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = InnerError.DeserializeInnerError(property.Value); + continue; + } + } + return new ErrorDetail(code, message, target.Value, Optional.ToList(details), innererror.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ErrorDetail FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeErrorDetail(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.cs new file mode 100644 index 000000000000..bc7ac762ab6f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ErrorDetail.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// This is the top-level error object whose code matches the x-ms-error-code response header. + public partial class ErrorDetail + { + /// Initializes a new instance of ErrorDetail. + /// This is one of a server-defined set of error codes. + /// This is a human-readable representation of the error. + /// or is null. + internal ErrorDetail(string code, string message) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Code = code; + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of ErrorDetail. + /// This is one of a server-defined set of error codes. + /// This is a human-readable representation of the error. + /// This is the error target. + /// This is an array of details about specific errors that led to this reported error. + /// This is an object containing more specific information than the current object about the error. + internal ErrorDetail(string code, string message, string target, IReadOnlyList details, InnerError innererror) + { + Code = code; + Message = message; + Target = target; + Details = details; + Innererror = innererror; + } + + /// This is one of a server-defined set of error codes. + public string Code { get; } + /// This is a human-readable representation of the error. + public string Message { get; } + /// This is the error target. + public string Target { get; } + /// This is an array of details about specific errors that led to this reported error. + public IReadOnlyList Details { get; } + /// This is an object containing more specific information than the current object about the error. + public InnerError Innererror { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.Serialization.cs new file mode 100644 index 000000000000..3a93ee3df9e2 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class GuidPair + { + internal static GuidPair DeserializeGuidPair(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional pageGuid = default; + Optional crawlStateGuid = default; + Optional loadDate = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pageGuid"u8)) + { + pageGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("crawlStateGuid"u8)) + { + crawlStateGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new GuidPair(pageGuid.Value, crawlStateGuid.Value, Optional.ToNullable(loadDate), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static GuidPair FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeGuidPair(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.cs new file mode 100644 index 000000000000..6d5ef443de31 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/GuidPair.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The GuidPair. + public partial class GuidPair + { + /// Initializes a new instance of GuidPair. + internal GuidPair() + { + } + + /// Initializes a new instance of GuidPair. + /// + /// + /// + /// + internal GuidPair(string pageGuid, string crawlStateGuid, DateTimeOffset? loadDate, bool? recent) + { + PageGuid = pageGuid; + CrawlStateGuid = crawlStateGuid; + LoadDate = loadDate; + Recent = recent; + } + + /// Gets the page guid. + public string PageGuid { get; } + /// Gets the crawl state guid. + public string CrawlStateGuid { get; } + /// Gets the load date. + public DateTimeOffset? LoadDate { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.Serialization.cs new file mode 100644 index 000000000000..e8477e55575e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.Serialization.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class HostAsset + { + internal static HostAsset DeserializeHostAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional host = default; + Optional domain = default; + Optional> ipAddresses = default; + Optional> webComponents = default; + Optional> headers = default; + Optional> attributes = default; + Optional> cookies = default; + Optional> sslCerts = default; + Optional> parentHosts = default; + Optional> childHosts = default; + Optional hostCore = default; + Optional> services = default; + Optional> cnames = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> resourceUrls = default; + Optional> scanMetadata = default; + Optional> asns = default; + Optional> ipBlocks = default; + Optional> responseBodies = default; + Optional domainAsset = default; + Optional> nsRecord = default; + Optional> mxRecord = default; + Optional> webserver = default; + Optional> location = default; + Optional> nxdomain = default; + Optional> sslServerConfig = default; + Optional> isWildcard = default; + Optional> banners = default; + Optional> ipv4 = default; + Optional> ipv6 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("webComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebComponent.DeserializeWebComponent(item)); + } + webComponents = array; + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedHeader.DeserializeObservedHeader(item)); + } + headers = array; + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Attribute.DeserializeAttribute(item)); + } + attributes = array; + continue; + } + if (property.NameEquals("cookies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Cookie.DeserializeCookie(item)); + } + cookies = array; + continue; + } + if (property.NameEquals("sslCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SslCertAsset.DeserializeSslCertAsset(item)); + } + sslCerts = array; + continue; + } + if (property.NameEquals("parentHosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + parentHosts = array; + continue; + } + if (property.NameEquals("childHosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + childHosts = array; + continue; + } + if (property.NameEquals("hostCore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostCore = HostCore.DeserializeHostCore(property.Value); + continue; + } + if (property.NameEquals("services"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Service.DeserializeService(item)); + } + services = array; + continue; + } + if (property.NameEquals("cnames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + cnames = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("resourceUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceUrl.DeserializeResourceUrl(item)); + } + resourceUrls = array; + continue; + } + if (property.NameEquals("scanMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.ScanMetadata.DeserializeScanMetadata(item)); + } + scanMetadata = array; + continue; + } + if (property.NameEquals("asns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + asns = array; + continue; + } + if (property.NameEquals("ipBlocks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpBlock.DeserializeIpBlock(item)); + } + ipBlocks = array; + continue; + } + if (property.NameEquals("responseBodies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + responseBodies = array; + continue; + } + if (property.NameEquals("domainAsset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainAsset = DomainAsset.DeserializeDomainAsset(property.Value); + continue; + } + if (property.NameEquals("nsRecord"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + nsRecord = array; + continue; + } + if (property.NameEquals("mxRecord"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + mxRecord = array; + continue; + } + if (property.NameEquals("webserver"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + webserver = array; + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLocation.DeserializeObservedLocation(item)); + } + location = array; + continue; + } + if (property.NameEquals("nxdomain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + nxdomain = array; + continue; + } + if (property.NameEquals("sslServerConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.SslServerConfig.DeserializeSslServerConfig(item)); + } + sslServerConfig = array; + continue; + } + if (property.NameEquals("isWildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + isWildcard = array; + continue; + } + if (property.NameEquals("banners"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Banner.DeserializeBanner(item)); + } + banners = array; + continue; + } + if (property.NameEquals("ipv4"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + ipv4 = array; + continue; + } + if (property.NameEquals("ipv6"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + ipv6 = array; + continue; + } + } + return new HostAsset(host.Value, domain.Value, Optional.ToList(ipAddresses), Optional.ToList(webComponents), Optional.ToList(headers), Optional.ToList(attributes), Optional.ToList(cookies), Optional.ToList(sslCerts), Optional.ToList(parentHosts), Optional.ToList(childHosts), hostCore.Value, Optional.ToList(services), Optional.ToList(cnames), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(resourceUrls), Optional.ToList(scanMetadata), Optional.ToList(asns), Optional.ToList(ipBlocks), Optional.ToList(responseBodies), domainAsset.Value, Optional.ToList(nsRecord), Optional.ToList(mxRecord), Optional.ToList(webserver), Optional.ToList(location), Optional.ToList(nxdomain), Optional.ToList(sslServerConfig), Optional.ToList(isWildcard), Optional.ToList(banners), Optional.ToList(ipv4), Optional.ToList(ipv6)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static HostAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeHostAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.cs new file mode 100644 index 000000000000..0fca82ab191f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAsset.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The HostAsset. + public partial class HostAsset : InventoryAsset + { + /// Initializes a new instance of HostAsset. + internal HostAsset() + { + IpAddresses = new ChangeTrackingList(); + WebComponents = new ChangeTrackingList(); + Headers = new ChangeTrackingList(); + Attributes = new ChangeTrackingList(); + Cookies = new ChangeTrackingList(); + SslCerts = new ChangeTrackingList(); + ParentHosts = new ChangeTrackingList(); + ChildHosts = new ChangeTrackingList(); + Services = new ChangeTrackingList(); + Cnames = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + ResourceUrls = new ChangeTrackingList(); + ScanMetadata = new ChangeTrackingList(); + Asns = new ChangeTrackingList(); + IpBlocks = new ChangeTrackingList(); + ResponseBodies = new ChangeTrackingList(); + NsRecord = new ChangeTrackingList(); + MxRecord = new ChangeTrackingList(); + Webserver = new ChangeTrackingList(); + Location = new ChangeTrackingList(); + Nxdomain = new ChangeTrackingList(); + SslServerConfig = new ChangeTrackingList(); + IsWildcard = new ChangeTrackingList(); + Banners = new ChangeTrackingList(); + Ipv4 = new ChangeTrackingList(); + Ipv6 = new ChangeTrackingList(); + } + + /// Initializes a new instance of HostAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal HostAsset(string host, string domain, IReadOnlyList ipAddresses, IReadOnlyList webComponents, IReadOnlyList headers, IReadOnlyList attributes, IReadOnlyList cookies, IReadOnlyList sslCerts, IReadOnlyList parentHosts, IReadOnlyList childHosts, HostCore hostCore, IReadOnlyList services, IReadOnlyList cnames, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList resourceUrls, IReadOnlyList scanMetadata, IReadOnlyList asns, IReadOnlyList ipBlocks, IReadOnlyList responseBodies, DomainAsset domainAsset, IReadOnlyList nsRecord, IReadOnlyList mxRecord, IReadOnlyList webserver, IReadOnlyList location, IReadOnlyList nxdomain, IReadOnlyList sslServerConfig, IReadOnlyList isWildcard, IReadOnlyList banners, IReadOnlyList ipv4, IReadOnlyList ipv6) + { + Host = host; + Domain = domain; + IpAddresses = ipAddresses; + WebComponents = webComponents; + Headers = headers; + Attributes = attributes; + Cookies = cookies; + SslCerts = sslCerts; + ParentHosts = parentHosts; + ChildHosts = childHosts; + HostCore = hostCore; + Services = services; + Cnames = cnames; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + ResourceUrls = resourceUrls; + ScanMetadata = scanMetadata; + Asns = asns; + IpBlocks = ipBlocks; + ResponseBodies = responseBodies; + DomainAsset = domainAsset; + NsRecord = nsRecord; + MxRecord = mxRecord; + Webserver = webserver; + Location = location; + Nxdomain = nxdomain; + SslServerConfig = sslServerConfig; + IsWildcard = isWildcard; + Banners = banners; + Ipv4 = ipv4; + Ipv6 = ipv6; + } + + /// Gets the host. + public string Host { get; } + /// Gets the domain. + public string Domain { get; } + /// Gets the ip addresses. + public IReadOnlyList IpAddresses { get; } + /// Gets the web components. + public IReadOnlyList WebComponents { get; } + /// Gets the headers. + public IReadOnlyList Headers { get; } + /// Gets the attributes. + public IReadOnlyList Attributes { get; } + /// Gets the cookies. + public IReadOnlyList Cookies { get; } + /// Gets the ssl certs. + public IReadOnlyList SslCerts { get; } + /// Gets the parent hosts. + public IReadOnlyList ParentHosts { get; } + /// Gets the child hosts. + public IReadOnlyList ChildHosts { get; } + /// Gets the host core. + public HostCore HostCore { get; } + /// Gets the services. + public IReadOnlyList Services { get; } + /// Gets the cnames. + public IReadOnlyList Cnames { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the resource urls. + public IReadOnlyList ResourceUrls { get; } + /// Gets the scan metadata. + public IReadOnlyList ScanMetadata { get; } + /// Gets the asns. + public IReadOnlyList Asns { get; } + /// Gets the ip blocks. + public IReadOnlyList IpBlocks { get; } + /// Gets the response bodies. + public IReadOnlyList ResponseBodies { get; } + /// Gets the domain asset. + public DomainAsset DomainAsset { get; } + /// Gets the ns record. + public IReadOnlyList NsRecord { get; } + /// Gets the mx record. + public IReadOnlyList MxRecord { get; } + /// Gets the webserver. + public IReadOnlyList Webserver { get; } + /// Gets the location. + public IReadOnlyList Location { get; } + /// Gets the nxdomain. + public IReadOnlyList Nxdomain { get; } + /// Gets the ssl server config. + public IReadOnlyList SslServerConfig { get; } + /// Gets the is wildcard. + public IReadOnlyList IsWildcard { get; } + /// Gets the banners. + public IReadOnlyList Banners { get; } + /// Gets the ipv 4. + public IReadOnlyList Ipv4 { get; } + /// Gets the ipv 6. + public IReadOnlyList Ipv6 { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.Serialization.cs new file mode 100644 index 000000000000..492b5121fd0a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class HostAssetResource + { + internal static HostAssetResource DeserializeHostAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HostAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = HostAsset.DeserializeHostAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new HostAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new HostAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeHostAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.cs new file mode 100644 index 000000000000..cc7f7a25cce9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The HostAssetResource. + public partial class HostAssetResource : AssetResource + { + /// Initializes a new instance of HostAssetResource. + /// asset. + /// is null. + internal HostAssetResource(HostAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "host"; + Asset = asset; + } + + /// Initializes a new instance of HostAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal HostAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, HostAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public HostAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.Serialization.cs new file mode 100644 index 000000000000..ed7ad133bfff --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.Serialization.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class HostCore + { + internal static HostCore DeserializeHostCore(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional host = default; + Optional domain = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional blacklistCauseFirstSeen = default; + Optional blacklistCauseLastSeen = default; + Optional blacklistCauseCount = default; + Optional blacklistResourceFirstSeen = default; + Optional blacklistResourceLastSeen = default; + Optional blacklistResourceCount = default; + Optional blacklistSequenceFirstSeen = default; + Optional blacklistSequenceLastSeen = default; + Optional blacklistSequenceCount = default; + Optional phishCauseCount = default; + Optional malwareCauseCount = default; + Optional spamCauseCount = default; + Optional scamCauseCount = default; + Optional phishResourceCount = default; + Optional malwareResourceCount = default; + Optional spamResourceCount = default; + Optional scamResourceCount = default; + Optional phishSequenceCount = default; + Optional malwareSequenceCount = default; + Optional spamSequenceCount = default; + Optional scamSequenceCount = default; + Optional alexaRank = default; + Optional hostReputationScore = default; + Optional hostPhishReputationScore = default; + Optional hostMalwareReputationScore = default; + Optional hostSpamReputationScore = default; + Optional hostScamReputationScore = default; + Optional domainReputationScore = default; + Optional domainPhishReputationScore = default; + Optional domainMalwareReputationScore = default; + Optional domainSpamReputationScore = default; + Optional domainScamReputationScore = default; + Optional uuid = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("blacklistCauseFirstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistCauseFirstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistCauseLastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistCauseLastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistCauseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistCauseCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("blacklistResourceFirstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistResourceFirstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistResourceLastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistResourceLastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistResourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistResourceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("blacklistSequenceFirstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistSequenceFirstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistSequenceLastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistSequenceLastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("blacklistSequenceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blacklistSequenceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("phishCauseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phishCauseCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("malwareCauseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + malwareCauseCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("spamCauseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spamCauseCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("scamCauseCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scamCauseCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("phishResourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phishResourceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("malwareResourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + malwareResourceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("spamResourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spamResourceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("scamResourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scamResourceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("phishSequenceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phishSequenceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("malwareSequenceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + malwareSequenceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("spamSequenceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spamSequenceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("scamSequenceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scamSequenceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("alexaRank"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + alexaRank = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostPhishReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostPhishReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostMalwareReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostMalwareReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostSpamReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostSpamReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostScamReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hostScamReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domainReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domainPhishReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainPhishReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domainMalwareReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainMalwareReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domainSpamReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainSpamReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domainScamReputationScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainScamReputationScore = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + uuid = property.Value.GetString(); + continue; + } + } + return new HostCore(host.Value, domain.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(blacklistCauseFirstSeen), Optional.ToNullable(blacklistCauseLastSeen), Optional.ToNullable(blacklistCauseCount), Optional.ToNullable(blacklistResourceFirstSeen), Optional.ToNullable(blacklistResourceLastSeen), Optional.ToNullable(blacklistResourceCount), Optional.ToNullable(blacklistSequenceFirstSeen), Optional.ToNullable(blacklistSequenceLastSeen), Optional.ToNullable(blacklistSequenceCount), Optional.ToNullable(phishCauseCount), Optional.ToNullable(malwareCauseCount), Optional.ToNullable(spamCauseCount), Optional.ToNullable(scamCauseCount), Optional.ToNullable(phishResourceCount), Optional.ToNullable(malwareResourceCount), Optional.ToNullable(spamResourceCount), Optional.ToNullable(scamResourceCount), Optional.ToNullable(phishSequenceCount), Optional.ToNullable(malwareSequenceCount), Optional.ToNullable(spamSequenceCount), Optional.ToNullable(scamSequenceCount), Optional.ToNullable(alexaRank), Optional.ToNullable(hostReputationScore), Optional.ToNullable(hostPhishReputationScore), Optional.ToNullable(hostMalwareReputationScore), Optional.ToNullable(hostSpamReputationScore), Optional.ToNullable(hostScamReputationScore), Optional.ToNullable(domainReputationScore), Optional.ToNullable(domainPhishReputationScore), Optional.ToNullable(domainMalwareReputationScore), Optional.ToNullable(domainSpamReputationScore), Optional.ToNullable(domainScamReputationScore), uuid.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static HostCore FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeHostCore(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.cs new file mode 100644 index 000000000000..ecbbcc570d74 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/HostCore.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The HostCore. + public partial class HostCore + { + /// Initializes a new instance of HostCore. + internal HostCore() + { + } + + /// Initializes a new instance of HostCore. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal HostCore(string host, string domain, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, DateTimeOffset? blacklistCauseFirstSeen, DateTimeOffset? blacklistCauseLastSeen, long? blacklistCauseCount, DateTimeOffset? blacklistResourceFirstSeen, DateTimeOffset? blacklistResourceLastSeen, long? blacklistResourceCount, DateTimeOffset? blacklistSequenceFirstSeen, DateTimeOffset? blacklistSequenceLastSeen, long? blacklistSequenceCount, long? phishCauseCount, long? malwareCauseCount, long? spamCauseCount, long? scamCauseCount, long? phishResourceCount, long? malwareResourceCount, long? spamResourceCount, long? scamResourceCount, long? phishSequenceCount, long? malwareSequenceCount, long? spamSequenceCount, long? scamSequenceCount, int? alexaRank, int? hostReputationScore, int? hostPhishReputationScore, int? hostMalwareReputationScore, int? hostSpamReputationScore, int? hostScamReputationScore, int? domainReputationScore, int? domainPhishReputationScore, int? domainMalwareReputationScore, int? domainSpamReputationScore, int? domainScamReputationScore, string uuid) + { + Host = host; + Domain = domain; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + BlacklistCauseFirstSeen = blacklistCauseFirstSeen; + BlacklistCauseLastSeen = blacklistCauseLastSeen; + BlacklistCauseCount = blacklistCauseCount; + BlacklistResourceFirstSeen = blacklistResourceFirstSeen; + BlacklistResourceLastSeen = blacklistResourceLastSeen; + BlacklistResourceCount = blacklistResourceCount; + BlacklistSequenceFirstSeen = blacklistSequenceFirstSeen; + BlacklistSequenceLastSeen = blacklistSequenceLastSeen; + BlacklistSequenceCount = blacklistSequenceCount; + PhishCauseCount = phishCauseCount; + MalwareCauseCount = malwareCauseCount; + SpamCauseCount = spamCauseCount; + ScamCauseCount = scamCauseCount; + PhishResourceCount = phishResourceCount; + MalwareResourceCount = malwareResourceCount; + SpamResourceCount = spamResourceCount; + ScamResourceCount = scamResourceCount; + PhishSequenceCount = phishSequenceCount; + MalwareSequenceCount = malwareSequenceCount; + SpamSequenceCount = spamSequenceCount; + ScamSequenceCount = scamSequenceCount; + AlexaRank = alexaRank; + HostReputationScore = hostReputationScore; + HostPhishReputationScore = hostPhishReputationScore; + HostMalwareReputationScore = hostMalwareReputationScore; + HostSpamReputationScore = hostSpamReputationScore; + HostScamReputationScore = hostScamReputationScore; + DomainReputationScore = domainReputationScore; + DomainPhishReputationScore = domainPhishReputationScore; + DomainMalwareReputationScore = domainMalwareReputationScore; + DomainSpamReputationScore = domainSpamReputationScore; + DomainScamReputationScore = domainScamReputationScore; + Uuid = uuid; + } + + /// Gets the host. + public string Host { get; } + /// Gets the domain. + public string Domain { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the blacklist cause first seen. + public DateTimeOffset? BlacklistCauseFirstSeen { get; } + /// Gets the blacklist cause last seen. + public DateTimeOffset? BlacklistCauseLastSeen { get; } + /// Gets the blacklist cause count. + public long? BlacklistCauseCount { get; } + /// Gets the blacklist resource first seen. + public DateTimeOffset? BlacklistResourceFirstSeen { get; } + /// Gets the blacklist resource last seen. + public DateTimeOffset? BlacklistResourceLastSeen { get; } + /// Gets the blacklist resource count. + public long? BlacklistResourceCount { get; } + /// Gets the blacklist sequence first seen. + public DateTimeOffset? BlacklistSequenceFirstSeen { get; } + /// Gets the blacklist sequence last seen. + public DateTimeOffset? BlacklistSequenceLastSeen { get; } + /// Gets the blacklist sequence count. + public long? BlacklistSequenceCount { get; } + /// Gets the phish cause count. + public long? PhishCauseCount { get; } + /// Gets the malware cause count. + public long? MalwareCauseCount { get; } + /// Gets the spam cause count. + public long? SpamCauseCount { get; } + /// Gets the scam cause count. + public long? ScamCauseCount { get; } + /// Gets the phish resource count. + public long? PhishResourceCount { get; } + /// Gets the malware resource count. + public long? MalwareResourceCount { get; } + /// Gets the spam resource count. + public long? SpamResourceCount { get; } + /// Gets the scam resource count. + public long? ScamResourceCount { get; } + /// Gets the phish sequence count. + public long? PhishSequenceCount { get; } + /// Gets the malware sequence count. + public long? MalwareSequenceCount { get; } + /// Gets the spam sequence count. + public long? SpamSequenceCount { get; } + /// Gets the scam sequence count. + public long? ScamSequenceCount { get; } + /// Gets the alexa rank. + public int? AlexaRank { get; } + /// Gets the host reputation score. + public int? HostReputationScore { get; } + /// Gets the host phish reputation score. + public int? HostPhishReputationScore { get; } + /// Gets the host malware reputation score. + public int? HostMalwareReputationScore { get; } + /// Gets the host spam reputation score. + public int? HostSpamReputationScore { get; } + /// Gets the host scam reputation score. + public int? HostScamReputationScore { get; } + /// Gets the domain reputation score. + public int? DomainReputationScore { get; } + /// Gets the domain phish reputation score. + public int? DomainPhishReputationScore { get; } + /// Gets the domain malware reputation score. + public int? DomainMalwareReputationScore { get; } + /// Gets the domain spam reputation score. + public int? DomainSpamReputationScore { get; } + /// Gets the domain scam reputation score. + public int? DomainScamReputationScore { get; } + /// Gets the uuid. + public string Uuid { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.Serialization.cs new file mode 100644 index 000000000000..fca587c2356d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class InnerError + { + internal static InnerError DeserializeInnerError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + } + return new InnerError(code.Value, value.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static InnerError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeInnerError(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.cs new file mode 100644 index 000000000000..9e00d593c731 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InnerError.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// This is an object containing more specific information than the current object about the error. + public partial class InnerError + { + /// Initializes a new instance of InnerError. + internal InnerError() + { + } + + /// Initializes a new instance of InnerError. + /// This is a more specific error code than was provided by the containing error. + /// This is an additional field representing the value that caused the error to help with debugging. + internal InnerError(string code, BinaryData value) + { + Code = code; + Value = value; + } + + /// This is a more specific error code than was provided by the containing error. + public string Code { get; } + /// + /// This is an additional field representing the value that caused the error to help with debugging. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Value { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InventoryAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InventoryAsset.cs new file mode 100644 index 000000000000..fb8ec92ac917 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/InventoryAsset.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The InventoryAsset. + public partial class InventoryAsset + { + /// Initializes a new instance of InventoryAsset. + internal InventoryAsset() + { + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.Serialization.cs new file mode 100644 index 000000000000..41a8b983da1f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.Serialization.cs @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class IpAddressAsset + { + internal static IpAddressAsset DeserializeIpAddressAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional ipAddress = default; + Optional> asns = default; + Optional> reputations = default; + Optional> webComponents = default; + Optional> netRanges = default; + Optional> headers = default; + Optional> attributes = default; + Optional> cookies = default; + Optional> sslCerts = default; + Optional> services = default; + Optional> ipBlocks = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> banners = default; + Optional> scanMetadata = default; + Optional> nsRecord = default; + Optional> mxRecord = default; + Optional> location = default; + Optional> hosts = default; + Optional> nxdomain = default; + Optional> sslServerConfig = default; + Optional ipv4 = default; + Optional ipv6 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("asns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + asns = array; + continue; + } + if (property.NameEquals("reputations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Reputation.DeserializeReputation(item)); + } + reputations = array; + continue; + } + if (property.NameEquals("webComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebComponent.DeserializeWebComponent(item)); + } + webComponents = array; + continue; + } + if (property.NameEquals("netRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + netRanges = array; + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedHeader.DeserializeObservedHeader(item)); + } + headers = array; + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Attribute.DeserializeAttribute(item)); + } + attributes = array; + continue; + } + if (property.NameEquals("cookies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Cookie.DeserializeCookie(item)); + } + cookies = array; + continue; + } + if (property.NameEquals("sslCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SslCertAsset.DeserializeSslCertAsset(item)); + } + sslCerts = array; + continue; + } + if (property.NameEquals("services"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Service.DeserializeService(item)); + } + services = array; + continue; + } + if (property.NameEquals("ipBlocks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpBlock.DeserializeIpBlock(item)); + } + ipBlocks = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("banners"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Banner.DeserializeBanner(item)); + } + banners = array; + continue; + } + if (property.NameEquals("scanMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.ScanMetadata.DeserializeScanMetadata(item)); + } + scanMetadata = array; + continue; + } + if (property.NameEquals("nsRecord"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + nsRecord = array; + continue; + } + if (property.NameEquals("mxRecord"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + mxRecord = array; + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLocation.DeserializeObservedLocation(item)); + } + location = array; + continue; + } + if (property.NameEquals("hosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + hosts = array; + continue; + } + if (property.NameEquals("nxdomain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + nxdomain = array; + continue; + } + if (property.NameEquals("sslServerConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.SslServerConfig.DeserializeSslServerConfig(item)); + } + sslServerConfig = array; + continue; + } + if (property.NameEquals("ipv4"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv4 = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ipv6"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv6 = property.Value.GetBoolean(); + continue; + } + } + return new IpAddressAsset(ipAddress.Value, Optional.ToList(asns), Optional.ToList(reputations), Optional.ToList(webComponents), Optional.ToList(netRanges), Optional.ToList(headers), Optional.ToList(attributes), Optional.ToList(cookies), Optional.ToList(sslCerts), Optional.ToList(services), Optional.ToList(ipBlocks), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(banners), Optional.ToList(scanMetadata), Optional.ToList(nsRecord), Optional.ToList(mxRecord), Optional.ToList(location), Optional.ToList(hosts), Optional.ToList(nxdomain), Optional.ToList(sslServerConfig), Optional.ToNullable(ipv4), Optional.ToNullable(ipv6)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IpAddressAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpAddressAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.cs new file mode 100644 index 000000000000..7e82e74e2260 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAsset.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The IpAddressAsset. + public partial class IpAddressAsset : InventoryAsset + { + /// Initializes a new instance of IpAddressAsset. + internal IpAddressAsset() + { + Asns = new ChangeTrackingList(); + Reputations = new ChangeTrackingList(); + WebComponents = new ChangeTrackingList(); + NetRanges = new ChangeTrackingList(); + Headers = new ChangeTrackingList(); + Attributes = new ChangeTrackingList(); + Cookies = new ChangeTrackingList(); + SslCerts = new ChangeTrackingList(); + Services = new ChangeTrackingList(); + IpBlocks = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + Banners = new ChangeTrackingList(); + ScanMetadata = new ChangeTrackingList(); + NsRecord = new ChangeTrackingList(); + MxRecord = new ChangeTrackingList(); + Location = new ChangeTrackingList(); + Hosts = new ChangeTrackingList(); + Nxdomain = new ChangeTrackingList(); + SslServerConfig = new ChangeTrackingList(); + } + + /// Initializes a new instance of IpAddressAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal IpAddressAsset(string ipAddress, IReadOnlyList asns, IReadOnlyList reputations, IReadOnlyList webComponents, IReadOnlyList netRanges, IReadOnlyList headers, IReadOnlyList attributes, IReadOnlyList cookies, IReadOnlyList sslCerts, IReadOnlyList services, IReadOnlyList ipBlocks, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList banners, IReadOnlyList scanMetadata, IReadOnlyList nsRecord, IReadOnlyList mxRecord, IReadOnlyList location, IReadOnlyList hosts, IReadOnlyList nxdomain, IReadOnlyList sslServerConfig, bool? ipv4, bool? ipv6) + { + IpAddress = ipAddress; + Asns = asns; + Reputations = reputations; + WebComponents = webComponents; + NetRanges = netRanges; + Headers = headers; + Attributes = attributes; + Cookies = cookies; + SslCerts = sslCerts; + Services = services; + IpBlocks = ipBlocks; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Banners = banners; + ScanMetadata = scanMetadata; + NsRecord = nsRecord; + MxRecord = mxRecord; + Location = location; + Hosts = hosts; + Nxdomain = nxdomain; + SslServerConfig = sslServerConfig; + Ipv4 = ipv4; + Ipv6 = ipv6; + } + + /// Gets the ip address. + public string IpAddress { get; } + /// Gets the asns. + public IReadOnlyList Asns { get; } + /// Gets the reputations. + public IReadOnlyList Reputations { get; } + /// Gets the web components. + public IReadOnlyList WebComponents { get; } + /// Gets the net ranges. + public IReadOnlyList NetRanges { get; } + /// Gets the headers. + public IReadOnlyList Headers { get; } + /// Gets the attributes. + public IReadOnlyList Attributes { get; } + /// Gets the cookies. + public IReadOnlyList Cookies { get; } + /// Gets the ssl certs. + public IReadOnlyList SslCerts { get; } + /// Gets the services. + public IReadOnlyList Services { get; } + /// Gets the ip blocks. + public IReadOnlyList IpBlocks { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the banners. + public IReadOnlyList Banners { get; } + /// Gets the scan metadata. + public IReadOnlyList ScanMetadata { get; } + /// Gets the ns record. + public IReadOnlyList NsRecord { get; } + /// Gets the mx record. + public IReadOnlyList MxRecord { get; } + /// Gets the location. + public IReadOnlyList Location { get; } + /// Gets the hosts. + public IReadOnlyList Hosts { get; } + /// Gets the nxdomain. + public IReadOnlyList Nxdomain { get; } + /// Gets the ssl server config. + public IReadOnlyList SslServerConfig { get; } + /// Gets the ipv 4. + public bool? Ipv4 { get; } + /// Gets the ipv 6. + public bool? Ipv6 { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.Serialization.cs new file mode 100644 index 000000000000..9fbca3335813 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class IpAddressAssetResource + { + internal static IpAddressAssetResource DeserializeIpAddressAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IpAddressAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = IpAddressAsset.DeserializeIpAddressAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new IpAddressAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new IpAddressAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpAddressAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.cs new file mode 100644 index 000000000000..a60c90095bfe --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpAddressAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The IpAddressAssetResource. + public partial class IpAddressAssetResource : AssetResource + { + /// Initializes a new instance of IpAddressAssetResource. + /// asset. + /// is null. + internal IpAddressAssetResource(IpAddressAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "ipAddress"; + Asset = asset; + } + + /// Initializes a new instance of IpAddressAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal IpAddressAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, IpAddressAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public IpAddressAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.Serialization.cs new file mode 100644 index 000000000000..c0cf54709157 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class IpBlock + { + internal static IpBlock DeserializeIpBlock(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional ipBlock = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipBlock"u8)) + { + ipBlock = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new IpBlock(ipBlock.Value, Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IpBlock FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpBlock(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.cs new file mode 100644 index 000000000000..ffbf5bbfeea2 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlock.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The IpBlock. + public partial class IpBlock + { + /// Initializes a new instance of IpBlock. + internal IpBlock() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of IpBlock. + /// + /// + /// + /// + /// + /// + internal IpBlock(string ipBlockProperty, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent) + { + IpBlockProperty = ipBlockProperty; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + } + + /// Gets the ip block property. + public string IpBlockProperty { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.Serialization.cs new file mode 100644 index 000000000000..3eb670417081 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.Serialization.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class IpBlockAsset + { + internal static IpBlockAsset DeserializeIpBlockAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional ipBlock = default; + Optional> asns = default; + Optional> bgpPrefixes = default; + Optional> netNames = default; + Optional> registrantContacts = default; + Optional> registrantOrgs = default; + Optional> adminContacts = default; + Optional> technicalContacts = default; + Optional> registrarCreatedAt = default; + Optional> registrarUpdatedAt = default; + Optional> netRanges = default; + Optional startIp = default; + Optional endIp = default; + Optional> reputations = default; + Optional detailedFromWhoisAt = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> location = default; + Optional> registrarExpiresAt = default; + Optional> registrantNames = default; + Optional> adminNames = default; + Optional> technicalNames = default; + Optional> adminOrgs = default; + Optional> technicalOrgs = default; + Optional> registrantPhones = default; + Optional> adminPhones = default; + Optional> technicalPhones = default; + Optional ipv4 = default; + Optional ipv6 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipBlock"u8)) + { + ipBlock = property.Value.GetString(); + continue; + } + if (property.NameEquals("asns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + asns = array; + continue; + } + if (property.NameEquals("bgpPrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + bgpPrefixes = array; + continue; + } + if (property.NameEquals("netNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + netNames = array; + continue; + } + if (property.NameEquals("registrantContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantContacts = array; + continue; + } + if (property.NameEquals("registrantOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantOrgs = array; + continue; + } + if (property.NameEquals("adminContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminContacts = array; + continue; + } + if (property.NameEquals("technicalContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalContacts = array; + continue; + } + if (property.NameEquals("registrarCreatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarCreatedAt = array; + continue; + } + if (property.NameEquals("registrarUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarUpdatedAt = array; + continue; + } + if (property.NameEquals("netRanges"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + netRanges = array; + continue; + } + if (property.NameEquals("startIp"u8)) + { + startIp = property.Value.GetString(); + continue; + } + if (property.NameEquals("endIp"u8)) + { + endIp = property.Value.GetString(); + continue; + } + if (property.NameEquals("reputations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Reputation.DeserializeReputation(item)); + } + reputations = array; + continue; + } + if (property.NameEquals("detailedFromWhoisAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detailedFromWhoisAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLocation.DeserializeObservedLocation(item)); + } + location = array; + continue; + } + if (property.NameEquals("registrarExpiresAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + registrarExpiresAt = array; + continue; + } + if (property.NameEquals("registrantNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantNames = array; + continue; + } + if (property.NameEquals("adminNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminNames = array; + continue; + } + if (property.NameEquals("technicalNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalNames = array; + continue; + } + if (property.NameEquals("adminOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminOrgs = array; + continue; + } + if (property.NameEquals("technicalOrgs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalOrgs = array; + continue; + } + if (property.NameEquals("registrantPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + registrantPhones = array; + continue; + } + if (property.NameEquals("adminPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + adminPhones = array; + continue; + } + if (property.NameEquals("technicalPhones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + technicalPhones = array; + continue; + } + if (property.NameEquals("ipv4"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv4 = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ipv6"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ipv6 = property.Value.GetBoolean(); + continue; + } + } + return new IpBlockAsset(ipBlock.Value, Optional.ToList(asns), Optional.ToList(bgpPrefixes), Optional.ToList(netNames), Optional.ToList(registrantContacts), Optional.ToList(registrantOrgs), Optional.ToList(adminContacts), Optional.ToList(technicalContacts), Optional.ToList(registrarCreatedAt), Optional.ToList(registrarUpdatedAt), Optional.ToList(netRanges), startIp.Value, endIp.Value, Optional.ToList(reputations), Optional.ToNullable(detailedFromWhoisAt), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(location), Optional.ToList(registrarExpiresAt), Optional.ToList(registrantNames), Optional.ToList(adminNames), Optional.ToList(technicalNames), Optional.ToList(adminOrgs), Optional.ToList(technicalOrgs), Optional.ToList(registrantPhones), Optional.ToList(adminPhones), Optional.ToList(technicalPhones), Optional.ToNullable(ipv4), Optional.ToNullable(ipv6)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static IpBlockAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpBlockAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.cs new file mode 100644 index 000000000000..e3a3ecf74132 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAsset.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The IpBlockAsset. + public partial class IpBlockAsset : InventoryAsset + { + /// Initializes a new instance of IpBlockAsset. + internal IpBlockAsset() + { + Asns = new ChangeTrackingList(); + BgpPrefixes = new ChangeTrackingList(); + NetNames = new ChangeTrackingList(); + RegistrantContacts = new ChangeTrackingList(); + RegistrantOrgs = new ChangeTrackingList(); + AdminContacts = new ChangeTrackingList(); + TechnicalContacts = new ChangeTrackingList(); + RegistrarCreatedAt = new ChangeTrackingList(); + RegistrarUpdatedAt = new ChangeTrackingList(); + NetRanges = new ChangeTrackingList(); + Reputations = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + Location = new ChangeTrackingList(); + RegistrarExpiresAt = new ChangeTrackingList(); + RegistrantNames = new ChangeTrackingList(); + AdminNames = new ChangeTrackingList(); + TechnicalNames = new ChangeTrackingList(); + AdminOrgs = new ChangeTrackingList(); + TechnicalOrgs = new ChangeTrackingList(); + RegistrantPhones = new ChangeTrackingList(); + AdminPhones = new ChangeTrackingList(); + TechnicalPhones = new ChangeTrackingList(); + } + + /// Initializes a new instance of IpBlockAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal IpBlockAsset(string ipBlock, IReadOnlyList asns, IReadOnlyList bgpPrefixes, IReadOnlyList netNames, IReadOnlyList registrantContacts, IReadOnlyList registrantOrgs, IReadOnlyList adminContacts, IReadOnlyList technicalContacts, IReadOnlyList registrarCreatedAt, IReadOnlyList registrarUpdatedAt, IReadOnlyList netRanges, string startIp, string endIp, IReadOnlyList reputations, DateTimeOffset? detailedFromWhoisAt, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList location, IReadOnlyList registrarExpiresAt, IReadOnlyList registrantNames, IReadOnlyList adminNames, IReadOnlyList technicalNames, IReadOnlyList adminOrgs, IReadOnlyList technicalOrgs, IReadOnlyList registrantPhones, IReadOnlyList adminPhones, IReadOnlyList technicalPhones, bool? ipv4, bool? ipv6) + { + IpBlock = ipBlock; + Asns = asns; + BgpPrefixes = bgpPrefixes; + NetNames = netNames; + RegistrantContacts = registrantContacts; + RegistrantOrgs = registrantOrgs; + AdminContacts = adminContacts; + TechnicalContacts = technicalContacts; + RegistrarCreatedAt = registrarCreatedAt; + RegistrarUpdatedAt = registrarUpdatedAt; + NetRanges = netRanges; + StartIp = startIp; + EndIp = endIp; + Reputations = reputations; + DetailedFromWhoisAt = detailedFromWhoisAt; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Location = location; + RegistrarExpiresAt = registrarExpiresAt; + RegistrantNames = registrantNames; + AdminNames = adminNames; + TechnicalNames = technicalNames; + AdminOrgs = adminOrgs; + TechnicalOrgs = technicalOrgs; + RegistrantPhones = registrantPhones; + AdminPhones = adminPhones; + TechnicalPhones = technicalPhones; + Ipv4 = ipv4; + Ipv6 = ipv6; + } + + /// Gets the ip block. + public string IpBlock { get; } + /// Gets the asns. + public IReadOnlyList Asns { get; } + /// Gets the bgp prefixes. + public IReadOnlyList BgpPrefixes { get; } + /// Gets the net names. + public IReadOnlyList NetNames { get; } + /// Gets the registrant contacts. + public IReadOnlyList RegistrantContacts { get; } + /// Gets the registrant orgs. + public IReadOnlyList RegistrantOrgs { get; } + /// Gets the admin contacts. + public IReadOnlyList AdminContacts { get; } + /// Gets the technical contacts. + public IReadOnlyList TechnicalContacts { get; } + /// Gets the registrar created at. + public IReadOnlyList RegistrarCreatedAt { get; } + /// Gets the registrar updated at. + public IReadOnlyList RegistrarUpdatedAt { get; } + /// Gets the net ranges. + public IReadOnlyList NetRanges { get; } + /// Gets the start ip. + public string StartIp { get; } + /// Gets the end ip. + public string EndIp { get; } + /// Gets the reputations. + public IReadOnlyList Reputations { get; } + /// Gets the detailed from whois at. + public DateTimeOffset? DetailedFromWhoisAt { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the location. + public IReadOnlyList Location { get; } + /// Gets the registrar expires at. + public IReadOnlyList RegistrarExpiresAt { get; } + /// Gets the registrant names. + public IReadOnlyList RegistrantNames { get; } + /// Gets the admin names. + public IReadOnlyList AdminNames { get; } + /// Gets the technical names. + public IReadOnlyList TechnicalNames { get; } + /// Gets the admin orgs. + public IReadOnlyList AdminOrgs { get; } + /// Gets the technical orgs. + public IReadOnlyList TechnicalOrgs { get; } + /// Gets the registrant phones. + public IReadOnlyList RegistrantPhones { get; } + /// Gets the admin phones. + public IReadOnlyList AdminPhones { get; } + /// Gets the technical phones. + public IReadOnlyList TechnicalPhones { get; } + /// Gets the ipv 4. + public bool? Ipv4 { get; } + /// Gets the ipv 6. + public bool? Ipv6 { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.Serialization.cs new file mode 100644 index 000000000000..03c998f889e5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class IpBlockAssetResource + { + internal static IpBlockAssetResource DeserializeIpBlockAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IpBlockAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = IpBlockAsset.DeserializeIpBlockAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new IpBlockAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new IpBlockAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeIpBlockAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.cs new file mode 100644 index 000000000000..342c54fe395c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/IpBlockAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The IpBlockAssetResource. + public partial class IpBlockAssetResource : AssetResource + { + /// Initializes a new instance of IpBlockAssetResource. + /// asset. + /// is null. + internal IpBlockAssetResource(IpBlockAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "ipBlock"; + Asset = asset; + } + + /// Initializes a new instance of IpBlockAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal IpBlockAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, IpBlockAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public IpBlockAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.Serialization.cs new file mode 100644 index 000000000000..669e4ee01521 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Location + { + internal static Location DeserializeLocation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional countryCode = default; + Optional countryName = default; + Optional region = default; + Optional regionName = default; + Optional city = default; + Optional areaCode = default; + Optional postalCode = default; + Optional latitude = default; + Optional longitude = default; + Optional dmaCode = default; + Optional metroCodeId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("countryCode"u8)) + { + countryCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("countryName"u8)) + { + countryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (property.NameEquals("regionName"u8)) + { + regionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("areaCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + areaCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("postalCode"u8)) + { + postalCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("latitude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latitude = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("longitude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longitude = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("dmaCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dmaCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("metroCodeId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metroCodeId = property.Value.GetInt32(); + continue; + } + } + return new Location(countryCode.Value, countryName.Value, region.Value, regionName.Value, city.Value, Optional.ToNullable(areaCode), postalCode.Value, Optional.ToNullable(latitude), Optional.ToNullable(longitude), Optional.ToNullable(dmaCode), Optional.ToNullable(metroCodeId)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Location FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLocation(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.cs new file mode 100644 index 000000000000..3ad5269cf624 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Location.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The Location. + public partial class Location + { + /// Initializes a new instance of Location. + internal Location() + { + } + + /// Initializes a new instance of Location. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal Location(string countryCode, string countryName, string region, string regionName, string city, int? areaCode, string postalCode, float? latitude, float? longitude, int? dmaCode, int? metroCodeId) + { + CountryCode = countryCode; + CountryName = countryName; + Region = region; + RegionName = regionName; + City = city; + AreaCode = areaCode; + PostalCode = postalCode; + Latitude = latitude; + Longitude = longitude; + DmaCode = dmaCode; + MetroCodeId = metroCodeId; + } + + /// Gets the country code. + public string CountryCode { get; } + /// Gets the country name. + public string CountryName { get; } + /// Gets the region. + public string Region { get; } + /// Gets the region name. + public string RegionName { get; } + /// Gets the city. + public string City { get; } + /// Gets the area code. + public int? AreaCode { get; } + /// Gets the postal code. + public string PostalCode { get; } + /// Gets the latitude. + public float? Latitude { get; } + /// Gets the longitude. + public float? Longitude { get; } + /// Gets the dma code. + public int? DmaCode { get; } + /// Gets the metro code id. + public int? MetroCodeId { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.Serialization.cs new file mode 100644 index 000000000000..5de12347db3f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class LogAnalyticsDataConnection + { + internal static LogAnalyticsDataConnection DeserializeLogAnalyticsDataConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LogAnalyticsDataConnectionProperties properties = default; + string kind = default; + Optional id = default; + string name = default; + Optional displayName = default; + Optional content = default; + Optional createdDate = default; + Optional frequency = default; + Optional frequencyOffset = default; + Optional updatedDate = default; + Optional userUpdatedAt = default; + Optional active = default; + Optional inactiveMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = LogAnalyticsDataConnectionProperties.DeserializeLogAnalyticsDataConnectionProperties(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = new DataConnectionContent(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequency = new DataConnectionFrequency(property.Value.GetString()); + continue; + } + if (property.NameEquals("frequencyOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userUpdatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("active"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + active = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("inactiveMessage"u8)) + { + inactiveMessage = property.Value.GetString(); + continue; + } + } + return new LogAnalyticsDataConnection(kind, id.Value, name, displayName.Value, Optional.ToNullable(content), Optional.ToNullable(createdDate), Optional.ToNullable(frequency), Optional.ToNullable(frequencyOffset), Optional.ToNullable(updatedDate), Optional.ToNullable(userUpdatedAt), Optional.ToNullable(active), inactiveMessage.Value, properties); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new LogAnalyticsDataConnection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLogAnalyticsDataConnection(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs new file mode 100644 index 000000000000..6ca3b9b7c793 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnection.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The LogAnalyticsDataConnection. + public partial class LogAnalyticsDataConnection : DataConnection + { + /// Initializes a new instance of LogAnalyticsDataConnection. + /// properties. + /// is null. + internal LogAnalyticsDataConnection(LogAnalyticsDataConnectionProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Kind = "logAnalytics"; + Properties = properties; + } + + /// Initializes a new instance of LogAnalyticsDataConnection. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + /// properties. + internal LogAnalyticsDataConnection(string kind, string id, string name, string displayName, DataConnectionContent? content, DateTimeOffset? createdDate, DataConnectionFrequency? frequency, int? frequencyOffset, DateTimeOffset? updatedDate, DateTimeOffset? userUpdatedAt, bool? active, string inactiveMessage, LogAnalyticsDataConnectionProperties properties) : base(kind, id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage) + { + Properties = properties; + } + + /// properties. + public LogAnalyticsDataConnectionProperties Properties { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.Serialization.cs new file mode 100644 index 000000000000..9ed1b6c7d6a6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class LogAnalyticsDataConnectionData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties); + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content.Value.ToString()); + } + if (Optional.IsDefined(Frequency)) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.Value.ToString()); + } + if (Optional.IsDefined(FrequencyOffset)) + { + writer.WritePropertyName("frequencyOffset"u8); + writer.WriteNumberValue(FrequencyOffset.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.cs new file mode 100644 index 000000000000..4605872914e7 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionData.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The LogAnalyticsDataConnectionData. + public partial class LogAnalyticsDataConnectionData : DataConnectionData + { + /// Initializes a new instance of LogAnalyticsDataConnectionData. + /// properties. + /// is null. + public LogAnalyticsDataConnectionData(LogAnalyticsDataConnectionProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Kind = "logAnalytics"; + Properties = properties; + } + + /// Initializes a new instance of LogAnalyticsDataConnectionData. + /// Discriminator. + /// The name of data connection. + /// The type of data the data connection will transfer. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. (1-7 for weekly, 1-31 for monthly). + /// properties. + internal LogAnalyticsDataConnectionData(string kind, string name, DataConnectionContent? content, DataConnectionFrequency? frequency, int? frequencyOffset, LogAnalyticsDataConnectionProperties properties) : base(kind, name, content, frequency, frequencyOffset) + { + Properties = properties; + } + + /// properties. + public LogAnalyticsDataConnectionProperties Properties { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..076b837da647 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.Serialization.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class LogAnalyticsDataConnectionProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ApiKey)) + { + writer.WritePropertyName("apiKey"u8); + writer.WriteStringValue(ApiKey); + } + if (Optional.IsDefined(WorkspaceId)) + { + writer.WritePropertyName("workspaceId"u8); + writer.WriteStringValue(WorkspaceId); + } + writer.WriteEndObject(); + } + + internal static LogAnalyticsDataConnectionProperties DeserializeLogAnalyticsDataConnectionProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional apiKey = default; + Optional workspaceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apiKey"u8)) + { + apiKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("workspaceId"u8)) + { + workspaceId = property.Value.GetString(); + continue; + } + } + return new LogAnalyticsDataConnectionProperties(apiKey.Value, workspaceId.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static LogAnalyticsDataConnectionProperties FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeLogAnalyticsDataConnectionProperties(document.RootElement); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.cs new file mode 100644 index 000000000000..7a929ec7c081 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/LogAnalyticsDataConnectionProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The LogAnalyticsDataConnectionProperties. + public partial class LogAnalyticsDataConnectionProperties : DataConnectionProperties + { + /// Initializes a new instance of LogAnalyticsDataConnectionProperties. + public LogAnalyticsDataConnectionProperties() + { + } + + /// Initializes a new instance of LogAnalyticsDataConnectionProperties. + /// log analytics api key. + /// log analytics workspace id. + internal LogAnalyticsDataConnectionProperties(string apiKey, string workspaceId) + { + ApiKey = apiKey; + WorkspaceId = workspaceId; + } + + /// log analytics api key. + public string ApiKey { get; set; } + /// log analytics workspace id. + public string WorkspaceId { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.Serialization.cs new file mode 100644 index 000000000000..4c06bb96bd17 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedBoolean + { + internal static ObservedBoolean DeserializeObservedBoolean(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedBoolean(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToNullable(value), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedBoolean FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedBoolean(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.cs new file mode 100644 index 000000000000..3a6fa17690d1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedBoolean.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedBoolean. + public partial class ObservedBoolean : ObservedValue + { + /// Initializes a new instance of ObservedBoolean. + internal ObservedBoolean() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedBoolean. + /// + /// + /// + /// + /// + /// + internal ObservedBoolean(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, bool? value, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Sources = sources; + } + + /// Gets the value. + public bool? Value { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.Serialization.cs new file mode 100644 index 000000000000..7d534a921815 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.Serialization.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedHeader + { + internal static ObservedHeader DeserializeObservedHeader(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional headerName = default; + Optional headerValue = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("headerName"u8)) + { + headerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("headerValue"u8)) + { + headerValue = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedHeader(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), headerName.Value, headerValue.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedHeader FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedHeader(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.cs new file mode 100644 index 000000000000..816199eec0e0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedHeader.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedHeader. + public partial class ObservedHeader : ObservedValue + { + /// Initializes a new instance of ObservedHeader. + internal ObservedHeader() + { + } + + /// Initializes a new instance of ObservedHeader. + /// + /// + /// + /// + /// + /// + internal ObservedHeader(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, string headerName, string headerValue) : base(firstSeen, lastSeen, count, recent) + { + HeaderName = headerName; + HeaderValue = headerValue; + } + + /// Gets the header name. + public string HeaderName { get; } + /// Gets the header value. + public string HeaderValue { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.Serialization.cs new file mode 100644 index 000000000000..033954f8ebeb --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedInteger + { + internal static ObservedInteger DeserializeObservedInteger(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedInteger(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToNullable(value), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedInteger FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedInteger(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.cs new file mode 100644 index 000000000000..6c10253e705d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedInteger.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedInteger. + public partial class ObservedInteger : ObservedValue + { + /// Initializes a new instance of ObservedInteger. + internal ObservedInteger() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedInteger. + /// + /// + /// + /// + /// + /// + internal ObservedInteger(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, int? value, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Sources = sources; + } + + /// Gets the value. + public int? Value { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.Serialization.cs new file mode 100644 index 000000000000..fec97b2ec237 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.Serialization.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedIntegers + { + internal static ObservedIntegers DeserializeObservedIntegers(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> values = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("values"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + values = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedIntegers(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToList(values), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedIntegers FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedIntegers(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.cs new file mode 100644 index 000000000000..4e2808c12c8c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedIntegers.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedIntegers. + public partial class ObservedIntegers : ObservedValue + { + /// Initializes a new instance of ObservedIntegers. + internal ObservedIntegers() + { + Values = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedIntegers. + /// + /// + /// + /// + /// + /// + internal ObservedIntegers(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, IReadOnlyList values, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Values = values; + Sources = sources; + } + + /// Gets the values. + public IReadOnlyList Values { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.Serialization.cs new file mode 100644 index 000000000000..9af44afe4964 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedLocation + { + internal static ObservedLocation DeserializeObservedLocation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = Location.DeserializeLocation(property.Value); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedLocation(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), value.Value, Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedLocation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedLocation(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.cs new file mode 100644 index 000000000000..f3edd71037a3 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLocation.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedLocation. + public partial class ObservedLocation : ObservedValue + { + /// Initializes a new instance of ObservedLocation. + internal ObservedLocation() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedLocation. + /// + /// + /// + /// + /// + /// + internal ObservedLocation(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, Location value, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Sources = sources; + } + + /// Gets the value. + public Location Value { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.Serialization.cs new file mode 100644 index 000000000000..556d106d1457 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedLong + { + internal static ObservedLong DeserializeObservedLong(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedLong(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToNullable(value), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedLong FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedLong(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.cs new file mode 100644 index 000000000000..017dd0621f0f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedLong.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedLong. + public partial class ObservedLong : ObservedValue + { + /// Initializes a new instance of ObservedLong. + internal ObservedLong() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedLong. + /// + /// + /// + /// + /// + /// + internal ObservedLong(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, long? value, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Sources = sources; + } + + /// Gets the value. + public long? Value { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.Serialization.cs new file mode 100644 index 000000000000..401fbf405129 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.Serialization.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedPortState + { + internal static ObservedPortState DeserializeObservedPortState(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional port = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = new ObservedPortStateValue(property.Value.GetString()); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedPortState(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToNullable(value), Optional.ToNullable(port)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedPortState FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedPortState(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.cs new file mode 100644 index 000000000000..b9d5598231c0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortState.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedPortState. + public partial class ObservedPortState : ObservedValue + { + /// Initializes a new instance of ObservedPortState. + internal ObservedPortState() + { + } + + /// Initializes a new instance of ObservedPortState. + /// + /// + /// + /// + /// + /// + internal ObservedPortState(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, ObservedPortStateValue? value, int? port) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Port = port; + } + + /// Gets the value. + public ObservedPortStateValue? Value { get; } + /// Gets the port. + public int? Port { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortStateValue.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortStateValue.cs new file mode 100644 index 000000000000..d5c27f9db5aa --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedPortStateValue.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + public readonly partial struct ObservedPortStateValue : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ObservedPortStateValue(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OpenValue = "open"; + private const string ClosedValue = "closed"; + private const string FilteredValue = "filtered"; + + /// open. + public static ObservedPortStateValue Open { get; } = new ObservedPortStateValue(OpenValue); + /// closed. + public static ObservedPortStateValue Closed { get; } = new ObservedPortStateValue(ClosedValue); + /// filtered. + public static ObservedPortStateValue Filtered { get; } = new ObservedPortStateValue(FilteredValue); + /// Determines if two values are the same. + public static bool operator ==(ObservedPortStateValue left, ObservedPortStateValue right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ObservedPortStateValue left, ObservedPortStateValue right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ObservedPortStateValue(string value) => new ObservedPortStateValue(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ObservedPortStateValue other && Equals(other); + /// + public bool Equals(ObservedPortStateValue other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.Serialization.cs new file mode 100644 index 000000000000..412f00a33f4d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ObservedString + { + internal static ObservedString DeserializeObservedString(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ObservedString(Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), value.Value, Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ObservedString FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeObservedString(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.cs new file mode 100644 index 000000000000..002a005b4408 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedString.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ObservedString. + public partial class ObservedString : ObservedValue + { + /// Initializes a new instance of ObservedString. + internal ObservedString() + { + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ObservedString. + /// + /// + /// + /// + /// + /// + internal ObservedString(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, string value, IReadOnlyList sources) : base(firstSeen, lastSeen, count, recent) + { + Value = value; + Sources = sources; + } + + /// Gets the value. + public string Value { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedValue.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedValue.cs new file mode 100644 index 000000000000..3cc824df48f7 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ObservedValue.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// Template model for observed values. + public partial class ObservedValue + { + /// Initializes a new instance of ObservedValue. + internal ObservedValue() + { + } + + /// Initializes a new instance of ObservedValue. + /// + /// + /// + /// + internal ObservedValue(DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent) + { + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + } + + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.Serialization.cs new file mode 100644 index 000000000000..a27d95431b9a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.Serialization.cs @@ -0,0 +1,854 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class PageAsset + { + internal static PageAsset DeserializePageAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional url = default; + Optional httpMethod = default; + Optional service = default; + Optional> ipAddresses = default; + Optional> successful = default; + Optional> httpResponseCodes = default; + Optional> httpResponseMessages = default; + Optional> responseTimes = default; + Optional> frames = default; + Optional> windows = default; + Optional> nonHtmlFrames = default; + Optional> undirectedContent = default; + Optional> contentTypes = default; + Optional> contentLengths = default; + Optional> windowNames = default; + Optional> charsets = default; + Optional> titles = default; + Optional> languages = default; + Optional> responseHeaders = default; + Optional> cookies = default; + Optional> webComponents = default; + Optional> attributes = default; + Optional> assetSecurityPolicies = default; + Optional> responseBodyMinhashSignatures = default; + Optional> fullDomMinhashSignatures = default; + Optional> responseBodyHashSignatures = default; + Optional> errors = default; + Optional> sslCerts = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional cause = default; + Optional referrer = default; + Optional> redirectUrls = default; + Optional redirectType = default; + Optional> finalUrls = default; + Optional> finalResponseCodes = default; + Optional> parkedPage = default; + Optional> resourceUrls = default; + Optional> guids = default; + Optional> finalIpAddresses = default; + Optional> asns = default; + Optional> ipBlocks = default; + Optional> finalAsns = default; + Optional> finalIpBlocks = default; + Optional> responseBodies = default; + Optional domainAsset = default; + Optional rootUrl = default; + Optional isRootUrl = default; + Optional> location = default; + Optional> services = default; + Optional siteStatus = default; + Optional> cnames = default; + Optional> cdns = default; + Optional host = default; + Optional domain = default; + Optional> sslServerConfig = default; + Optional> gdprAssetSecurityPolicies = default; + Optional> ipv4 = default; + Optional> ipv6 = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("httpMethod"u8)) + { + httpMethod = property.Value.GetString(); + continue; + } + if (property.NameEquals("service"u8)) + { + service = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + ipAddresses = array; + continue; + } + if (property.NameEquals("successful"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + successful = array; + continue; + } + if (property.NameEquals("httpResponseCodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedInteger.DeserializeObservedInteger(item)); + } + httpResponseCodes = array; + continue; + } + if (property.NameEquals("httpResponseMessages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + httpResponseMessages = array; + continue; + } + if (property.NameEquals("responseTimes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + responseTimes = array; + continue; + } + if (property.NameEquals("frames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + frames = array; + continue; + } + if (property.NameEquals("windows"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + windows = array; + continue; + } + if (property.NameEquals("nonHtmlFrames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + nonHtmlFrames = array; + continue; + } + if (property.NameEquals("undirectedContent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + undirectedContent = array; + continue; + } + if (property.NameEquals("contentTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + contentTypes = array; + continue; + } + if (property.NameEquals("contentLengths"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + contentLengths = array; + continue; + } + if (property.NameEquals("windowNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + windowNames = array; + continue; + } + if (property.NameEquals("charsets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + charsets = array; + continue; + } + if (property.NameEquals("titles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + titles = array; + continue; + } + if (property.NameEquals("languages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + languages = array; + continue; + } + if (property.NameEquals("responseHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedHeader.DeserializeObservedHeader(item)); + } + responseHeaders = array; + continue; + } + if (property.NameEquals("cookies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Cookie.DeserializeCookie(item)); + } + cookies = array; + continue; + } + if (property.NameEquals("webComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebComponent.DeserializeWebComponent(item)); + } + webComponents = array; + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Attribute.DeserializeAttribute(item)); + } + attributes = array; + continue; + } + if (property.NameEquals("assetSecurityPolicies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetSecurityPolicy.DeserializeAssetSecurityPolicy(item)); + } + assetSecurityPolicies = array; + continue; + } + if (property.NameEquals("responseBodyMinhashSignatures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedIntegers.DeserializeObservedIntegers(item)); + } + responseBodyMinhashSignatures = array; + continue; + } + if (property.NameEquals("fullDomMinhashSignatures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedIntegers.DeserializeObservedIntegers(item)); + } + fullDomMinhashSignatures = array; + continue; + } + if (property.NameEquals("responseBodyHashSignatures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + responseBodyHashSignatures = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + errors = array; + continue; + } + if (property.NameEquals("sslCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SslCertAsset.DeserializeSslCertAsset(item)); + } + sslCerts = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("cause"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cause = PageCause.DeserializePageCause(property.Value); + continue; + } + if (property.NameEquals("referrer"u8)) + { + referrer = property.Value.GetString(); + continue; + } + if (property.NameEquals("redirectUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + redirectUrls = array; + continue; + } + if (property.NameEquals("redirectType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + redirectType = new PageAssetRedirectType(property.Value.GetString()); + continue; + } + if (property.NameEquals("finalUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + finalUrls = array; + continue; + } + if (property.NameEquals("finalResponseCodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedInteger.DeserializeObservedInteger(item)); + } + finalResponseCodes = array; + continue; + } + if (property.NameEquals("parkedPage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + parkedPage = array; + continue; + } + if (property.NameEquals("resourceUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceUrl.DeserializeResourceUrl(item)); + } + resourceUrls = array; + continue; + } + if (property.NameEquals("guids"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GuidPair.DeserializeGuidPair(item)); + } + guids = array; + continue; + } + if (property.NameEquals("finalIpAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + finalIpAddresses = array; + continue; + } + if (property.NameEquals("asns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + asns = array; + continue; + } + if (property.NameEquals("ipBlocks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpBlock.DeserializeIpBlock(item)); + } + ipBlocks = array; + continue; + } + if (property.NameEquals("finalAsns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLong.DeserializeObservedLong(item)); + } + finalAsns = array; + continue; + } + if (property.NameEquals("finalIpBlocks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IpBlock.DeserializeIpBlock(item)); + } + finalIpBlocks = array; + continue; + } + if (property.NameEquals("responseBodies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + responseBodies = array; + continue; + } + if (property.NameEquals("domainAsset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainAsset = DomainAsset.DeserializeDomainAsset(property.Value); + continue; + } + if (property.NameEquals("rootUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rootUrl = ObservedBoolean.DeserializeObservedBoolean(property.Value); + continue; + } + if (property.NameEquals("isRootUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRootUrl = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedLocation.DeserializeObservedLocation(item)); + } + location = array; + continue; + } + if (property.NameEquals("services"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.Service.DeserializeService(item)); + } + services = array; + continue; + } + if (property.NameEquals("siteStatus"u8)) + { + siteStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("cnames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + cnames = array; + continue; + } + if (property.NameEquals("cdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + cdns = array; + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("sslServerConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.SslServerConfig.DeserializeSslServerConfig(item)); + } + sslServerConfig = array; + continue; + } + if (property.NameEquals("gdprAssetSecurityPolicies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetSecurityPolicy.DeserializeAssetSecurityPolicy(item)); + } + gdprAssetSecurityPolicies = array; + continue; + } + if (property.NameEquals("ipv4"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + ipv4 = array; + continue; + } + if (property.NameEquals("ipv6"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedBoolean.DeserializeObservedBoolean(item)); + } + ipv6 = array; + continue; + } + } + return new PageAsset(url.Value, httpMethod.Value, service.Value, Optional.ToList(ipAddresses), Optional.ToList(successful), Optional.ToList(httpResponseCodes), Optional.ToList(httpResponseMessages), Optional.ToList(responseTimes), Optional.ToList(frames), Optional.ToList(windows), Optional.ToList(nonHtmlFrames), Optional.ToList(undirectedContent), Optional.ToList(contentTypes), Optional.ToList(contentLengths), Optional.ToList(windowNames), Optional.ToList(charsets), Optional.ToList(titles), Optional.ToList(languages), Optional.ToList(responseHeaders), Optional.ToList(cookies), Optional.ToList(webComponents), Optional.ToList(attributes), Optional.ToList(assetSecurityPolicies), Optional.ToList(responseBodyMinhashSignatures), Optional.ToList(fullDomMinhashSignatures), Optional.ToList(responseBodyHashSignatures), Optional.ToList(errors), Optional.ToList(sslCerts), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), cause.Value, referrer.Value, Optional.ToList(redirectUrls), Optional.ToNullable(redirectType), Optional.ToList(finalUrls), Optional.ToList(finalResponseCodes), Optional.ToList(parkedPage), Optional.ToList(resourceUrls), Optional.ToList(guids), Optional.ToList(finalIpAddresses), Optional.ToList(asns), Optional.ToList(ipBlocks), Optional.ToList(finalAsns), Optional.ToList(finalIpBlocks), Optional.ToList(responseBodies), domainAsset.Value, rootUrl.Value, Optional.ToNullable(isRootUrl), Optional.ToList(location), Optional.ToList(services), siteStatus.Value, Optional.ToList(cnames), Optional.ToList(cdns), host.Value, domain.Value, Optional.ToList(sslServerConfig), Optional.ToList(gdprAssetSecurityPolicies), Optional.ToList(ipv4), Optional.ToList(ipv6)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PageAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePageAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.cs new file mode 100644 index 000000000000..24cf6451ec77 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAsset.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The PageAsset. + public partial class PageAsset : InventoryAsset + { + /// Initializes a new instance of PageAsset. + internal PageAsset() + { + IpAddresses = new ChangeTrackingList(); + Successful = new ChangeTrackingList(); + HttpResponseCodes = new ChangeTrackingList(); + HttpResponseMessages = new ChangeTrackingList(); + ResponseTimes = new ChangeTrackingList(); + Frames = new ChangeTrackingList(); + Windows = new ChangeTrackingList(); + NonHtmlFrames = new ChangeTrackingList(); + UndirectedContent = new ChangeTrackingList(); + ContentTypes = new ChangeTrackingList(); + ContentLengths = new ChangeTrackingList(); + WindowNames = new ChangeTrackingList(); + Charsets = new ChangeTrackingList(); + Titles = new ChangeTrackingList(); + Languages = new ChangeTrackingList(); + ResponseHeaders = new ChangeTrackingList(); + Cookies = new ChangeTrackingList(); + WebComponents = new ChangeTrackingList(); + Attributes = new ChangeTrackingList(); + AssetSecurityPolicies = new ChangeTrackingList(); + ResponseBodyMinhashSignatures = new ChangeTrackingList(); + FullDomMinhashSignatures = new ChangeTrackingList(); + ResponseBodyHashSignatures = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + SslCerts = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + RedirectUrls = new ChangeTrackingList(); + FinalUrls = new ChangeTrackingList(); + FinalResponseCodes = new ChangeTrackingList(); + ParkedPage = new ChangeTrackingList(); + ResourceUrls = new ChangeTrackingList(); + Guids = new ChangeTrackingList(); + FinalIpAddresses = new ChangeTrackingList(); + Asns = new ChangeTrackingList(); + IpBlocks = new ChangeTrackingList(); + FinalAsns = new ChangeTrackingList(); + FinalIpBlocks = new ChangeTrackingList(); + ResponseBodies = new ChangeTrackingList(); + Location = new ChangeTrackingList(); + Services = new ChangeTrackingList(); + Cnames = new ChangeTrackingList(); + Cdns = new ChangeTrackingList(); + SslServerConfig = new ChangeTrackingList(); + GdprAssetSecurityPolicies = new ChangeTrackingList(); + Ipv4 = new ChangeTrackingList(); + Ipv6 = new ChangeTrackingList(); + } + + /// Initializes a new instance of PageAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal PageAsset(Uri url, string httpMethod, string service, IReadOnlyList ipAddresses, IReadOnlyList successful, IReadOnlyList httpResponseCodes, IReadOnlyList httpResponseMessages, IReadOnlyList responseTimes, IReadOnlyList frames, IReadOnlyList windows, IReadOnlyList nonHtmlFrames, IReadOnlyList undirectedContent, IReadOnlyList contentTypes, IReadOnlyList contentLengths, IReadOnlyList windowNames, IReadOnlyList charsets, IReadOnlyList titles, IReadOnlyList languages, IReadOnlyList responseHeaders, IReadOnlyList cookies, IReadOnlyList webComponents, IReadOnlyList attributes, IReadOnlyList assetSecurityPolicies, IReadOnlyList responseBodyMinhashSignatures, IReadOnlyList fullDomMinhashSignatures, IReadOnlyList responseBodyHashSignatures, IReadOnlyList errors, IReadOnlyList sslCerts, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, PageCause cause, string referrer, IReadOnlyList redirectUrls, PageAssetRedirectType? redirectType, IReadOnlyList finalUrls, IReadOnlyList finalResponseCodes, IReadOnlyList parkedPage, IReadOnlyList resourceUrls, IReadOnlyList guids, IReadOnlyList finalIpAddresses, IReadOnlyList asns, IReadOnlyList ipBlocks, IReadOnlyList finalAsns, IReadOnlyList finalIpBlocks, IReadOnlyList responseBodies, DomainAsset domainAsset, ObservedBoolean rootUrl, bool? isRootUrl, IReadOnlyList location, IReadOnlyList services, string siteStatus, IReadOnlyList cnames, IReadOnlyList cdns, string host, string domain, IReadOnlyList sslServerConfig, IReadOnlyList gdprAssetSecurityPolicies, IReadOnlyList ipv4, IReadOnlyList ipv6) + { + Url = url; + HttpMethod = httpMethod; + Service = service; + IpAddresses = ipAddresses; + Successful = successful; + HttpResponseCodes = httpResponseCodes; + HttpResponseMessages = httpResponseMessages; + ResponseTimes = responseTimes; + Frames = frames; + Windows = windows; + NonHtmlFrames = nonHtmlFrames; + UndirectedContent = undirectedContent; + ContentTypes = contentTypes; + ContentLengths = contentLengths; + WindowNames = windowNames; + Charsets = charsets; + Titles = titles; + Languages = languages; + ResponseHeaders = responseHeaders; + Cookies = cookies; + WebComponents = webComponents; + Attributes = attributes; + AssetSecurityPolicies = assetSecurityPolicies; + ResponseBodyMinhashSignatures = responseBodyMinhashSignatures; + FullDomMinhashSignatures = fullDomMinhashSignatures; + ResponseBodyHashSignatures = responseBodyHashSignatures; + Errors = errors; + SslCerts = sslCerts; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Cause = cause; + Referrer = referrer; + RedirectUrls = redirectUrls; + RedirectType = redirectType; + FinalUrls = finalUrls; + FinalResponseCodes = finalResponseCodes; + ParkedPage = parkedPage; + ResourceUrls = resourceUrls; + Guids = guids; + FinalIpAddresses = finalIpAddresses; + Asns = asns; + IpBlocks = ipBlocks; + FinalAsns = finalAsns; + FinalIpBlocks = finalIpBlocks; + ResponseBodies = responseBodies; + DomainAsset = domainAsset; + RootUrl = rootUrl; + IsRootUrl = isRootUrl; + Location = location; + Services = services; + SiteStatus = siteStatus; + Cnames = cnames; + Cdns = cdns; + Host = host; + Domain = domain; + SslServerConfig = sslServerConfig; + GdprAssetSecurityPolicies = gdprAssetSecurityPolicies; + Ipv4 = ipv4; + Ipv6 = ipv6; + } + + /// Gets the url. + public Uri Url { get; } + /// Gets the http method. + public string HttpMethod { get; } + /// Gets the service. + public string Service { get; } + /// Gets the ip addresses. + public IReadOnlyList IpAddresses { get; } + /// Gets the successful. + public IReadOnlyList Successful { get; } + /// Gets the http response codes. + public IReadOnlyList HttpResponseCodes { get; } + /// Gets the http response messages. + public IReadOnlyList HttpResponseMessages { get; } + /// Gets the response times. + public IReadOnlyList ResponseTimes { get; } + /// Gets the frames. + public IReadOnlyList Frames { get; } + /// Gets the windows. + public IReadOnlyList Windows { get; } + /// Gets the non html frames. + public IReadOnlyList NonHtmlFrames { get; } + /// Gets the undirected content. + public IReadOnlyList UndirectedContent { get; } + /// Gets the content types. + public IReadOnlyList ContentTypes { get; } + /// Gets the content lengths. + public IReadOnlyList ContentLengths { get; } + /// Gets the window names. + public IReadOnlyList WindowNames { get; } + /// Gets the charsets. + public IReadOnlyList Charsets { get; } + /// Gets the titles. + public IReadOnlyList Titles { get; } + /// Gets the languages. + public IReadOnlyList Languages { get; } + /// Gets the response headers. + public IReadOnlyList ResponseHeaders { get; } + /// Gets the cookies. + public IReadOnlyList Cookies { get; } + /// Gets the web components. + public IReadOnlyList WebComponents { get; } + /// Gets the attributes. + public IReadOnlyList Attributes { get; } + /// Gets the asset security policies. + public IReadOnlyList AssetSecurityPolicies { get; } + /// Gets the response body minhash signatures. + public IReadOnlyList ResponseBodyMinhashSignatures { get; } + /// Gets the full dom minhash signatures. + public IReadOnlyList FullDomMinhashSignatures { get; } + /// Gets the response body hash signatures. + public IReadOnlyList ResponseBodyHashSignatures { get; } + /// Gets the errors. + public IReadOnlyList Errors { get; } + /// Gets the ssl certs. + public IReadOnlyList SslCerts { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the cause. + public PageCause Cause { get; } + /// Gets the referrer. + public string Referrer { get; } + /// Gets the redirect urls. + public IReadOnlyList RedirectUrls { get; } + /// Gets the redirect type. + public PageAssetRedirectType? RedirectType { get; } + /// Gets the final urls. + public IReadOnlyList FinalUrls { get; } + /// Gets the final response codes. + public IReadOnlyList FinalResponseCodes { get; } + /// Gets the parked page. + public IReadOnlyList ParkedPage { get; } + /// Gets the resource urls. + public IReadOnlyList ResourceUrls { get; } + /// Gets the guids. + public IReadOnlyList Guids { get; } + /// Gets the final ip addresses. + public IReadOnlyList FinalIpAddresses { get; } + /// Gets the asns. + public IReadOnlyList Asns { get; } + /// Gets the ip blocks. + public IReadOnlyList IpBlocks { get; } + /// Gets the final asns. + public IReadOnlyList FinalAsns { get; } + /// Gets the final ip blocks. + public IReadOnlyList FinalIpBlocks { get; } + /// Gets the response bodies. + public IReadOnlyList ResponseBodies { get; } + /// Gets the domain asset. + public DomainAsset DomainAsset { get; } + /// Gets the root url. + public ObservedBoolean RootUrl { get; } + /// Gets the is root url. + public bool? IsRootUrl { get; } + /// Gets the location. + public IReadOnlyList Location { get; } + /// Gets the services. + public IReadOnlyList Services { get; } + /// Gets the site status. + public string SiteStatus { get; } + /// Gets the cnames. + public IReadOnlyList Cnames { get; } + /// Gets the cdns. + public IReadOnlyList Cdns { get; } + /// Gets the host. + public string Host { get; } + /// Gets the domain. + public string Domain { get; } + /// Gets the ssl server config. + public IReadOnlyList SslServerConfig { get; } + /// Gets the gdpr asset security policies. + public IReadOnlyList GdprAssetSecurityPolicies { get; } + /// Gets the ipv 4. + public IReadOnlyList Ipv4 { get; } + /// Gets the ipv 6. + public IReadOnlyList Ipv6 { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetRedirectType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetRedirectType.cs new file mode 100644 index 000000000000..28f1d4d7356f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetRedirectType.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + public readonly partial struct PageAssetRedirectType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PageAssetRedirectType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HttpHeaderValue = "httpHeader"; + private const string MetaRefreshValue = "metaRefresh"; + private const string JavascriptValue = "javascript"; + private const string FinalValue = "final"; + + /// httpHeader. + public static PageAssetRedirectType HttpHeader { get; } = new PageAssetRedirectType(HttpHeaderValue); + /// metaRefresh. + public static PageAssetRedirectType MetaRefresh { get; } = new PageAssetRedirectType(MetaRefreshValue); + /// javascript. + public static PageAssetRedirectType Javascript { get; } = new PageAssetRedirectType(JavascriptValue); + /// final. + public static PageAssetRedirectType Final { get; } = new PageAssetRedirectType(FinalValue); + /// Determines if two values are the same. + public static bool operator ==(PageAssetRedirectType left, PageAssetRedirectType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PageAssetRedirectType left, PageAssetRedirectType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PageAssetRedirectType(string value) => new PageAssetRedirectType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PageAssetRedirectType other && Equals(other); + /// + public bool Equals(PageAssetRedirectType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.Serialization.cs new file mode 100644 index 000000000000..428ea354292c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class PageAssetResource + { + internal static PageAssetResource DeserializePageAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PageAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = PageAsset.DeserializePageAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new PageAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new PageAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePageAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.cs new file mode 100644 index 000000000000..7586d6c6c669 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The PageAssetResource. + public partial class PageAssetResource : AssetResource + { + /// Initializes a new instance of PageAssetResource. + /// asset. + /// is null. + internal PageAssetResource(PageAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "page"; + Asset = asset; + } + + /// Initializes a new instance of PageAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal PageAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, PageAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public PageAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.Serialization.cs new file mode 100644 index 000000000000..87db2bdf6197 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.Serialization.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class PageCause + { + internal static PageCause DeserializePageCause(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional cause = default; + Optional causeElementXPath = default; + Optional location = default; + Optional possibleMatches = default; + Optional loopDetected = default; + Optional version = default; + Optional domChangeIndex = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("cause"u8)) + { + cause = property.Value.GetString(); + continue; + } + if (property.NameEquals("causeElementXPath"u8)) + { + causeElementXPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (property.NameEquals("possibleMatches"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + possibleMatches = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("loopDetected"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loopDetected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("domChangeIndex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domChangeIndex = property.Value.GetInt32(); + continue; + } + } + return new PageCause(cause.Value, causeElementXPath.Value, location.Value, Optional.ToNullable(possibleMatches), Optional.ToNullable(loopDetected), Optional.ToNullable(version), Optional.ToNullable(domChangeIndex)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PageCause FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePageCause(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.cs new file mode 100644 index 000000000000..afb95b3f3d01 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/PageCause.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The PageCause. + public partial class PageCause + { + /// Initializes a new instance of PageCause. + internal PageCause() + { + } + + /// Initializes a new instance of PageCause. + /// + /// + /// + /// + /// + /// + /// + internal PageCause(string cause, string causeElementXPath, string location, int? possibleMatches, bool? loopDetected, int? version, int? domChangeIndex) + { + Cause = cause; + CauseElementXPath = causeElementXPath; + Location = location; + PossibleMatches = possibleMatches; + LoopDetected = loopDetected; + Version = version; + DomChangeIndex = domChangeIndex; + } + + /// Gets the cause. + public string Cause { get; } + /// Gets the cause element x path. + public string CauseElementXPath { get; } + /// Gets the location. + public string Location { get; } + /// Gets the possible matches. + public int? PossibleMatches { get; } + /// Gets the loop detected. + public bool? LoopDetected { get; } + /// Gets the version. + public int? Version { get; } + /// Gets the dom change index. + public int? DomChangeIndex { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.Serialization.cs new file mode 100644 index 000000000000..fb925b5a38b6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Port + { + internal static Port DeserializePort(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional port = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + } + return new Port(Optional.ToNullable(port), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Port FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePort(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.cs new file mode 100644 index 000000000000..87426ea8713d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Port.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Port. + public partial class Port + { + /// Initializes a new instance of Port. + internal Port() + { + } + + /// Initializes a new instance of Port. + /// + /// + /// + /// + internal Port(int? portProperty, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count) + { + PortProperty = portProperty; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + } + + /// Gets the port property. + public int? PortProperty { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.Serialization.cs new file mode 100644 index 000000000000..0de153a33274 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportAssetSnapshotRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Metric)) + { + writer.WritePropertyName("metric"u8); + writer.WriteStringValue(Metric); + } + if (Optional.IsDefined(LabelName)) + { + writer.WritePropertyName("labelName"u8); + writer.WriteStringValue(LabelName); + } + if (Optional.IsDefined(Size)) + { + writer.WritePropertyName("size"u8); + writer.WriteNumberValue(Size.Value); + } + if (Optional.IsDefined(Page)) + { + writer.WritePropertyName("page"u8); + writer.WriteNumberValue(Page.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.cs new file mode 100644 index 000000000000..a987d441e26b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotRequest.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to retrieve an asset report snapshot. + public partial class ReportAssetSnapshotRequest + { + /// Initializes a new instance of ReportAssetSnapshotRequest. + public ReportAssetSnapshotRequest() + { + } + + /// Initializes a new instance of ReportAssetSnapshotRequest. + /// The metric to retrieve a snapshot for. + /// The name of the label to retrieve a snapshot for. + /// The number of assets per page. + /// The page to retrieve. + internal ReportAssetSnapshotRequest(string metric, string labelName, int? size, int? page) + { + Metric = metric; + LabelName = labelName; + Size = size; + Page = page; + } + + /// The metric to retrieve a snapshot for. + public string Metric { get; set; } + /// The name of the label to retrieve a snapshot for. + public string LabelName { get; set; } + /// The number of assets per page. + public int? Size { get; set; } + /// The page to retrieve. + public int? Page { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.Serialization.cs new file mode 100644 index 000000000000..0802bee938ec --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.Serialization.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportAssetSnapshotResult + { + internal static ReportAssetSnapshotResult DeserializeReportAssetSnapshotResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional displayName = default; + Optional metric = default; + Optional labelName = default; + Optional updatedAt = default; + Optional description = default; + Optional assets = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("metric"u8)) + { + metric = property.Value.GetString(); + continue; + } + if (property.NameEquals("labelName"u8)) + { + labelName = property.Value.GetString(); + continue; + } + if (property.NameEquals("updatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("assets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assets = AssetPageResult.DeserializeAssetPageResult(property.Value); + continue; + } + } + return new ReportAssetSnapshotResult(displayName.Value, metric.Value, labelName.Value, Optional.ToNullable(updatedAt), description.Value, assets.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportAssetSnapshotResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReportAssetSnapshotResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.cs new file mode 100644 index 000000000000..25a5e71d5ba3 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSnapshotResult.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// A snapshot of assets captured daily for the provided metric. Asset details only contain primary properties. Detailed asset data can be retrieved from the asset endpoints. + public partial class ReportAssetSnapshotResult + { + /// Initializes a new instance of ReportAssetSnapshotResult. + internal ReportAssetSnapshotResult() + { + } + + /// Initializes a new instance of ReportAssetSnapshotResult. + /// The name of the metric. + /// The unique metric name. + /// The customer label that was filtered on, if one was provided. + /// The last time this asset data was updated on this metric. + /// A description of what the metric represents. + /// The page of assets that match the provided metric. + internal ReportAssetSnapshotResult(string displayName, string metric, string labelName, DateTimeOffset? updatedAt, string description, AssetPageResult assets) + { + DisplayName = displayName; + Metric = metric; + LabelName = labelName; + UpdatedAt = updatedAt; + Description = description; + Assets = assets; + } + + /// The name of the metric. + public string DisplayName { get; } + /// The unique metric name. + public string Metric { get; } + /// The customer label that was filtered on, if one was provided. + public string LabelName { get; } + /// The last time this asset data was updated on this metric. + public DateTimeOffset? UpdatedAt { get; } + /// A description of what the metric represents. + public string Description { get; } + /// The page of assets that match the provided metric. + public AssetPageResult Assets { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.Serialization.cs new file mode 100644 index 000000000000..a8422622fb67 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportAssetSummaryRequest : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(MetricCategories)) + { + writer.WritePropertyName("metricCategories"u8); + writer.WriteStartArray(); + foreach (var item in MetricCategories) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteStartArray(); + foreach (var item in Filters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(GroupBy)) + { + writer.WritePropertyName("groupBy"u8); + writer.WriteStringValue(GroupBy); + } + if (Optional.IsDefined(SegmentBy)) + { + writer.WritePropertyName("segmentBy"u8); + writer.WriteStringValue(SegmentBy); + } + if (Optional.IsDefined(LabelName)) + { + writer.WritePropertyName("labelName"u8); + writer.WriteStringValue(LabelName); + } + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.cs new file mode 100644 index 000000000000..7405807fbfa7 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryRequest.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories. + public partial class ReportAssetSummaryRequest + { + /// Initializes a new instance of ReportAssetSummaryRequest. + public ReportAssetSummaryRequest() + { + MetricCategories = new ChangeTrackingList(); + Metrics = new ChangeTrackingList(); + Filters = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReportAssetSummaryRequest. + /// Categories to retrieve risk reporting data for. + /// Metrics to retrieve risk reporting data for. + /// Query filters to apply to the asset summary. + /// A parameter to group the assets by (first level facet field), only used when the chosen summary identifier is filters. + /// A parameter to segment the assets by (second level facet field), only used when the chosen summary identifier is filters. + /// Currently unused. + internal ReportAssetSummaryRequest(IList metricCategories, IList metrics, IList filters, string groupBy, string segmentBy, string labelName) + { + MetricCategories = metricCategories; + Metrics = metrics; + Filters = filters; + GroupBy = groupBy; + SegmentBy = segmentBy; + LabelName = labelName; + } + + /// Categories to retrieve risk reporting data for. + public IList MetricCategories { get; } + /// Metrics to retrieve risk reporting data for. + public IList Metrics { get; } + /// Query filters to apply to the asset summary. + public IList Filters { get; } + /// A parameter to group the assets by (first level facet field), only used when the chosen summary identifier is filters. + public string GroupBy { get; set; } + /// A parameter to segment the assets by (second level facet field), only used when the chosen summary identifier is filters. + public string SegmentBy { get; set; } + /// Currently unused. + public string LabelName { get; set; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.Serialization.cs new file mode 100644 index 000000000000..326af02d263e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportAssetSummaryResult + { + internal static ReportAssetSummaryResult DeserializeReportAssetSummaryResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> assetSummaries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assetSummaries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetSummaryResult.DeserializeAssetSummaryResult(item)); + } + assetSummaries = array; + continue; + } + } + return new ReportAssetSummaryResult(Optional.ToList(assetSummaries)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportAssetSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReportAssetSummaryResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.cs new file mode 100644 index 000000000000..4dd374eebb12 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportAssetSummaryResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ReportAssetSummaryResult. + public partial class ReportAssetSummaryResult + { + /// Initializes a new instance of ReportAssetSummaryResult. + internal ReportAssetSummaryResult() + { + AssetSummaries = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReportAssetSummaryResult. + /// The collection of asset summaries. + internal ReportAssetSummaryResult(IReadOnlyList assetSummaries) + { + AssetSummaries = assetSummaries; + } + + /// The collection of asset summaries. + public IReadOnlyList AssetSummaries { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.Serialization.cs new file mode 100644 index 000000000000..7efc8e3e81e5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportBillableAssetBreakdown + { + internal static ReportBillableAssetBreakdown DeserializeReportBillableAssetBreakdown(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + Optional count = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new ReportBillableAssetBreakdownKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + } + return new ReportBillableAssetBreakdown(Optional.ToNullable(kind), Optional.ToNullable(count)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportBillableAssetBreakdown FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReportBillableAssetBreakdown(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.cs new file mode 100644 index 000000000000..81d93049e166 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdown.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The breakdown of billable asset counts for each asset type. + public partial class ReportBillableAssetBreakdown + { + /// Initializes a new instance of ReportBillableAssetBreakdown. + internal ReportBillableAssetBreakdown() + { + } + + /// Initializes a new instance of ReportBillableAssetBreakdown. + /// The kind of billable asset. + /// The number of assets of this type. + internal ReportBillableAssetBreakdown(ReportBillableAssetBreakdownKind? kind, long? count) + { + Kind = kind; + Count = count; + } + + /// The kind of billable asset. + public ReportBillableAssetBreakdownKind? Kind { get; } + /// The number of assets of this type. + public long? Count { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdownKind.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdownKind.cs new file mode 100644 index 000000000000..f96ed015ab52 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetBreakdownKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The kind of billable asset. + public readonly partial struct ReportBillableAssetBreakdownKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ReportBillableAssetBreakdownKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DomainValue = "domain"; + private const string HostValue = "host"; + private const string IpAddressValue = "ipAddress"; + + /// domain. + public static ReportBillableAssetBreakdownKind Domain { get; } = new ReportBillableAssetBreakdownKind(DomainValue); + /// host. + public static ReportBillableAssetBreakdownKind Host { get; } = new ReportBillableAssetBreakdownKind(HostValue); + /// ipAddress. + public static ReportBillableAssetBreakdownKind IpAddress { get; } = new ReportBillableAssetBreakdownKind(IpAddressValue); + /// Determines if two values are the same. + public static bool operator ==(ReportBillableAssetBreakdownKind left, ReportBillableAssetBreakdownKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ReportBillableAssetBreakdownKind left, ReportBillableAssetBreakdownKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ReportBillableAssetBreakdownKind(string value) => new ReportBillableAssetBreakdownKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ReportBillableAssetBreakdownKind other && Equals(other); + /// + public bool Equals(ReportBillableAssetBreakdownKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.Serialization.cs new file mode 100644 index 000000000000..b4779f081bf0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportBillableAssetSnapshotResult + { + internal static ReportBillableAssetSnapshotResult DeserializeReportBillableAssetSnapshotResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional date = default; + Optional total = default; + Optional> assetBreakdown = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("date"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + date = property.Value.GetDateTimeOffset("D"); + continue; + } + if (property.NameEquals("total"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + total = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("assetBreakdown"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReportBillableAssetBreakdown.DeserializeReportBillableAssetBreakdown(item)); + } + assetBreakdown = array; + continue; + } + } + return new ReportBillableAssetSnapshotResult(Optional.ToNullable(date), Optional.ToNullable(total), Optional.ToList(assetBreakdown)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportBillableAssetSnapshotResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReportBillableAssetSnapshotResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.cs new file mode 100644 index 000000000000..a7fccee06077 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSnapshotResult.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ReportBillableAssetSnapshotResult. + public partial class ReportBillableAssetSnapshotResult + { + /// Initializes a new instance of ReportBillableAssetSnapshotResult. + internal ReportBillableAssetSnapshotResult() + { + AssetBreakdown = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReportBillableAssetSnapshotResult. + /// The date these assets were billed on. + /// The total number of billable assets for this date. + /// The breakdown of billable asset counts for each asset type. + internal ReportBillableAssetSnapshotResult(DateTimeOffset? date, long? total, IReadOnlyList assetBreakdown) + { + Date = date; + Total = total; + AssetBreakdown = assetBreakdown; + } + + /// The date these assets were billed on. + public DateTimeOffset? Date { get; } + /// The total number of billable assets for this date. + public long? Total { get; } + /// The breakdown of billable asset counts for each asset type. + public IReadOnlyList AssetBreakdown { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.Serialization.cs new file mode 100644 index 000000000000..3856427f01c3 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ReportBillableAssetSummaryResult + { + internal static ReportBillableAssetSummaryResult DeserializeReportBillableAssetSummaryResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> assetSummaries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assetSummaries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReportBillableAssetSnapshotResult.DeserializeReportBillableAssetSnapshotResult(item)); + } + assetSummaries = array; + continue; + } + } + return new ReportBillableAssetSummaryResult(Optional.ToList(assetSummaries)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ReportBillableAssetSummaryResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReportBillableAssetSummaryResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.cs new file mode 100644 index 000000000000..7fe9193e1fb9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ReportBillableAssetSummaryResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ReportBillableAssetSummaryResult. + public partial class ReportBillableAssetSummaryResult + { + /// Initializes a new instance of ReportBillableAssetSummaryResult. + internal ReportBillableAssetSummaryResult() + { + AssetSummaries = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReportBillableAssetSummaryResult. + /// + internal ReportBillableAssetSummaryResult(IReadOnlyList assetSummaries) + { + AssetSummaries = assetSummaries; + } + + /// Gets the asset summaries. + public IReadOnlyList AssetSummaries { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.Serialization.cs new file mode 100644 index 000000000000..f8d8d95c00f8 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.Serialization.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Reputation + { + internal static Reputation DeserializeReputation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional listName = default; + Optional threatType = default; + Optional trusted = default; + Optional cidr = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional listUpdatedAt = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("listName"u8)) + { + listName = property.Value.GetString(); + continue; + } + if (property.NameEquals("threatType"u8)) + { + threatType = property.Value.GetString(); + continue; + } + if (property.NameEquals("trusted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trusted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cidr"u8)) + { + cidr = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("listUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + listUpdatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new Reputation(listName.Value, threatType.Value, Optional.ToNullable(trusted), cidr.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(listUpdatedAt), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Reputation FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeReputation(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.cs new file mode 100644 index 000000000000..58f59bef5149 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Reputation.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Reputation. + public partial class Reputation + { + /// Initializes a new instance of Reputation. + internal Reputation() + { + } + + /// Initializes a new instance of Reputation. + /// + /// + /// + /// + /// + /// + /// + /// + internal Reputation(string listName, string threatType, bool? trusted, string cidr, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, DateTimeOffset? listUpdatedAt, bool? recent) + { + ListName = listName; + ThreatType = threatType; + Trusted = trusted; + Cidr = cidr; + FirstSeen = firstSeen; + LastSeen = lastSeen; + ListUpdatedAt = listUpdatedAt; + Recent = recent; + } + + /// Gets the list name. + public string ListName { get; } + /// Gets the threat type. + public string ThreatType { get; } + /// Gets the trusted. + public bool? Trusted { get; } + /// Gets the cidr. + public string Cidr { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the list updated at. + public DateTimeOffset? ListUpdatedAt { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.Serialization.cs new file mode 100644 index 000000000000..42527991082b --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ResourceUrl + { + internal static ResourceUrl DeserializeResourceUrl(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional url = default; + Optional> resources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DependentResource.DeserializeDependentResource(item)); + } + resources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new ResourceUrl(url.Value, Optional.ToList(resources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResourceUrl FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResourceUrl(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.cs new file mode 100644 index 000000000000..1b2e65c53d71 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ResourceUrl.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ResourceUrl. + public partial class ResourceUrl + { + /// Initializes a new instance of ResourceUrl. + internal ResourceUrl() + { + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of ResourceUrl. + /// + /// + /// + /// + /// + /// + internal ResourceUrl(Uri url, IReadOnlyList resources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent) + { + Url = url; + Resources = resources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + } + + /// Gets the url. + public Uri Url { get; } + /// Gets the resources. + public IReadOnlyList Resources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.Serialization.cs new file mode 100644 index 000000000000..2f367f3607a4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.Serialization.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SavedFilter + { + internal static SavedFilter DeserializeSavedFilter(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional id = default; + string name = default; + Optional displayName = default; + Optional filter = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("filter"u8)) + { + filter = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new SavedFilter(id.Value, name, displayName.Value, filter.Value, description.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SavedFilter FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSavedFilter(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs new file mode 100644 index 000000000000..ddfcbdb467cf --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilter.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The SavedFilter. + public partial class SavedFilter + { + /// Initializes a new instance of SavedFilter. + internal SavedFilter() + { + } + + /// Initializes a new instance of SavedFilter. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// + /// + internal SavedFilter(string id, string name, string displayName, string filter, string description) + { + Id = id; + Name = name; + DisplayName = displayName; + Filter = filter; + Description = description; + } + + /// The system generated unique id for the resource. + public string Id { get; } + /// The caller provided unique name for the resource. + public string Name { get; } + /// The name that can be used for display purposes. + public string DisplayName { get; } + /// Gets the filter. + public string Filter { get; } + /// Gets the description. + public string Description { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.Serialization.cs new file mode 100644 index 000000000000..648626d5f8cf --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SavedFilterData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("filter"u8); + writer.WriteStringValue(Filter); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WriteEndObject(); + } + + /// Convert into a Utf8JsonRequestContent. + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.cs new file mode 100644 index 000000000000..5729a02dc4ba --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SavedFilterData.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// A request body used to create a saved filter. + public partial class SavedFilterData + { + /// Initializes a new instance of SavedFilterData. + /// An expression on the resource type that selects the resources to be returned. + /// A human readable description of the saved filter. + /// or is null. + public SavedFilterData(string filter, string description) + { + Argument.AssertNotNull(filter, nameof(filter)); + Argument.AssertNotNull(description, nameof(description)); + + Filter = filter; + Description = description; + } + + /// An expression on the resource type that selects the resources to be returned. + public string Filter { get; } + /// A human readable description of the saved filter. + public string Description { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.Serialization.cs new file mode 100644 index 000000000000..a0c47e71a352 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ScanMetadata + { + internal static ScanMetadata DeserializeScanMetadata(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional port = default; + Optional bannerMetadata = default; + Optional startScan = default; + Optional endScan = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("bannerMetadata"u8)) + { + bannerMetadata = property.Value.GetString(); + continue; + } + if (property.NameEquals("startScan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startScan = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endScan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endScan = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new ScanMetadata(Optional.ToNullable(port), bannerMetadata.Value, Optional.ToNullable(startScan), Optional.ToNullable(endScan)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ScanMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeScanMetadata(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.cs new file mode 100644 index 000000000000..2b946346217a --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ScanMetadata.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The ScanMetadata. + public partial class ScanMetadata + { + /// Initializes a new instance of ScanMetadata. + internal ScanMetadata() + { + } + + /// Initializes a new instance of ScanMetadata. + /// + /// + /// + /// + internal ScanMetadata(int? port, string bannerMetadata, DateTimeOffset? startScan, DateTimeOffset? endScan) + { + Port = port; + BannerMetadata = bannerMetadata; + StartScan = startScan; + EndScan = endScan; + } + + /// Gets the port. + public int? Port { get; } + /// Gets the banner metadata. + public string BannerMetadata { get; } + /// Gets the start scan. + public DateTimeOffset? StartScan { get; } + /// Gets the end scan. + public DateTimeOffset? EndScan { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.Serialization.cs new file mode 100644 index 000000000000..5c598cbf576c --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Service + { + internal static Service DeserializeService(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional scheme = default; + Optional port = default; + Optional> webComponents = default; + Optional> sslCerts = default; + Optional> exceptions = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional recent = default; + Optional> portStates = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scheme"u8)) + { + scheme = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("webComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebComponent.DeserializeWebComponent(item)); + } + webComponents = array; + continue; + } + if (property.NameEquals("sslCerts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SslCertAsset.DeserializeSslCertAsset(item)); + } + sslCerts = array; + continue; + } + if (property.NameEquals("exceptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedString.DeserializeObservedString(item)); + } + exceptions = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("portStates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ObservedPortState.DeserializeObservedPortState(item)); + } + portStates = array; + continue; + } + } + return new Service(scheme.Value, Optional.ToNullable(port), Optional.ToList(webComponents), Optional.ToList(sslCerts), Optional.ToList(exceptions), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(recent), Optional.ToList(portStates)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Service FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeService(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.cs new file mode 100644 index 000000000000..4abd60aafd1f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Service.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Service. + public partial class Service + { + /// Initializes a new instance of Service. + internal Service() + { + WebComponents = new ChangeTrackingList(); + SslCerts = new ChangeTrackingList(); + Exceptions = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + PortStates = new ChangeTrackingList(); + } + + /// Initializes a new instance of Service. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal Service(string scheme, int? port, IReadOnlyList webComponents, IReadOnlyList sslCerts, IReadOnlyList exceptions, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, bool? recent, IReadOnlyList portStates) + { + Scheme = scheme; + Port = port; + WebComponents = webComponents; + SslCerts = sslCerts; + Exceptions = exceptions; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Recent = recent; + PortStates = portStates; + } + + /// Gets the scheme. + public string Scheme { get; } + /// Gets the port. + public int? Port { get; } + /// Gets the web components. + public IReadOnlyList WebComponents { get; } + /// Gets the ssl certs. + public IReadOnlyList SslCerts { get; } + /// Gets the exceptions. + public IReadOnlyList Exceptions { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the port states. + public IReadOnlyList PortStates { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.Serialization.cs new file mode 100644 index 000000000000..fc5c97a1dd88 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.Serialization.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SoaRecord + { + internal static SoaRecord DeserializeSoaRecord(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nameServer = default; + Optional email = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional serialNumber = default; + Optional recent = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameServer"u8)) + { + nameServer = property.Value.GetString(); + continue; + } + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serialNumber = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + } + return new SoaRecord(nameServer.Value, email.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(serialNumber), Optional.ToNullable(recent)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SoaRecord FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSoaRecord(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.cs new file mode 100644 index 000000000000..688cd2939a71 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SoaRecord.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The SoaRecord. + public partial class SoaRecord + { + /// Initializes a new instance of SoaRecord. + internal SoaRecord() + { + } + + /// Initializes a new instance of SoaRecord. + /// + /// + /// + /// + /// + /// + /// + internal SoaRecord(string nameServer, string email, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, long? serialNumber, bool? recent) + { + NameServer = nameServer; + Email = email; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + SerialNumber = serialNumber; + Recent = recent; + } + + /// Gets the name server. + public string NameServer { get; } + /// Gets the email. + public string Email { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the serial number. + public long? SerialNumber { get; } + /// Gets the recent. + public bool? Recent { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.Serialization.cs new file mode 100644 index 000000000000..42dd7a4f3637 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.Serialization.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Source + { + internal static Source DeserializeSource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional source = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new Source(source.Value, Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), reason.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Source FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.cs new file mode 100644 index 000000000000..d48793fb0f95 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Source.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Source. + public partial class Source + { + /// Initializes a new instance of Source. + internal Source() + { + } + + /// Initializes a new instance of Source. + /// + /// + /// + /// + /// + internal Source(string sourceProperty, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, string reason) + { + SourceProperty = sourceProperty; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Reason = reason; + } + + /// Gets the source property. + public string SourceProperty { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the reason. + public string Reason { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.Serialization.cs new file mode 100644 index 000000000000..741ff31ef207 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.Serialization.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SslCertAsset + { + internal static SslCertAsset DeserializeSslCertAsset(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional sha1 = default; + Optional> subjectCommonNames = default; + Optional> organizations = default; + Optional> organizationalUnits = default; + Optional> issuerCommonNames = default; + Optional sigAlgName = default; + Optional invalidAfter = default; + Optional serialNumber = default; + Optional> subjectAlternativeNames = default; + Optional> issuerAlternativeNames = default; + Optional> sources = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional invalidBefore = default; + Optional keySize = default; + Optional keyAlgorithm = default; + Optional> subjectLocality = default; + Optional> subjectState = default; + Optional> subjectCountry = default; + Optional> issuerLocality = default; + Optional> issuerState = default; + Optional> issuerCountry = default; + Optional> subjectOrganizations = default; + Optional> subjectOrganizationalUnits = default; + Optional> issuerOrganizations = default; + Optional> issuerOrganizationalUnits = default; + Optional version = default; + Optional certificateAuthority = default; + Optional selfSigned = default; + Optional sigAlgOid = default; + Optional recent = default; + Optional validationType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sha1"u8)) + { + sha1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("subjectCommonNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectCommonNames = array; + continue; + } + if (property.NameEquals("organizations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + organizations = array; + continue; + } + if (property.NameEquals("organizationalUnits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + organizationalUnits = array; + continue; + } + if (property.NameEquals("issuerCommonNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerCommonNames = array; + continue; + } + if (property.NameEquals("sigAlgName"u8)) + { + sigAlgName = property.Value.GetString(); + continue; + } + if (property.NameEquals("invalidAfter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + invalidAfter = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("subjectAlternativeNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectAlternativeNames = array; + continue; + } + if (property.NameEquals("issuerAlternativeNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerAlternativeNames = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("invalidBefore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + invalidBefore = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("keySize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keySize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("keyAlgorithm"u8)) + { + keyAlgorithm = property.Value.GetString(); + continue; + } + if (property.NameEquals("subjectLocality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectLocality = array; + continue; + } + if (property.NameEquals("subjectState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectState = array; + continue; + } + if (property.NameEquals("subjectCountry"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectCountry = array; + continue; + } + if (property.NameEquals("issuerLocality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerLocality = array; + continue; + } + if (property.NameEquals("issuerState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerState = array; + continue; + } + if (property.NameEquals("issuerCountry"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerCountry = array; + continue; + } + if (property.NameEquals("subjectOrganizations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectOrganizations = array; + continue; + } + if (property.NameEquals("subjectOrganizationalUnits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + subjectOrganizationalUnits = array; + continue; + } + if (property.NameEquals("issuerOrganizations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerOrganizations = array; + continue; + } + if (property.NameEquals("issuerOrganizationalUnits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + issuerOrganizationalUnits = array; + continue; + } + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("certificateAuthority"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateAuthority = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("selfSigned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selfSigned = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("sigAlgOid"u8)) + { + sigAlgOid = property.Value.GetString(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("validationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + validationType = new SslCertAssetValidationType(property.Value.GetString()); + continue; + } + } + return new SslCertAsset(sha1.Value, Optional.ToList(subjectCommonNames), Optional.ToList(organizations), Optional.ToList(organizationalUnits), Optional.ToList(issuerCommonNames), sigAlgName.Value, Optional.ToNullable(invalidAfter), serialNumber.Value, Optional.ToList(subjectAlternativeNames), Optional.ToList(issuerAlternativeNames), Optional.ToList(sources), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToNullable(invalidBefore), Optional.ToNullable(keySize), keyAlgorithm.Value, Optional.ToList(subjectLocality), Optional.ToList(subjectState), Optional.ToList(subjectCountry), Optional.ToList(issuerLocality), Optional.ToList(issuerState), Optional.ToList(issuerCountry), Optional.ToList(subjectOrganizations), Optional.ToList(subjectOrganizationalUnits), Optional.ToList(issuerOrganizations), Optional.ToList(issuerOrganizationalUnits), Optional.ToNullable(version), Optional.ToNullable(certificateAuthority), Optional.ToNullable(selfSigned), sigAlgOid.Value, Optional.ToNullable(recent), Optional.ToNullable(validationType)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SslCertAsset FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSslCertAsset(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.cs new file mode 100644 index 000000000000..74ae10f91ea2 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAsset.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The SslCertAsset. + public partial class SslCertAsset : InventoryAsset + { + /// Initializes a new instance of SslCertAsset. + internal SslCertAsset() + { + SubjectCommonNames = new ChangeTrackingList(); + Organizations = new ChangeTrackingList(); + OrganizationalUnits = new ChangeTrackingList(); + IssuerCommonNames = new ChangeTrackingList(); + SubjectAlternativeNames = new ChangeTrackingList(); + IssuerAlternativeNames = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + SubjectLocality = new ChangeTrackingList(); + SubjectState = new ChangeTrackingList(); + SubjectCountry = new ChangeTrackingList(); + IssuerLocality = new ChangeTrackingList(); + IssuerState = new ChangeTrackingList(); + IssuerCountry = new ChangeTrackingList(); + SubjectOrganizations = new ChangeTrackingList(); + SubjectOrganizationalUnits = new ChangeTrackingList(); + IssuerOrganizations = new ChangeTrackingList(); + IssuerOrganizationalUnits = new ChangeTrackingList(); + } + + /// Initializes a new instance of SslCertAsset. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal SslCertAsset(string sha1, IReadOnlyList subjectCommonNames, IReadOnlyList organizations, IReadOnlyList organizationalUnits, IReadOnlyList issuerCommonNames, string sigAlgName, DateTimeOffset? invalidAfter, string serialNumber, IReadOnlyList subjectAlternativeNames, IReadOnlyList issuerAlternativeNames, IReadOnlyList sources, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, DateTimeOffset? invalidBefore, int? keySize, string keyAlgorithm, IReadOnlyList subjectLocality, IReadOnlyList subjectState, IReadOnlyList subjectCountry, IReadOnlyList issuerLocality, IReadOnlyList issuerState, IReadOnlyList issuerCountry, IReadOnlyList subjectOrganizations, IReadOnlyList subjectOrganizationalUnits, IReadOnlyList issuerOrganizations, IReadOnlyList issuerOrganizationalUnits, int? version, bool? certificateAuthority, bool? selfSigned, string sigAlgOid, bool? recent, SslCertAssetValidationType? validationType) + { + Sha1 = sha1; + SubjectCommonNames = subjectCommonNames; + Organizations = organizations; + OrganizationalUnits = organizationalUnits; + IssuerCommonNames = issuerCommonNames; + SigAlgName = sigAlgName; + InvalidAfter = invalidAfter; + SerialNumber = serialNumber; + SubjectAlternativeNames = subjectAlternativeNames; + IssuerAlternativeNames = issuerAlternativeNames; + Sources = sources; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + InvalidBefore = invalidBefore; + KeySize = keySize; + KeyAlgorithm = keyAlgorithm; + SubjectLocality = subjectLocality; + SubjectState = subjectState; + SubjectCountry = subjectCountry; + IssuerLocality = issuerLocality; + IssuerState = issuerState; + IssuerCountry = issuerCountry; + SubjectOrganizations = subjectOrganizations; + SubjectOrganizationalUnits = subjectOrganizationalUnits; + IssuerOrganizations = issuerOrganizations; + IssuerOrganizationalUnits = issuerOrganizationalUnits; + Version = version; + CertificateAuthority = certificateAuthority; + SelfSigned = selfSigned; + SigAlgOid = sigAlgOid; + Recent = recent; + ValidationType = validationType; + } + + /// Gets the sha 1. + public string Sha1 { get; } + /// Gets the subject common names. + public IReadOnlyList SubjectCommonNames { get; } + /// Gets the organizations. + public IReadOnlyList Organizations { get; } + /// Gets the organizational units. + public IReadOnlyList OrganizationalUnits { get; } + /// Gets the issuer common names. + public IReadOnlyList IssuerCommonNames { get; } + /// Gets the sig alg name. + public string SigAlgName { get; } + /// Gets the invalid after. + public DateTimeOffset? InvalidAfter { get; } + /// Gets the serial number. + public string SerialNumber { get; } + /// Gets the subject alternative names. + public IReadOnlyList SubjectAlternativeNames { get; } + /// Gets the issuer alternative names. + public IReadOnlyList IssuerAlternativeNames { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the invalid before. + public DateTimeOffset? InvalidBefore { get; } + /// Gets the key size. + public int? KeySize { get; } + /// Gets the key algorithm. + public string KeyAlgorithm { get; } + /// Gets the subject locality. + public IReadOnlyList SubjectLocality { get; } + /// Gets the subject state. + public IReadOnlyList SubjectState { get; } + /// Gets the subject country. + public IReadOnlyList SubjectCountry { get; } + /// Gets the issuer locality. + public IReadOnlyList IssuerLocality { get; } + /// Gets the issuer state. + public IReadOnlyList IssuerState { get; } + /// Gets the issuer country. + public IReadOnlyList IssuerCountry { get; } + /// Gets the subject organizations. + public IReadOnlyList SubjectOrganizations { get; } + /// Gets the subject organizational units. + public IReadOnlyList SubjectOrganizationalUnits { get; } + /// Gets the issuer organizations. + public IReadOnlyList IssuerOrganizations { get; } + /// Gets the issuer organizational units. + public IReadOnlyList IssuerOrganizationalUnits { get; } + /// Gets the version. + public int? Version { get; } + /// Gets the certificate authority. + public bool? CertificateAuthority { get; } + /// Gets the self signed. + public bool? SelfSigned { get; } + /// Gets the sig alg oid. + public string SigAlgOid { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the validation type. + public SslCertAssetValidationType? ValidationType { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.Serialization.cs new file mode 100644 index 000000000000..a2c70d610f03 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SslCertAssetResource + { + internal static SslCertAssetResource DeserializeSslCertAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SslCertAsset asset = default; + string kind = default; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("asset"u8)) + { + asset = SslCertAsset.DeserializeSslCertAsset(property.Value); + continue; + } + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new SslCertAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value, asset); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new SslCertAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSslCertAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.cs new file mode 100644 index 000000000000..670d3fa4ce6f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The SslCertAssetResource. + public partial class SslCertAssetResource : AssetResource + { + /// Initializes a new instance of SslCertAssetResource. + /// asset. + /// is null. + internal SslCertAssetResource(SslCertAsset asset) + { + Argument.AssertNotNull(asset, nameof(asset)); + + Kind = "sslCert"; + Asset = asset; + } + + /// Initializes a new instance of SslCertAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + /// asset. + internal SslCertAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason, SslCertAsset asset) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + Asset = asset; + } + + /// asset. + public SslCertAsset Asset { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetValidationType.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetValidationType.cs new file mode 100644 index 000000000000..753661e2ac37 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslCertAssetValidationType.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + public readonly partial struct SslCertAssetValidationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SslCertAssetValidationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DomainValidationValue = "domainValidation"; + private const string OrganizationValidationValue = "organizationValidation"; + private const string ExtendedValidationValue = "extendedValidation"; + + /// domainValidation. + public static SslCertAssetValidationType DomainValidation { get; } = new SslCertAssetValidationType(DomainValidationValue); + /// organizationValidation. + public static SslCertAssetValidationType OrganizationValidation { get; } = new SslCertAssetValidationType(OrganizationValidationValue); + /// extendedValidation. + public static SslCertAssetValidationType ExtendedValidation { get; } = new SslCertAssetValidationType(ExtendedValidationValue); + /// Determines if two values are the same. + public static bool operator ==(SslCertAssetValidationType left, SslCertAssetValidationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SslCertAssetValidationType left, SslCertAssetValidationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SslCertAssetValidationType(string value) => new SslCertAssetValidationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SslCertAssetValidationType other && Equals(other); + /// + public bool Equals(SslCertAssetValidationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.Serialization.cs new file mode 100644 index 000000000000..b4100b164ff1 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SslServerConfig + { + internal static SslServerConfig DeserializeSslServerConfig(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> tlsVersions = default; + Optional> cipherSuites = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> sources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tlsVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + tlsVersions = array; + continue; + } + if (property.NameEquals("cipherSuites"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cipherSuites = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + } + return new SslServerConfig(Optional.ToList(tlsVersions), Optional.ToList(cipherSuites), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(sources)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SslServerConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSslServerConfig(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.cs new file mode 100644 index 000000000000..ac5485674097 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SslServerConfig.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The SslServerConfig. + public partial class SslServerConfig + { + /// Initializes a new instance of SslServerConfig. + internal SslServerConfig() + { + TlsVersions = new ChangeTrackingList(); + CipherSuites = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of SslServerConfig. + /// + /// + /// + /// + /// + /// + internal SslServerConfig(IReadOnlyList tlsVersions, IReadOnlyList cipherSuites, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList sources) + { + TlsVersions = tlsVersions; + CipherSuites = cipherSuites; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Sources = sources; + } + + /// Gets the tls versions. + public IReadOnlyList TlsVersions { get; } + /// Gets the cipher suites. + public IReadOnlyList CipherSuites { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.Serialization.cs new file mode 100644 index 000000000000..4d66261eea9f --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.Serialization.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class SubResourceIntegrityCheck + { + internal static SubResourceIntegrityCheck DeserializeSubResourceIntegrityCheck(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional violation = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional causePageUrl = default; + Optional crawlGuid = default; + Optional pageGuid = default; + Optional resourceGuid = default; + Optional expectedHash = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("violation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + violation = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("causePageUrl"u8)) + { + causePageUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("crawlGuid"u8)) + { + crawlGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("pageGuid"u8)) + { + pageGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGuid"u8)) + { + resourceGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("expectedHash"u8)) + { + expectedHash = property.Value.GetString(); + continue; + } + } + return new SubResourceIntegrityCheck(Optional.ToNullable(violation), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), causePageUrl.Value, crawlGuid.Value, pageGuid.Value, resourceGuid.Value, expectedHash.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static SubResourceIntegrityCheck FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeSubResourceIntegrityCheck(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.cs new file mode 100644 index 000000000000..8df9937c404d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/SubResourceIntegrityCheck.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// The SubResourceIntegrityCheck. + public partial class SubResourceIntegrityCheck + { + /// Initializes a new instance of SubResourceIntegrityCheck. + internal SubResourceIntegrityCheck() + { + } + + /// Initializes a new instance of SubResourceIntegrityCheck. + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal SubResourceIntegrityCheck(bool? violation, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, string causePageUrl, string crawlGuid, string pageGuid, string resourceGuid, string expectedHash) + { + Violation = violation; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + CausePageUrl = causePageUrl; + CrawlGuid = crawlGuid; + PageGuid = pageGuid; + ResourceGuid = resourceGuid; + ExpectedHash = expectedHash; + } + + /// Gets the violation. + public bool? Violation { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the cause page url. + public string CausePageUrl { get; } + /// Gets the crawl guid. + public string CrawlGuid { get; } + /// Gets the page guid. + public string PageGuid { get; } + /// Gets the resource guid. + public string ResourceGuid { get; } + /// Gets the expected hash. + public string ExpectedHash { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.Serialization.cs new file mode 100644 index 000000000000..0d000c5d2cc6 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class Task + { + internal static Task DeserializeTask(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Optional startedAt = default; + Optional completedAt = default; + Optional lastPolledAt = default; + Optional state = default; + Optional phase = default; + Optional reason = default; + Optional> metadata = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("startedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("completedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + completedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastPolledAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastPolledAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new TaskState(property.Value.GetString()); + continue; + } + if (property.NameEquals("phase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + phase = new TaskPhase(property.Value.GetString()); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + metadata = dictionary; + continue; + } + } + return new Task(id, Optional.ToNullable(startedAt), Optional.ToNullable(completedAt), Optional.ToNullable(lastPolledAt), Optional.ToNullable(state), Optional.ToNullable(phase), reason.Value, Optional.ToDictionary(metadata)); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static Task FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTask(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.cs new file mode 100644 index 000000000000..11ba24f8bd81 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Task.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The Task. + public partial class Task + { + /// Initializes a new instance of Task. + internal Task() + { + Metadata = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of Task. + /// The unique identifier of the task. + /// The time the task started. + /// The time the task completed. + /// The last time the status of the task was updated. + /// The state the task is in. + /// The phase the task is in. + /// The reason the task was moved into its current state, if the task wasn't completed. + /// Attributes unique to the task. This differs by task type. + internal Task(string id, DateTimeOffset? startedAt, DateTimeOffset? completedAt, DateTimeOffset? lastPolledAt, TaskState? state, TaskPhase? phase, string reason, IReadOnlyDictionary metadata) + { + Id = id; + StartedAt = startedAt; + CompletedAt = completedAt; + LastPolledAt = lastPolledAt; + State = state; + Phase = phase; + Reason = reason; + Metadata = metadata; + } + + /// The unique identifier of the task. + public string Id { get; } + /// The time the task started. + public DateTimeOffset? StartedAt { get; } + /// The time the task completed. + public DateTimeOffset? CompletedAt { get; } + /// The last time the status of the task was updated. + public DateTimeOffset? LastPolledAt { get; } + /// The state the task is in. + public TaskState? State { get; } + /// The phase the task is in. + public TaskPhase? Phase { get; } + /// The reason the task was moved into its current state, if the task wasn't completed. + public string Reason { get; } + /// + /// Attributes unique to the task. This differs by task type. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IReadOnlyDictionary Metadata { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskPhase.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskPhase.cs new file mode 100644 index 000000000000..31702f3728b4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskPhase.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The phase the task is in. + public readonly partial struct TaskPhase : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TaskPhase(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RunningValue = "running"; + private const string PollingValue = "polling"; + private const string CompleteValue = "complete"; + + /// running. + public static TaskPhase Running { get; } = new TaskPhase(RunningValue); + /// polling. + public static TaskPhase Polling { get; } = new TaskPhase(PollingValue); + /// complete. + public static TaskPhase Complete { get; } = new TaskPhase(CompleteValue); + /// Determines if two values are the same. + public static bool operator ==(TaskPhase left, TaskPhase right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TaskPhase left, TaskPhase right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TaskPhase(string value) => new TaskPhase(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TaskPhase other && Equals(other); + /// + public bool Equals(TaskPhase other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskState.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskState.cs new file mode 100644 index 000000000000..3eb2013794e4 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/TaskState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Analytics.Defender.Easm +{ + /// The state the task is in. + public readonly partial struct TaskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TaskState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "pending"; + private const string RunningValue = "running"; + private const string PausedValue = "paused"; + private const string CompleteValue = "complete"; + private const string IncompleteValue = "incomplete"; + private const string FailedValue = "failed"; + private const string WarningValue = "warning"; + + /// pending. + public static TaskState Pending { get; } = new TaskState(PendingValue); + /// running. + public static TaskState Running { get; } = new TaskState(RunningValue); + /// paused. + public static TaskState Paused { get; } = new TaskState(PausedValue); + /// complete. + public static TaskState Complete { get; } = new TaskState(CompleteValue); + /// incomplete. + public static TaskState Incomplete { get; } = new TaskState(IncompleteValue); + /// failed. + public static TaskState Failed { get; } = new TaskState(FailedValue); + /// warning. + public static TaskState Warning { get; } = new TaskState(WarningValue); + /// Determines if two values are the same. + public static bool operator ==(TaskState left, TaskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TaskState left, TaskState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TaskState(string value) => new TaskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TaskState other && Equals(other); + /// + public bool Equals(TaskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.Serialization.cs new file mode 100644 index 000000000000..e326cd2030bb --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + internal partial class UnknownAssetResource + { + internal static UnknownAssetResource DeserializeUnknownAssetResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = "Unknown"; + string id = default; + Optional name = default; + Optional displayName = default; + Optional uuid = default; + Optional createdDate = default; + Optional updatedDate = default; + Optional state = default; + Optional externalId = default; + Optional> labels = default; + Optional wildcard = default; + Optional discoGroupName = default; + Optional> auditTrail = default; + Optional reason = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("uuid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uuid = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new AssetState(property.Value.GetString()); + continue; + } + if (property.NameEquals("externalId"u8)) + { + externalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("labels"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } + if (property.NameEquals("wildcard"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + wildcard = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("discoGroupName"u8)) + { + discoGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("auditTrail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AuditTrailItem.DeserializeAuditTrailItem(item)); + } + auditTrail = array; + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + } + return new UnknownAssetResource(kind, id, name.Value, displayName.Value, Optional.ToNullable(uuid), Optional.ToNullable(createdDate), Optional.ToNullable(updatedDate), Optional.ToNullable(state), externalId.Value, Optional.ToList(labels), Optional.ToNullable(wildcard), discoGroupName.Value, Optional.ToList(auditTrail), reason.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownAssetResource FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownAssetResource(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.cs new file mode 100644 index 000000000000..45cd32d5bdee --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownAssetResource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Analytics.Defender.Easm +{ + /// Unknown version of AssetResource. + internal partial class UnknownAssetResource : AssetResource + { + /// Initializes a new instance of UnknownAssetResource. + internal UnknownAssetResource() + { + } + + /// Initializes a new instance of UnknownAssetResource. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// Global UUID for the asset. + /// The date this asset was first added to this workspace. + /// The date this asset was last updated for this workspace. + /// + /// An optional customer provided identifier for this asset. + /// Customer labels assigned to this asset. + /// An indicator of whether this asset represents a wildcard rollup of assets on this domain. + /// The name of the DiscoGroup that brought added this asset to the workspace. + /// The history of how this asset was pulled into the workspace through the discovery process. + /// + internal UnknownAssetResource(string kind, string id, string name, string displayName, Guid? uuid, DateTimeOffset? createdDate, DateTimeOffset? updatedDate, AssetState? state, string externalId, IReadOnlyList labels, bool? wildcard, string discoGroupName, IReadOnlyList auditTrail, string reason) : base(kind, id, name, displayName, uuid, createdDate, updatedDate, state, externalId, labels, wildcard, discoGroupName, auditTrail, reason) + { + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.Serialization.cs new file mode 100644 index 000000000000..637524646832 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + internal partial class UnknownDataConnection + { + internal static UnknownDataConnection DeserializeUnknownDataConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = "Unknown"; + Optional id = default; + string name = default; + Optional displayName = default; + Optional content = default; + Optional createdDate = default; + Optional frequency = default; + Optional frequencyOffset = default; + Optional updatedDate = default; + Optional userUpdatedAt = default; + Optional active = default; + Optional inactiveMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = new DataConnectionContent(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequency = new DataConnectionFrequency(property.Value.GetString()); + continue; + } + if (property.NameEquals("frequencyOffset"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + frequencyOffset = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("updatedDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("userUpdatedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userUpdatedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("active"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + active = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("inactiveMessage"u8)) + { + inactiveMessage = property.Value.GetString(); + continue; + } + } + return new UnknownDataConnection(kind, id.Value, name, displayName.Value, Optional.ToNullable(content), Optional.ToNullable(createdDate), Optional.ToNullable(frequency), Optional.ToNullable(frequencyOffset), Optional.ToNullable(updatedDate), Optional.ToNullable(userUpdatedAt), Optional.ToNullable(active), inactiveMessage.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new UnknownDataConnection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUnknownDataConnection(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs new file mode 100644 index 000000000000..58a044f81403 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/UnknownDataConnection.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Analytics.Defender.Easm +{ + /// Unknown version of DataConnection. + internal partial class UnknownDataConnection : DataConnection + { + /// Initializes a new instance of UnknownDataConnection. + internal UnknownDataConnection() + { + } + + /// Initializes a new instance of UnknownDataConnection. + /// Discriminator. + /// The system generated unique id for the resource. + /// The caller provided unique name for the resource. + /// The name that can be used for display purposes. + /// The type of data the data connection will transfer. + /// The date the data connection was created. + /// The rate at which the data connection will receive updates. + /// The day to update the data connection on. + /// The date the data connection was last updated. + /// The date the data connection was last updated by user. + /// An indicator of whether the data connection is active. + /// A message that specifies details about data connection if inactive. + internal UnknownDataConnection(string kind, string id, string name, string displayName, DataConnectionContent? content, DateTimeOffset? createdDate, DataConnectionFrequency? frequency, int? frequencyOffset, DateTimeOffset? updatedDate, DateTimeOffset? userUpdatedAt, bool? active, string inactiveMessage) : base(kind, id, name, displayName, content, createdDate, frequency, frequencyOffset, updatedDate, userUpdatedAt, active, inactiveMessage) + { + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.Serialization.cs new file mode 100644 index 000000000000..aca4b35729a5 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class ValidateResult + { + internal static ValidateResult DeserializeValidateResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ErrorDetail.DeserializeErrorDetail(property.Value); + continue; + } + } + return new ValidateResult(error.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ValidateResult FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeValidateResult(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.cs new file mode 100644 index 000000000000..92c40a8773ef --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/ValidateResult.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Analytics.Defender.Easm +{ + /// The ValidateResult. + public partial class ValidateResult + { + /// Initializes a new instance of ValidateResult. + internal ValidateResult() + { + } + + /// Initializes a new instance of ValidateResult. + /// This is the top-level error object whose code matches the x-ms-error-code response header. + internal ValidateResult(ErrorDetail error) + { + Error = error; + } + + /// This is the top-level error object whose code matches the x-ms-error-code response header. + public ErrorDetail Error { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.Serialization.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.Serialization.cs new file mode 100644 index 000000000000..236d9f118aa8 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + public partial class WebComponent + { + internal static WebComponent DeserializeWebComponent(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional name = default; + Optional type = default; + Optional version = default; + Optional> ruleId = default; + Optional firstSeen = default; + Optional lastSeen = default; + Optional count = default; + Optional> cve = default; + Optional endOfLife = default; + Optional recent = default; + Optional> ports = default; + Optional> sources = default; + Optional service = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("ruleId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ruleId = array; + continue; + } + if (property.NameEquals("firstSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firstSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSeen"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSeen = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("cve"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Easm.Cve.DeserializeCve(item)); + } + cve = array; + continue; + } + if (property.NameEquals("endOfLife"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endOfLife = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("recent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ports"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Port.DeserializePort(item)); + } + ports = array; + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Source.DeserializeSource(item)); + } + sources = array; + continue; + } + if (property.NameEquals("service"u8)) + { + service = property.Value.GetString(); + continue; + } + } + return new WebComponent(name.Value, type.Value, version.Value, Optional.ToList(ruleId), Optional.ToNullable(firstSeen), Optional.ToNullable(lastSeen), Optional.ToNullable(count), Optional.ToList(cve), Optional.ToNullable(endOfLife), Optional.ToNullable(recent), Optional.ToList(ports), Optional.ToList(sources), service.Value); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static WebComponent FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWebComponent(document.RootElement); + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.cs new file mode 100644 index 000000000000..5b09ef8d089d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/WebComponent.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.Analytics.Defender.Easm +{ + /// The WebComponent. + public partial class WebComponent + { + /// Initializes a new instance of WebComponent. + internal WebComponent() + { + RuleId = new ChangeTrackingList(); + Cve = new ChangeTrackingList(); + Ports = new ChangeTrackingList(); + Sources = new ChangeTrackingList(); + } + + /// Initializes a new instance of WebComponent. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal WebComponent(string name, string type, string version, IReadOnlyList ruleId, DateTimeOffset? firstSeen, DateTimeOffset? lastSeen, long? count, IReadOnlyList cve, long? endOfLife, bool? recent, IReadOnlyList ports, IReadOnlyList sources, string service) + { + Name = name; + Type = type; + Version = version; + RuleId = ruleId; + FirstSeen = firstSeen; + LastSeen = lastSeen; + Count = count; + Cve = cve; + EndOfLife = endOfLife; + Recent = recent; + Ports = ports; + Sources = sources; + Service = service; + } + + /// Gets the name. + public string Name { get; } + /// Gets the type. + public string Type { get; } + /// Gets the version. + public string Version { get; } + /// Gets the rule id. + public IReadOnlyList RuleId { get; } + /// Gets the first seen. + public DateTimeOffset? FirstSeen { get; } + /// Gets the last seen. + public DateTimeOffset? LastSeen { get; } + /// Gets the count. + public long? Count { get; } + /// Gets the cve. + public IReadOnlyList Cve { get; } + /// Gets the end of life. + public long? EndOfLife { get; } + /// Gets the recent. + public bool? Recent { get; } + /// Gets the ports. + public IReadOnlyList Ports { get; } + /// Gets the sources. + public IReadOnlyList Sources { get; } + /// Gets the service. + public string Service { get; } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Properties/AssemblyInfo.cs b/sdk/easm/Azure.Analytics.Defender.Easm/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..9449acb13dd0 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Analytics.Defender.Easm.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Azure.Analytics.Defender.Easm.Tests.csproj b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Azure.Analytics.Defender.Easm.Tests.csproj new file mode 100644 index 000000000000..3edfdfd718b9 --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Azure.Analytics.Defender.Easm.Tests.csproj @@ -0,0 +1,29 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs new file mode 100644 index 000000000000..872c577ca60d --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs @@ -0,0 +1,3513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure; +using Azure.Analytics.Defender.Easm; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Analytics.Defender.Easm.Samples +{ + public partial class Samples_EasmClient + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateAssets_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.UpdateAssets("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_UpdateAssets_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.UpdateAssetsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateAssets_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + AssetUpdateData assetUpdateData = new AssetUpdateData(); + Response response = client.UpdateAssets("", assetUpdateData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_UpdateAssets_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + AssetUpdateData assetUpdateData = new AssetUpdateData(); + Response response = await client.UpdateAssetsAsync("", assetUpdateData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateAssets_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + state = "candidate", + externalId = "", + labels = new + { + key = true, + }, + transfers = "as", + }); + Response response = client.UpdateAssets("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_UpdateAssets_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + state = "candidate", + externalId = "", + labels = new + { + key = true, + }, + transfers = "as", + }); + Response response = await client.UpdateAssetsAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_UpdateAssets_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + AssetUpdateData assetUpdateData = new AssetUpdateData + { + State = AssetUpdateState.Candidate, + ExternalId = "", + Labels = +{ +["key"] = true +}, + Transfers = AssetUpdateTransfers.As, + }; + Response response = client.UpdateAssets("", assetUpdateData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_UpdateAssets_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + AssetUpdateData assetUpdateData = new AssetUpdateData + { + State = AssetUpdateState.Candidate, + ExternalId = "", + Labels = +{ +["key"] = true +}, + Transfers = AssetUpdateTransfers.As, + }; + Response response = await client.UpdateAssetsAsync("", assetUpdateData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResource_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetAssetResource("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResource_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetAssetResourceAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResource_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetAssetResource(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResource_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetAssetResourceAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResource_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetAssetResource("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResource_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetAssetResourceAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResource_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetAssetResource(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResource_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetAssetResourceAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDataConnection_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new object(), + kind = "logAnalytics", + }); + Response response = client.ValidateDataConnection(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDataConnection_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new object(), + kind = "logAnalytics", + }); + Response response = await client.ValidateDataConnectionAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDataConnection_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); + Response response = client.ValidateDataConnection(dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDataConnection_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); + Response response = await client.ValidateDataConnectionAsync(dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDataConnection_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, + }); + Response response = client.ValidateDataConnection(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDataConnection_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, + }); + Response response = await client.ValidateDataConnectionAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDataConnection_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties + { + ApiKey = "", + WorkspaceId = "", + }) + { + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, + }; + Response response = client.ValidateDataConnection(dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDataConnection_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties + { + ApiKey = "", + WorkspaceId = "", + }) + { + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, + }; + Response response = await client.ValidateDataConnectionAsync(dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnection_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDataConnection("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnection_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDataConnectionAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnection_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDataConnection(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnection_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDataConnectionAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnection_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDataConnection("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnection_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDataConnectionAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnection_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDataConnection(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnection_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDataConnectionAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDataConnection_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new object(), + kind = "logAnalytics", + }); + Response response = client.CreateOrReplaceDataConnection("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDataConnection_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new object(), + kind = "logAnalytics", + }); + Response response = await client.CreateOrReplaceDataConnectionAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDataConnection_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); + Response response = client.CreateOrReplaceDataConnection("", dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDataConnection_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties()); + Response response = await client.CreateOrReplaceDataConnectionAsync("", dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDataConnection_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, + }); + Response response = client.CreateOrReplaceDataConnection("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDataConnection_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + properties = new + { + apiKey = "", + workspaceId = "", + }, + kind = "logAnalytics", + name = "", + content = "assets", + frequency = "daily", + frequencyOffset = 1234, + }); + Response response = await client.CreateOrReplaceDataConnectionAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDataConnection_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties + { + ApiKey = "", + WorkspaceId = "", + }) + { + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, + }; + Response response = client.CreateOrReplaceDataConnection("", dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDataConnection_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DataConnectionData dataConnectionData = new LogAnalyticsDataConnectionData(new LogAnalyticsDataConnectionProperties + { + ApiKey = "", + WorkspaceId = "", + }) + { + Name = "", + Content = DataConnectionContent.Assets, + Frequency = DataConnectionFrequency.Daily, + FrequencyOffset = 1234, + }; + Response response = await client.CreateOrReplaceDataConnectionAsync("", dataConnectionData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteDataConnection_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.DeleteDataConnection(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_DeleteDataConnection_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.DeleteDataConnectionAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteDataConnection_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.DeleteDataConnection(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_DeleteDataConnection_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.DeleteDataConnectionAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDiscoGroup_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.ValidateDiscoGroup(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDiscoGroup_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.ValidateDiscoGroupAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDiscoGroup_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData(); + Response response = client.ValidateDiscoGroup(discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDiscoGroup_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData(); + Response response = await client.ValidateDiscoGroupAsync(discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDiscoGroup_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { +new +{ +kind = "as", +name = "", +} + }, + names = new object[] + { +"" + }, + excludes = new object[] + { +null + }, + templateId = "", + }); + Response response = client.ValidateDiscoGroup(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDiscoGroup_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { +new +{ +kind = "as", +name = "", +} + }, + names = new object[] + { +"" + }, + excludes = new object[] + { +null + }, + templateId = "", + }); + Response response = await client.ValidateDiscoGroupAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); + Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_ValidateDiscoGroup_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData + { + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource +{ +Kind = DiscoSourceKind.As, +Name = "", +}}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", + }; + Response response = client.ValidateDiscoGroup(discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_ValidateDiscoGroup_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData + { + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource +{ +Kind = DiscoSourceKind.As, +Name = "", +}}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", + }; + Response response = await client.ValidateDiscoGroupAsync(discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroup_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoGroup("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroup_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoGroupAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroup_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoGroup(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroup_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoGroupAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroup_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoGroup("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroup_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoGroupAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroup_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoGroup(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroup_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoGroupAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDiscoGroup_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.CreateOrReplaceDiscoGroup("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDiscoGroup_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.CreateOrReplaceDiscoGroupAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDiscoGroup_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData(); + Response response = client.CreateOrReplaceDiscoGroup("", discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDiscoGroup_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData(); + Response response = await client.CreateOrReplaceDiscoGroupAsync("", discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDiscoGroup_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { +new +{ +kind = "as", +name = "", +} + }, + names = new object[] + { +"" + }, + excludes = new object[] + { +null + }, + templateId = "", + }); + Response response = client.CreateOrReplaceDiscoGroup("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDiscoGroup_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + name = "", + description = "", + tier = "", + frequencyMilliseconds = 1234L, + seeds = new object[] + { +new +{ +kind = "as", +name = "", +} + }, + names = new object[] + { +"" + }, + excludes = new object[] + { +null + }, + templateId = "", + }); + Response response = await client.CreateOrReplaceDiscoGroupAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceDiscoGroup_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData + { + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource +{ +Kind = DiscoSourceKind.As, +Name = "", +}}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", + }; + Response response = client.CreateOrReplaceDiscoGroup("", discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceDiscoGroup_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + DiscoGroupData discoGroupData = new DiscoGroupData + { + Name = "", + Description = "", + Tier = "", + FrequencyMilliseconds = 1234L, + Seeds = {new DiscoSource +{ +Kind = DiscoSourceKind.As, +Name = "", +}}, + Names = { "" }, + Excludes = { default }, + TemplateId = "", + }; + Response response = await client.CreateOrReplaceDiscoGroupAsync("", discoGroupData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RunDiscoGroup_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.RunDiscoGroup(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_RunDiscoGroup_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.RunDiscoGroupAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RunDiscoGroup_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.RunDiscoGroup(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_RunDiscoGroup_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.RunDiscoGroupAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplate_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoTemplate("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplate_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoTemplateAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplate_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoTemplate(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplate_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoTemplateAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplate_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoTemplate("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplate_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoTemplateAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplate_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetDiscoTemplate(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplate_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetDiscoTemplateAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetBillable_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetBillable(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetBillable_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetBillableAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetBillable_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetBillable(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetBillable_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetBillableAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetBillable_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetBillable(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("date").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("count").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetBillable_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetBillableAsync(null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("date").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("total").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("assetBreakdown")[0].GetProperty("count").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetBillable_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetBillable(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetBillable_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetBillableAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSnapshot_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.GetSnapshot(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSnapshot_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.GetSnapshotAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSnapshot_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest(); + Response response = client.GetSnapshot(reportAssetSnapshotRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSnapshot_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest(); + Response response = await client.GetSnapshotAsync(reportAssetSnapshotRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSnapshot_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "", + labelName = "", + size = 1234, + page = 1234, + }); + Response response = client.GetSnapshot(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("metric").ToString()); + Console.WriteLine(result.GetProperty("labelName").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("totalElements").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("mark").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("nextLink").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("reason").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSnapshot_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + metric = "", + labelName = "", + size = 1234, + page = 1234, + }); + Response response = await client.GetSnapshotAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("metric").ToString()); + Console.WriteLine(result.GetProperty("labelName").ToString()); + Console.WriteLine(result.GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("totalElements").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("mark").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("nextLink").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("assets").GetProperty("value")[0].GetProperty("reason").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSnapshot_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest + { + Metric = "", + LabelName = "", + Size = 1234, + Page = 1234, + }; + Response response = client.GetSnapshot(reportAssetSnapshotRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSnapshot_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSnapshotRequest reportAssetSnapshotRequest = new ReportAssetSnapshotRequest + { + Metric = "", + LabelName = "", + Size = 1234, + Page = 1234, + }; + Response response = await client.GetSnapshotAsync(reportAssetSnapshotRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSummary_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.GetSummary(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSummary_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.GetSummaryAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSummary_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest(); + Response response = client.GetSummary(reportAssetSummaryRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSummary_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest(); + Response response = await client.GetSummaryAsync(reportAssetSummaryRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSummary_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + metricCategories = new object[] + { +"" + }, + metrics = new object[] + { +"" + }, + filters = new object[] + { +"" + }, + groupBy = "", + segmentBy = "", + labelName = "", + }); + Response response = client.GetSummary(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metricCategory").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metric").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("labelName").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("count").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("link").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSummary_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + metricCategories = new object[] + { +"" + }, + metrics = new object[] + { +"" + }, + filters = new object[] + { +"" + }, + groupBy = "", + segmentBy = "", + labelName = "", + }); + Response response = await client.GetSummaryAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("updatedAt").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metricCategory").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metric").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("labelName").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("count").ToString()); + Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("link").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSummary_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest + { + MetricCategories = { "" }, + Metrics = { "" }, + Filters = { "" }, + GroupBy = "", + SegmentBy = "", + LabelName = "", + }; + Response response = client.GetSummary(reportAssetSummaryRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSummary_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + ReportAssetSummaryRequest reportAssetSummaryRequest = new ReportAssetSummaryRequest + { + MetricCategories = { "" }, + Metrics = { "" }, + Filters = { "" }, + GroupBy = "", + SegmentBy = "", + LabelName = "", + }; + Response response = await client.GetSummaryAsync(reportAssetSummaryRequest); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilter_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetSavedFilter("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilter_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetSavedFilterAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilter_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetSavedFilter(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilter_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetSavedFilterAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilter_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetSavedFilter("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilter_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetSavedFilterAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilter_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetSavedFilter(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilter_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetSavedFilterAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceSavedFilter_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "", + description = "", + }); + Response response = client.CreateOrReplaceSavedFilter("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceSavedFilter_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "", + description = "", + }); + Response response = await client.CreateOrReplaceSavedFilterAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceSavedFilter_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + SavedFilterData savedFilterData = new SavedFilterData("", ""); + Response response = client.CreateOrReplaceSavedFilter("", savedFilterData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceSavedFilter_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + SavedFilterData savedFilterData = new SavedFilterData("", ""); + Response response = await client.CreateOrReplaceSavedFilterAsync("", savedFilterData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceSavedFilter_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "", + description = "", + }); + Response response = client.CreateOrReplaceSavedFilter("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceSavedFilter_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + using RequestContent content = RequestContent.Create(new + { + filter = "", + description = "", + }); + Response response = await client.CreateOrReplaceSavedFilterAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CreateOrReplaceSavedFilter_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + SavedFilterData savedFilterData = new SavedFilterData("", ""); + Response response = client.CreateOrReplaceSavedFilter("", savedFilterData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CreateOrReplaceSavedFilter_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + SavedFilterData savedFilterData = new SavedFilterData("", ""); + Response response = await client.CreateOrReplaceSavedFilterAsync("", savedFilterData); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteSavedFilter_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.DeleteSavedFilter(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_DeleteSavedFilter_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.DeleteSavedFilterAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DeleteSavedFilter_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.DeleteSavedFilter(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_DeleteSavedFilter_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.DeleteSavedFilterAsync(""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTask_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetTask("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTask_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetTaskAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTask_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetTask(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTask_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetTaskAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTask_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetTask("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTask_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetTaskAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTask_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.GetTask(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTask_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.GetTaskAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelTask_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.CancelTask("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CancelTask_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.CancelTaskAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelTask_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.CancelTask(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CancelTask_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.CancelTaskAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelTask_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.CancelTask("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CancelTask_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.CancelTaskAsync("", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_CancelTask_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = client.CancelTask(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_CancelTask_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + Response response = await client.CancelTaskAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResources_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetAssetResources(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResources_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetAssetResourcesAsync(null, null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResources_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (AssetResource item in client.GetAssetResources()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResources_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (AssetResource item in client.GetAssetResourcesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResources_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetAssetResources("", "", 1234, 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResources_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetAssetResourcesAsync("", "", 1234, 1234, "", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("uuid").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("externalId").ToString()); + Console.WriteLine(result.GetProperty("labels")[0].ToString()); + Console.WriteLine(result.GetProperty("wildcard").ToString()); + Console.WriteLine(result.GetProperty("discoGroupName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetAssetResources_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (AssetResource item in client.GetAssetResources(filter: "", orderby: "", skip: 1234, maxpagesize: 1234, mark: "")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetAssetResources_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (AssetResource item in client.GetAssetResourcesAsync(filter: "", orderby: "", skip: 1234, maxpagesize: 1234, mark: "")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnections_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDataConnections(null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnections_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDataConnectionsAsync(null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnections_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DataConnection item in client.GetDataConnections()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnections_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DataConnection item in client.GetDataConnectionsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnections_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDataConnections(1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnections_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDataConnectionsAsync(1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("content").ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("frequency").ToString()); + Console.WriteLine(result.GetProperty("frequencyOffset").ToString()); + Console.WriteLine(result.GetProperty("updatedDate").ToString()); + Console.WriteLine(result.GetProperty("userUpdatedAt").ToString()); + Console.WriteLine(result.GetProperty("active").ToString()); + Console.WriteLine(result.GetProperty("inactiveMessage").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDataConnections_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DataConnection item in client.GetDataConnections(skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDataConnections_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DataConnection item in client.GetDataConnectionsAsync(skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroups_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDiscoGroups(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroups_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDiscoGroupsAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroups_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoGroup item in client.GetDiscoGroups()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroups_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoGroup item in client.GetDiscoGroupsAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroups_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDiscoGroups("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroups_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDiscoGroupsAsync("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); + Console.WriteLine(result.GetProperty("createdDate").ToString()); + Console.WriteLine(result.GetProperty("templateId").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoGroups_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoGroup item in client.GetDiscoGroups(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoGroups_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoGroup item in client.GetDiscoGroupsAsync(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRuns_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetRuns("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetRuns_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetRunsAsync("", null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRuns_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoRunResult item in client.GetRuns("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetRuns_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoRunResult item in client.GetRunsAsync("")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRuns_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetRuns("", "", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetRuns_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetRunsAsync("", "", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("submittedDate").ToString()); + Console.WriteLine(result.GetProperty("startedDate").ToString()); + Console.WriteLine(result.GetProperty("completedDate").ToString()); + Console.WriteLine(result.GetProperty("tier").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetRuns_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoRunResult item in client.GetRuns("", filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetRuns_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoRunResult item in client.GetRunsAsync("", filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplates_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDiscoTemplates(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplates_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDiscoTemplatesAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplates_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoTemplate item in client.GetDiscoTemplates()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplates_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoTemplate item in client.GetDiscoTemplatesAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplates_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetDiscoTemplates("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplates_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetDiscoTemplatesAsync("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("industry").ToString()); + Console.WriteLine(result.GetProperty("region").ToString()); + Console.WriteLine(result.GetProperty("countryCode").ToString()); + Console.WriteLine(result.GetProperty("stateCode").ToString()); + Console.WriteLine(result.GetProperty("city").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("names")[0].ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetDiscoTemplates_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (DiscoTemplate item in client.GetDiscoTemplates(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetDiscoTemplates_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (DiscoTemplate item in client.GetDiscoTemplatesAsync(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilters_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetSavedFilters(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilters_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetSavedFiltersAsync(null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilters_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (SavedFilter item in client.GetSavedFilters()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilters_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (SavedFilter item in client.GetSavedFiltersAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilters_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetSavedFilters("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilters_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetSavedFiltersAsync("", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("filter").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetSavedFilters_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (SavedFilter item in client.GetSavedFilters(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetSavedFilters_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (SavedFilter item in client.GetSavedFiltersAsync(filter: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTasks_ShortVersion() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetTasks(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTasks_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetTasksAsync(null, null, null, null, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTasks_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (Task item in client.GetTasks()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTasks_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (Task item in client.GetTasksAsync()) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTasks_AllParameters() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (BinaryData item in client.GetTasks("", "", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTasks_AllParameters_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (BinaryData item in client.GetTasksAsync("", "", 1234, 1234, null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("startedAt").ToString()); + Console.WriteLine(result.GetProperty("completedAt").ToString()); + Console.WriteLine(result.GetProperty("lastPolledAt").ToString()); + Console.WriteLine(result.GetProperty("state").ToString()); + Console.WriteLine(result.GetProperty("phase").ToString()); + Console.WriteLine(result.GetProperty("reason").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_GetTasks_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + foreach (Task item in client.GetTasks(filter: "", orderby: "", skip: 1234, maxpagesize: 1234)) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async System.Threading.Tasks.Task Example_GetTasks_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + EasmClient client = new EasmClient(endpoint, "", "", "", credential); + + await foreach (Task item in client.GetTasksAsync(filter: "", orderby: "", skip: 1234, maxpagesize: 1234)) + { + } + } + } +} diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml new file mode 100644 index 000000000000..7eeadc00263e --- /dev/null +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/riskiq/Easm +additionalDirectories: [] +repo: Azure/azure-rest-api-specs +commit: 6365dbb61c4be5f2b5afa1b499dc27d101c0233c + diff --git a/sdk/easm/ci.yml b/sdk/easm/ci.yml new file mode 100644 index 000000000000..96f0f73c2b66 --- /dev/null +++ b/sdk/easm/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/easm + - sdk/easm/ci.yml + - sdk/easm/Azure.Analytics.Defender.Easm + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/easm + - sdk/easm/ci.yml + - sdk/easm/Azure.Analytics.Defender.Easm + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: easm + ArtifactName: packages + Artifacts: + - name: Azure.Analytics.Defender.Easm + safeName: AzureAnalyticsDefenderEasm