From 98b399f9187013d9f7a7ad8ca6f7bee996f19da1 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Sun, 8 Oct 2023 16:43:17 +0800 Subject: [PATCH] fix pageable operation issue in purview administration library (#39009) --- .../assets.json | 2 +- .../src/Generated/Docs/PurviewCollection.xml | 2 + .../Docs/PurviewMetadataPolicyClient.xml | 52 +++++++++++++++++++ .../Docs/PurviewMetadataRolesClient.xml | 42 +++++++++++++++ .../Generated/PurviewMetadataPolicyClient.cs | 10 ++-- .../Generated/PurviewMetadataRolesClient.cs | 6 +-- .../src/autorest.md | 4 +- .../Samples/Samples_PurviewCollection.cs | 2 + .../Samples_PurviewMetadataPolicyClient.cs | 52 +++++++++++++++++++ .../Samples_PurviewMetadataRolesClient.cs | 43 +++++++++++++++ .../tests/MetadataRolesClientTest.cs | 2 +- 11 files changed, 205 insertions(+), 12 deletions(-) diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/assets.json b/sdk/purview/Azure.Analytics.Purview.Administration/assets.json index 7151bbb630304..d6a63dd12ef32 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/assets.json +++ b/sdk/purview/Azure.Analytics.Purview.Administration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/purview/Azure.Analytics.Purview.Administration", - "Tag": "net/purview/Azure.Analytics.Purview.Administration_6bb65ebe43" + "Tag": "net/purview/Azure.Analytics.Purview.Administration_01092e8843" } diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewCollection.xml b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewCollection.xml index 6346b77e16ef3..1efb2abd19f06 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewCollection.xml +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewCollection.xml @@ -100,6 +100,7 @@ RequestContent content = RequestContent.Create(new parentCollection = new { referenceName = "", + type = "", }, }); Response response = await client.CreateOrUpdateCollectionAsync(content); @@ -146,6 +147,7 @@ RequestContent content = RequestContent.Create(new parentCollection = new { referenceName = "", + type = "", }, }); Response response = client.CreateOrUpdateCollection(content); diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataPolicyClient.xml b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataPolicyClient.xml index 5ac94438c086f..3f251eb4eb55f 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataPolicyClient.xml +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataPolicyClient.xml @@ -73,6 +73,7 @@ RequestContent content = RequestContent.Create(new }, collection = new { + type = "", referenceName = "", }, parentCollectionName = "", @@ -177,6 +178,7 @@ RequestContent content = RequestContent.Create(new }, collection = new { + type = "", referenceName = "", }, parentCollectionName = "", @@ -311,6 +313,8 @@ PurviewMetadataPolicyClient client = new PurviewMetadataPolicyClient(endpoint, " await foreach (BinaryData item in client.GetMetadataPoliciesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } ]]> This sample shows how to call GetMetadataPoliciesAsync with all parameters and parse the result. @@ -321,6 +325,29 @@ PurviewMetadataPolicyClient client = new PurviewMetadataPolicyClient(endpoint, " await foreach (BinaryData item in client.GetMetadataPoliciesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("effect").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("referenceName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("parentCollectionName").ToString()); } ]]> @@ -334,6 +361,8 @@ PurviewMetadataPolicyClient client = new PurviewMetadataPolicyClient(endpoint, " foreach (BinaryData item in client.GetMetadataPolicies(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } ]]> This sample shows how to call GetMetadataPolicies with all parameters and parse the result. @@ -344,6 +373,29 @@ PurviewMetadataPolicyClient client = new PurviewMetadataPolicyClient(endpoint, " foreach (BinaryData item in client.GetMetadataPolicies(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("effect").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("referenceName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("parentCollectionName").ToString()); } ]]> diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataRolesClient.xml b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataRolesClient.xml index 806c32b02e551..a3152c57481bd 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataRolesClient.xml +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/Docs/PurviewMetadataRolesClient.xml @@ -11,6 +11,8 @@ PurviewMetadataRolesClient client = new PurviewMetadataRolesClient(endpoint, cre await foreach (BinaryData item in client.GetMetadataRolesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } ]]> This sample shows how to call GetMetadataRolesAsync with all parameters and parse the result. @@ -21,6 +23,25 @@ PurviewMetadataRolesClient client = new PurviewMetadataRolesClient(endpoint, cre await foreach (BinaryData item in client.GetMetadataRolesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("roleType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("friendlyName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("version").ToString()); } ]]> @@ -34,6 +55,8 @@ PurviewMetadataRolesClient client = new PurviewMetadataRolesClient(endpoint, cre foreach (BinaryData item in client.GetMetadataRoles(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } ]]> This sample shows how to call GetMetadataRoles with all parameters and parse the result. @@ -44,6 +67,25 @@ PurviewMetadataRolesClient client = new PurviewMetadataRolesClient(endpoint, cre foreach (BinaryData item in client.GetMetadataRoles(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("roleType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("friendlyName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("version").ToString()); } ]]> diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataPolicyClient.cs b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataPolicyClient.cs index 4996088a24c7a..7fede29cadc65 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataPolicyClient.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataPolicyClient.cs @@ -195,7 +195,7 @@ public virtual AsyncPageable GetMetadataPoliciesAsync(RequestContext { HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMetadataPoliciesRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMetadataPoliciesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataPolicyClient.GetMetadataPolicies", "value", "nextLink", context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataPolicyClient.GetMetadataPolicies", "values", "nextLink", context); } /// @@ -216,7 +216,7 @@ public virtual Pageable GetMetadataPolicies(RequestContext context) { HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMetadataPoliciesRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMetadataPoliciesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataPolicyClient.GetMetadataPolicies", "value", "nextLink", context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataPolicyClient.GetMetadataPolicies", "values", "nextLink", context); } internal HttpMessage CreateGetMetadataPoliciesRequest(RequestContext context) @@ -228,7 +228,7 @@ internal HttpMessage CreateGetMetadataPoliciesRequest(RequestContext context) uri.Reset(_endpoint); uri.AppendRaw("/policyStore", false); uri.AppendPath("/metadataPolicies", false); - uri.AppendQuery("api-version", "2021-07-01", true); + uri.AppendQuery("api-version", "2021-07-01-preview", true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; @@ -244,7 +244,7 @@ internal HttpMessage CreateUpdateMetadataPolicyRequest(string policyId, RequestC uri.AppendRaw("/policyStore", false); uri.AppendPath("/metadataPolicies/", false); uri.AppendPath(policyId, true); - uri.AppendQuery("api-version", "2021-07-01", true); + uri.AppendQuery("api-version", "2021-07-01-preview", true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); @@ -262,7 +262,7 @@ internal HttpMessage CreateGetMetadataPolicyRequest(string policyId, RequestCont uri.AppendRaw("/policyStore", false); uri.AppendPath("/metadataPolicies/", false); uri.AppendPath(policyId, true); - uri.AppendQuery("api-version", "2021-07-01", true); + uri.AppendQuery("api-version", "2021-07-01-preview", true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataRolesClient.cs b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataRolesClient.cs index 1aa5a9038a4e3..7463158a2a792 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataRolesClient.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/Generated/PurviewMetadataRolesClient.cs @@ -51,7 +51,7 @@ public virtual AsyncPageable GetMetadataRolesAsync(RequestContext co { HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMetadataRolesRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMetadataRolesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataRolesClient.GetMetadataRoles", "value", "nextLink", context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataRolesClient.GetMetadataRoles", "values", "nextLink", context); } /// @@ -72,7 +72,7 @@ public virtual Pageable GetMetadataRoles(RequestContext context) { HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetMetadataRolesRequest(context); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetMetadataRolesNextPageRequest(nextLink, context); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataRolesClient.GetMetadataRoles", "value", "nextLink", context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "PurviewMetadataRolesClient.GetMetadataRoles", "values", "nextLink", context); } internal HttpMessage CreateGetMetadataRolesRequest(RequestContext context) @@ -84,7 +84,7 @@ internal HttpMessage CreateGetMetadataRolesRequest(RequestContext context) uri.Reset(_endpoint); uri.AppendRaw("/policyStore", false); uri.AppendPath("/metadataRoles", false); - uri.AppendQuery("api-version", "2021-07-01", true); + uri.AppendQuery("api-version", "2021-07-01-preview", true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/src/autorest.md b/sdk/purview/Azure.Analytics.Purview.Administration/src/autorest.md index 564a5dfe9cd5f..44b3da58b988d 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/src/autorest.md +++ b/sdk/purview/Azure.Analytics.Purview.Administration/src/autorest.md @@ -5,8 +5,8 @@ Run `dotnet build /t:GenerateCode` to generate code. ```yaml title: PurviewAdministration input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/b2bddfe2e59b5b14e559e0433b6e6d057bcff95d/specification/purview/data-plane/Azure.Analytics.Purview.Account/preview/2019-11-01-preview/account.json - - https://github.com/Azure/azure-rest-api-specs/blob/1424fc4a1f82af852a626c6ab6d1d296b5fe4df1/specification/purview/data-plane/Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01/purviewMetadataPolicy.json + - https://github.com/Azure/azure-rest-api-specs/blob/0ebd4949e8e1cd9537ca5a07384c7661162cc7a6/specification/purview/data-plane/Azure.Analytics.Purview.Account/preview/2019-11-01-preview/account.json + - https://github.com/Azure/azure-rest-api-specs/blob/0ebd4949e8e1cd9537ca5a07384c7661162cc7a6/specification/purview/data-plane/Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01-preview/purviewMetadataPolicy.json namespace: Azure.Analytics.Purview.Administration modelerfour: lenient-model-deduplication: true diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewCollection.cs b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewCollection.cs index 6a684bcbf0510..60c1667e3eaec 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewCollection.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewCollection.cs @@ -141,6 +141,7 @@ public void Example_CreateOrUpdateCollection_AllParameters() parentCollection = new { referenceName = "", + type = "", }, }); Response response = client.CreateOrUpdateCollection(content); @@ -175,6 +176,7 @@ public async Task Example_CreateOrUpdateCollection_AllParameters_Async() parentCollection = new { referenceName = "", + type = "", }, }); Response response = await client.CreateOrUpdateCollectionAsync(content); diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataPolicyClient.cs b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataPolicyClient.cs index 47446903eef4c..8b941f0c08412 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataPolicyClient.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataPolicyClient.cs @@ -108,6 +108,7 @@ public void Example_UpdateMetadataPolicy_AllParameters() }, collection = new { + type = "", referenceName = "", }, parentCollectionName = "", @@ -200,6 +201,7 @@ public async Task Example_UpdateMetadataPolicy_AllParameters_Async() }, collection = new { + type = "", referenceName = "", }, parentCollectionName = "", @@ -340,6 +342,8 @@ public void Example_GetMetadataPolicies_ShortVersion() foreach (BinaryData item in client.GetMetadataPolicies(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } } @@ -353,6 +357,8 @@ public async Task Example_GetMetadataPolicies_ShortVersion_Async() await foreach (BinaryData item in client.GetMetadataPoliciesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } } @@ -366,6 +372,29 @@ public void Example_GetMetadataPolicies_AllParameters() foreach (BinaryData item in client.GetMetadataPolicies(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("effect").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("referenceName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("parentCollectionName").ToString()); } } @@ -379,6 +408,29 @@ public async Task Example_GetMetadataPolicies_AllParameters_Async() await foreach (BinaryData item in client.GetMetadataPoliciesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("effect").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("decisionRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("kind").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("attributeRules")[0].GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("collection").GetProperty("referenceName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("parentCollectionName").ToString()); } } } diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataRolesClient.cs b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataRolesClient.cs index 74847864753f8..cbe8b7bfd0631 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataRolesClient.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/tests/Generated/Samples/Samples_PurviewMetadataRolesClient.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Text.Json; using System.Threading.Tasks; using Azure.Analytics.Purview.Administration; using Azure.Core; @@ -26,6 +27,8 @@ public void Example_GetMetadataRoles_ShortVersion() foreach (BinaryData item in client.GetMetadataRoles(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } } @@ -39,6 +42,8 @@ public async Task Example_GetMetadataRoles_ShortVersion_Async() await foreach (BinaryData item in client.GetMetadataRolesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.ToString()); } } @@ -52,6 +57,25 @@ public void Example_GetMetadataRoles_AllParameters() foreach (BinaryData item in client.GetMetadataRoles(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("roleType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("friendlyName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("version").ToString()); } } @@ -65,6 +89,25 @@ public async Task Example_GetMetadataRoles_AllParameters_Async() await foreach (BinaryData item in client.GetMetadataRolesAsync(null)) { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("provisioningState").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("roleType").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("friendlyName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("cnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeName").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueIncludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludes").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("dnfCondition")[0][0].GetProperty("attributeValueExcludedIn")[0].ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("version").ToString()); } } } diff --git a/sdk/purview/Azure.Analytics.Purview.Administration/tests/MetadataRolesClientTest.cs b/sdk/purview/Azure.Analytics.Purview.Administration/tests/MetadataRolesClientTest.cs index cddc2a496830c..8c51513e7aa19 100644 --- a/sdk/purview/Azure.Analytics.Purview.Administration/tests/MetadataRolesClientTest.cs +++ b/sdk/purview/Azure.Analytics.Purview.Administration/tests/MetadataRolesClientTest.cs @@ -25,7 +25,7 @@ public async Task List() { using var jsonDocument = JsonDocument.Parse(item); JsonElement fetchBodyJson = jsonDocument.RootElement; - Assert.Equals(fetchBodyJson.GetProperty("id").ToString().StartsWith("purviewmetadatarole"), true); + Assert.AreEqual(fetchBodyJson.GetProperty("id").ToString().StartsWith("purviewmetadatarole"), true); } }