diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/CHANGELOG.md b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/CHANGELOG.md
new file mode 100644
index 000000000000..6bb129c6bb9a
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/CHANGELOG.md
@@ -0,0 +1,4 @@
+# Release History
+
+## 1.0.0-preview.1 (Unreleased)
+- Initial release
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/Directory.Build.props b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/Directory.Build.props
new file mode 100644
index 000000000000..1a9611bd4924
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md
new file mode 100644
index 000000000000..dc637fb70acf
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/README.md
@@ -0,0 +1,121 @@
+# Azure Synapse Analytics Access Control client library for .NET
+
+This directory contains the open source subset of the .NET SDK. For documentation of the complete Azure SDK, please see the [Microsoft Azure .NET Developer Center](http://azure.microsoft.com/en-us/develop/net/).
+
+The Azure Synapse Analytics access control client library enables programmatically managing role assignments.
+
+Azure Synapse is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless on-demand or provisioned resources—at scale. Azure Synapse brings these two worlds together with a unified experience to ingest, prepare, manage, and serve data for immediate BI and machine learning needs.
+
+## Getting started
+
+The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure Downloads Page](http://azure.microsoft.com/en-us/downloads/?sdk=net) and ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more.
+
+For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes.
+
+### Install the package
+Install the Azure Synapse Analytics access control client library for .NET with [NuGet][nuget]:
+
+```PowerShell
+dotnet add package Azure.Analytics.Synapse.AccessControl --version 0.1.0-preview.1
+```
+
+### Prerequisites
+* An [Azure subscription][azure_sub].
+* An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the Azure Portal or [Azure CLI][azure_cli].
+
+If you use the Azure CLI, the command looks like below:
+
+```PowerShell
+az synapse workspace create \
+ --name \
+ --resource-group \
+ --storage-account \
+ --file-system \
+ --sql-admin-login-user \
+ --sql-admin-login-password \
+ --location
+```
+
+### Authenticate the client
+In order to interact with the Azure Synapse Analytics service, you'll need to create an instance of the [AccessControlClient][accesscontrol_client_class] class. You need a **workspace endpoint**, which you may see as "Development endpoint" in the portal,
+ and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object.
+
+Client secret credential authentication is being used in this getting started section but you can find more ways to authenticate with [Azure identity][azure_identity]. To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below,
+or other credential providers provided with the Azure SDK, you should install the Azure.Identity package:
+
+```PowerShell
+Install-Package Azure.Identity
+```
+
+## Key concepts
+
+### AccessControlClient
+With a `AccessControlClient` you can get role assignments from the workspace, create new role assignments, and delete role assignments.
+
+### Role Assignment
+The way you control access to Synapse resources is to create role assignments. A role assignment is the process of attaching a role definition to a user, group, service principal, or managed identity at a particular scope for the purpose of granting access. Access is granted by creating a role assignment, and access is revoked by removing a role assignment.
+
+## Examples
+The Azure.Analytics.Synapse.AccessControl package supports synchronous and asynchronous APIs. The following section covers some of the most common Azure Synapse Analytics access control related tasks:
+
+### Role assignment examples
+* [Create a role assignment](#create-a-role-assignment)
+* [Retrieve a role assignment](#retrieve-a-role-assignment)
+* [List role assignments](#list-role-assignments)
+* [Delete a role assignment](#delete-a-role-assignment)
+
+### Create a role assignment
+
+`CreateRoleAssignment` creates a role assignment.
+
+```C# Snippet:CreateRoleAssignment
+RoleAssignmentOptions options = new RoleAssignmentOptions(sqlAdminRoleId, principalId);
+RoleAssignmentDetails roleAssignment = client.CreateRoleAssignment(options);
+```
+
+### Retrieve a role assignment
+
+`GetRoleAssignmentById` retrieves a role assignment by the given principal ID.
+
+```C# Snippet:RetrieveRoleAssignment
+RoleAssignmentDetails roleAssignment = client.GetRoleAssignmentById(principalId);
+```
+
+### List role assignments
+`GetRoleAssignments` enumerates the role assignments in the Synapse workspace.
+
+```C# Snippet:ListRoleAssignments
+IReadOnlyList roleAssignments = client.GetRoleAssignments().Value;
+foreach (RoleAssignmentDetails assignment in roleAssignments)
+{
+ Console.WriteLine(assignment.Id);
+}
+```
+
+### Delete a role assignment
+
+`DeleteRoleAssignmentById` deletes a role assignment by the given principal ID.
+
+```C# Snippet:DeleteRoleAssignment
+client.DeleteRoleAssignmentById(roleAssignment.Id);
+```
+
+## To build
+
+For information on building the Azure Synapse client library, please see [Building the Microsoft Azure SDK for .NET](https://github.com/azure/azure-sdk-for-net#to-build)
+
+## Target frameworks
+
+For information about the target frameworks of the Azure Synapse client library, please refer to the [Target Frameworks](https://github.com/azure/azure-sdk-for-net#target-frameworks) of the Microsoft Azure SDK for .NET.
+
+## Troubleshooting
+
+Please open issue in github.
+
+## Next steps
+
+The next step is adding more examples
+
+## Contributing
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Azure.Analytics.Synapse.AccessControl.csproj b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Azure.Analytics.Synapse.AccessControl.csproj
new file mode 100644
index 000000000000..00b27cd3219e
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Azure.Analytics.Synapse.AccessControl.csproj
@@ -0,0 +1,43 @@
+
+
+ This is the Microsoft Azure Synapse Analytics Access Control client library
+ Azure.Analytics.Synapse.AccessControl
+ 1.0.0-preview.1
+ Microsoft Azure Synapse Access Control;$(PackageCommonTags)
+ $(RequiredTargetFrameworks)
+ false
+
+
+ $(NoWarn);
+ SA1649;
+ CA1812;
+
+ CS1591;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClient.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClient.cs
new file mode 100644
index 000000000000..3d129c863d59
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.AccessControl
+{
+ public partial class AccessControlClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public AccessControlClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, AccessControlClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public AccessControlClient(Uri endpoint, TokenCredential credential, AccessControlClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClientOptions.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClientOptions.cs
new file mode 100644
index 000000000000..418c5bd75ffb
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Customization/AccessControlClientOptions.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+using System;
+
+namespace Azure.Analytics.Synapse.AccessControl
+{
+ ///
+ /// The options for .
+ ///
+ public class AccessControlClientOptions : ClientOptions
+ {
+ private const ServiceVersion Latest = ServiceVersion.V2020_02_01_preview;
+
+ internal static AccessControlClientOptions Default { get; } = new AccessControlClientOptions();
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public AccessControlClientOptions(ServiceVersion serviceVersion = Latest)
+ {
+ VersionString = serviceVersion switch
+ {
+ ServiceVersion.V2020_02_01_preview => "2020-02-01-preview",
+ _ => throw new ArgumentOutOfRangeException(nameof(serviceVersion))
+ };
+ }
+
+ ///
+ /// API version for Azure Synapse Access Control service.
+ ///
+ internal string VersionString { get; }
+
+ ///
+ /// The Synapse service version.
+ ///
+ public enum ServiceVersion
+ {
+ ///
+ /// The 2019-06-01-preview of the template service.
+ ///
+#pragma warning disable CA1707
+ V2020_02_01_preview = 1
+#pragma warning restore CA1707
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlClient.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlClient.cs
new file mode 100644
index 000000000000..4999c141c443
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlClient.cs
@@ -0,0 +1,333 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.AccessControl.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.AccessControl
+{
+ /// The AccessControl service client.
+ public partial class AccessControlClient
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal AccessControlRestClient RestClient { get; }
+ /// Initializes a new instance of AccessControlClient for mocking.
+ protected AccessControlClient()
+ {
+ }
+ /// Initializes a new instance of AccessControlClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ internal AccessControlClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2020-02-01-preview")
+ {
+ RestClient = new AccessControlRestClient(clientDiagnostics, pipeline, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Create role assignment.
+ /// Details of role id and object id.
+ /// The cancellation token to use.
+ public virtual async Task> CreateRoleAssignmentAsync(RoleAssignmentOptions createRoleAssignmentOptions, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.CreateRoleAssignment");
+ scope.Start();
+ try
+ {
+ return await RestClient.CreateRoleAssignmentAsync(createRoleAssignmentOptions, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Create role assignment.
+ /// Details of role id and object id.
+ /// The cancellation token to use.
+ public virtual Response CreateRoleAssignment(RoleAssignmentOptions createRoleAssignmentOptions, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.CreateRoleAssignment");
+ scope.Start();
+ try
+ {
+ return RestClient.CreateRoleAssignment(createRoleAssignmentOptions, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List role assignments.
+ /// Synapse Built-In Role Id.
+ /// Object ID of the AAD principal or security-group.
+ /// Continuation token.
+ /// The cancellation token to use.
+ public virtual async Task>> GetRoleAssignmentsAsync(string roleId = null, string principalId = null, string continuationToken = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleAssignments");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetRoleAssignmentsAsync(roleId, principalId, continuationToken, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List role assignments.
+ /// Synapse Built-In Role Id.
+ /// Object ID of the AAD principal or security-group.
+ /// Continuation token.
+ /// The cancellation token to use.
+ public virtual Response> GetRoleAssignments(string roleId = null, string principalId = null, string continuationToken = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleAssignments");
+ scope.Start();
+ try
+ {
+ return RestClient.GetRoleAssignments(roleId, principalId, continuationToken, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public virtual async Task> GetRoleAssignmentByIdAsync(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleAssignmentById");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetRoleAssignmentByIdAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public virtual Response GetRoleAssignmentById(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleAssignmentById");
+ scope.Start();
+ try
+ {
+ return RestClient.GetRoleAssignmentById(roleAssignmentId, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Delete role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public virtual async Task DeleteRoleAssignmentByIdAsync(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.DeleteRoleAssignmentById");
+ scope.Start();
+ try
+ {
+ return await RestClient.DeleteRoleAssignmentByIdAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Delete role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public virtual Response DeleteRoleAssignmentById(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.DeleteRoleAssignmentById");
+ scope.Start();
+ try
+ {
+ return RestClient.DeleteRoleAssignmentById(roleAssignmentId, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List role assignments of the caller.
+ /// The cancellation token to use.
+ public virtual async Task>> GetCallerRoleAssignmentsAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetCallerRoleAssignments");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetCallerRoleAssignmentsAsync(cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List role assignments of the caller.
+ /// The cancellation token to use.
+ public virtual Response> GetCallerRoleAssignments(CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetCallerRoleAssignments");
+ scope.Start();
+ try
+ {
+ return RestClient.GetCallerRoleAssignments(cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get role by role Id.
+ /// Synapse Built-In Role Id.
+ /// The cancellation token to use.
+ public virtual async Task> GetRoleDefinitionByIdAsync(string roleId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitionById");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetRoleDefinitionByIdAsync(roleId, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get role by role Id.
+ /// Synapse Built-In Role Id.
+ /// The cancellation token to use.
+ public virtual Response GetRoleDefinitionById(string roleId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitionById");
+ scope.Start();
+ try
+ {
+ return RestClient.GetRoleDefinitionById(roleId, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List roles.
+ /// The cancellation token to use.
+ public virtual AsyncPageable GetRoleDefinitionsAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitions");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetRoleDefinitionsAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitions");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetRoleDefinitionsNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// List roles.
+ /// The cancellation token to use.
+ public virtual Pageable GetRoleDefinitions(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitions");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetRoleDefinitions(cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AccessControlClient.GetRoleDefinitions");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetRoleDefinitionsNextPage(nextLink, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlGetRoleAssignmentsHeaders.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlGetRoleAssignmentsHeaders.cs
new file mode 100644
index 000000000000..c44ce2fc19fe
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlGetRoleAssignmentsHeaders.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure;
+using Azure.Core;
+
+namespace Azure.Analytics.Synapse.AccessControl
+{
+ internal class AccessControlGetRoleAssignmentsHeaders
+ {
+ private readonly Response _response;
+ public AccessControlGetRoleAssignmentsHeaders(Response response)
+ {
+ _response = response;
+ }
+ public string XMsContinuation => _response.Headers.TryGetValue("x-ms-continuation", out string value) ? value : null;
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlRestClient.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlRestClient.cs
new file mode 100644
index 000000000000..0023df02b85d
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/AccessControlRestClient.cs
@@ -0,0 +1,698 @@
+// 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 System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.AccessControl.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.AccessControl
+{
+ internal partial class AccessControlRestClient
+ {
+ private string endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of AccessControlRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ /// This occurs when one of the required arguments is null.
+ public AccessControlRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2020-02-01-preview")
+ {
+ if (endpoint == null)
+ {
+ throw new ArgumentNullException(nameof(endpoint));
+ }
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateCreateRoleAssignmentRequest(RoleAssignmentOptions createRoleAssignmentOptions)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roleAssignments", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(createRoleAssignmentOptions);
+ request.Content = content;
+ return message;
+ }
+
+ /// Create role assignment.
+ /// Details of role id and object id.
+ /// The cancellation token to use.
+ public async Task> CreateRoleAssignmentAsync(RoleAssignmentOptions createRoleAssignmentOptions, CancellationToken cancellationToken = default)
+ {
+ if (createRoleAssignmentOptions == null)
+ {
+ throw new ArgumentNullException(nameof(createRoleAssignmentOptions));
+ }
+
+ using var message = CreateCreateRoleAssignmentRequest(createRoleAssignmentOptions);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RoleAssignmentDetails value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RoleAssignmentDetails.DeserializeRoleAssignmentDetails(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Create role assignment.
+ /// Details of role id and object id.
+ /// The cancellation token to use.
+ public Response CreateRoleAssignment(RoleAssignmentOptions createRoleAssignmentOptions, CancellationToken cancellationToken = default)
+ {
+ if (createRoleAssignmentOptions == null)
+ {
+ throw new ArgumentNullException(nameof(createRoleAssignmentOptions));
+ }
+
+ using var message = CreateCreateRoleAssignmentRequest(createRoleAssignmentOptions);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RoleAssignmentDetails value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RoleAssignmentDetails.DeserializeRoleAssignmentDetails(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRoleAssignmentsRequest(string roleId, string principalId, string continuationToken)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roleAssignments", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ if (roleId != null)
+ {
+ uri.AppendQuery("roleId", roleId, true);
+ }
+ if (principalId != null)
+ {
+ uri.AppendQuery("principalId", principalId, true);
+ }
+ request.Uri = uri;
+ if (continuationToken != null)
+ {
+ request.Headers.Add("x-ms-continuation", continuationToken);
+ }
+ return message;
+ }
+
+ /// List role assignments.
+ /// Synapse Built-In Role Id.
+ /// Object ID of the AAD principal or security-group.
+ /// Continuation token.
+ /// The cancellation token to use.
+ public async Task, AccessControlGetRoleAssignmentsHeaders>> GetRoleAssignmentsAsync(string roleId = null, string principalId = null, string continuationToken = null, CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetRoleAssignmentsRequest(roleId, principalId, continuationToken);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ var headers = new AccessControlGetRoleAssignmentsHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ IReadOnlyList value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(RoleAssignmentDetails.DeserializeRoleAssignmentDetails(item));
+ }
+ }
+ value = array;
+ }
+ return ResponseWithHeaders.FromValue(value, headers, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List role assignments.
+ /// Synapse Built-In Role Id.
+ /// Object ID of the AAD principal or security-group.
+ /// Continuation token.
+ /// The cancellation token to use.
+ public ResponseWithHeaders, AccessControlGetRoleAssignmentsHeaders> GetRoleAssignments(string roleId = null, string principalId = null, string continuationToken = null, CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetRoleAssignmentsRequest(roleId, principalId, continuationToken);
+ _pipeline.Send(message, cancellationToken);
+ var headers = new AccessControlGetRoleAssignmentsHeaders(message.Response);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ IReadOnlyList value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(RoleAssignmentDetails.DeserializeRoleAssignmentDetails(item));
+ }
+ }
+ value = array;
+ }
+ return ResponseWithHeaders.FromValue(value, headers, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRoleAssignmentByIdRequest(string roleAssignmentId)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roleAssignments/", false);
+ uri.AppendPath(roleAssignmentId, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Get role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public async Task> GetRoleAssignmentByIdAsync(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ if (roleAssignmentId == null)
+ {
+ throw new ArgumentNullException(nameof(roleAssignmentId));
+ }
+
+ using var message = CreateGetRoleAssignmentByIdRequest(roleAssignmentId);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RoleAssignmentDetails value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RoleAssignmentDetails.DeserializeRoleAssignmentDetails(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public Response GetRoleAssignmentById(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ if (roleAssignmentId == null)
+ {
+ throw new ArgumentNullException(nameof(roleAssignmentId));
+ }
+
+ using var message = CreateGetRoleAssignmentByIdRequest(roleAssignmentId);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RoleAssignmentDetails value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RoleAssignmentDetails.DeserializeRoleAssignmentDetails(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteRoleAssignmentByIdRequest(string roleAssignmentId)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roleAssignments/", false);
+ uri.AppendPath(roleAssignmentId, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Delete role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public async Task DeleteRoleAssignmentByIdAsync(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ if (roleAssignmentId == null)
+ {
+ throw new ArgumentNullException(nameof(roleAssignmentId));
+ }
+
+ using var message = CreateDeleteRoleAssignmentByIdRequest(roleAssignmentId);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Delete role assignment by role assignment Id.
+ /// The ID of the role assignment.
+ /// The cancellation token to use.
+ public Response DeleteRoleAssignmentById(string roleAssignmentId, CancellationToken cancellationToken = default)
+ {
+ if (roleAssignmentId == null)
+ {
+ throw new ArgumentNullException(nameof(roleAssignmentId));
+ }
+
+ using var message = CreateDeleteRoleAssignmentByIdRequest(roleAssignmentId);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetCallerRoleAssignmentsRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/getMyAssignedRoles", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// List role assignments of the caller.
+ /// The cancellation token to use.
+ public async Task>> GetCallerRoleAssignmentsAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetCallerRoleAssignmentsRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ IReadOnlyList value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(item.GetString());
+ }
+ }
+ value = array;
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List role assignments of the caller.
+ /// The cancellation token to use.
+ public Response> GetCallerRoleAssignments(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetCallerRoleAssignmentsRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ IReadOnlyList value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(item.GetString());
+ }
+ }
+ value = array;
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRoleDefinitionsRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roles", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// List roles.
+ /// The cancellation token to use.
+ public async Task> GetRoleDefinitionsAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetRoleDefinitionsRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RolesListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RolesListResponse.DeserializeRolesListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List roles.
+ /// The cancellation token to use.
+ public Response GetRoleDefinitions(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetRoleDefinitionsRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RolesListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RolesListResponse.DeserializeRolesListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRoleDefinitionByIdRequest(string roleId)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/rbac/roles/", false);
+ uri.AppendPath(roleId, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Get role by role Id.
+ /// Synapse Built-In Role Id.
+ /// The cancellation token to use.
+ public async Task> GetRoleDefinitionByIdAsync(string roleId, CancellationToken cancellationToken = default)
+ {
+ if (roleId == null)
+ {
+ throw new ArgumentNullException(nameof(roleId));
+ }
+
+ using var message = CreateGetRoleDefinitionByIdRequest(roleId);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ SynapseRole value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = SynapseRole.DeserializeSynapseRole(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get role by role Id.
+ /// Synapse Built-In Role Id.
+ /// The cancellation token to use.
+ public Response GetRoleDefinitionById(string roleId, CancellationToken cancellationToken = default)
+ {
+ if (roleId == null)
+ {
+ throw new ArgumentNullException(nameof(roleId));
+ }
+
+ using var message = CreateGetRoleDefinitionByIdRequest(roleId);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ SynapseRole value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = SynapseRole.DeserializeSynapseRole(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRoleDefinitionsNextPageRequest(string nextLink)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// List roles.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public async Task> GetRoleDefinitionsNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetRoleDefinitionsNextPageRequest(nextLink);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RolesListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RolesListResponse.DeserializeRolesListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List roles.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public Response GetRoleDefinitionsNextPage(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetRoleDefinitionsNextPageRequest(nextLink);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ RolesListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = RolesListResponse.DeserializeRolesListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.Serialization.cs
new file mode 100644
index 000000000000..0853ab1a512b
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.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.Synapse.AccessControl.Models
+{
+ internal partial class ErrorContract
+ {
+ internal static ErrorContract DeserializeErrorContract(JsonElement element)
+ {
+ ErrorResponse error = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("error"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ error = ErrorResponse.DeserializeErrorResponse(property.Value);
+ continue;
+ }
+ }
+ return new ErrorContract(error);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.cs
new file mode 100644
index 000000000000..4fb88b234f4e
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorContract.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// Contains details when the response code indicates an error.
+ internal partial class ErrorContract
+ {
+ /// Initializes a new instance of ErrorContract.
+ internal ErrorContract()
+ {
+ }
+
+ /// Initializes a new instance of ErrorContract.
+ /// The error details.
+ internal ErrorContract(ErrorResponse error)
+ {
+ Error = error;
+ }
+
+ /// The error details.
+ public ErrorResponse Error { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.Serialization.cs
new file mode 100644
index 000000000000..406ca055a4e9
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.Serialization.cs
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ internal partial class ErrorDetail
+ {
+ internal static ErrorDetail DeserializeErrorDetail(JsonElement element)
+ {
+ string code = default;
+ string message = default;
+ string target = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("code"))
+ {
+ code = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("message"))
+ {
+ message = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("target"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ target = property.Value.GetString();
+ continue;
+ }
+ }
+ return new ErrorDetail(code, message, target);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.cs
new file mode 100644
index 000000000000..aed019a432b5
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorDetail.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// The ErrorDetail.
+ internal partial class ErrorDetail
+ {
+ /// Initializes a new instance of ErrorDetail.
+ /// .
+ /// .
+ internal ErrorDetail(string code, string message)
+ {
+ if (code == null)
+ {
+ throw new ArgumentNullException(nameof(code));
+ }
+ if (message == null)
+ {
+ throw new ArgumentNullException(nameof(message));
+ }
+
+ Code = code;
+ Message = message;
+ }
+
+ /// Initializes a new instance of ErrorDetail.
+ /// .
+ /// .
+ /// .
+ internal ErrorDetail(string code, string message, string target)
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ }
+
+ public string Code { get; }
+ public string Message { get; }
+ public string Target { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.Serialization.cs
new file mode 100644
index 000000000000..1b67ef0b7d96
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.Serialization.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ internal partial class ErrorResponse
+ {
+ internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
+ {
+ string code = default;
+ string message = default;
+ string target = default;
+ IReadOnlyList details = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("code"))
+ {
+ code = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("message"))
+ {
+ message = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("target"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ target = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("details"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(ErrorDetail.DeserializeErrorDetail(item));
+ }
+ }
+ details = array;
+ continue;
+ }
+ }
+ return new ErrorResponse(code, message, target, details);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.cs
new file mode 100644
index 000000000000..cb665fe91db7
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/ErrorResponse.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;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// The ErrorResponse.
+ internal partial class ErrorResponse
+ {
+ /// Initializes a new instance of ErrorResponse.
+ /// .
+ /// .
+ internal ErrorResponse(string code, string message)
+ {
+ if (code == null)
+ {
+ throw new ArgumentNullException(nameof(code));
+ }
+ if (message == null)
+ {
+ throw new ArgumentNullException(nameof(message));
+ }
+
+ Code = code;
+ Message = message;
+ }
+
+ /// Initializes a new instance of ErrorResponse.
+ /// .
+ /// .
+ /// .
+ /// .
+ internal ErrorResponse(string code, string message, string target, IReadOnlyList details)
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ Details = details;
+ }
+
+ public string Code { get; }
+ public string Message { get; }
+ public string Target { get; }
+ public IReadOnlyList Details { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.Serialization.cs
new file mode 100644
index 000000000000..334b91e52301
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.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.Synapse.AccessControl.Models
+{
+ public partial class RoleAssignmentDetails
+ {
+ internal static RoleAssignmentDetails DeserializeRoleAssignmentDetails(JsonElement element)
+ {
+ string id = default;
+ string roleId = default;
+ string principalId = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("roleId"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ roleId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("principalId"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ principalId = property.Value.GetString();
+ continue;
+ }
+ }
+ return new RoleAssignmentDetails(id, roleId, principalId);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.cs
new file mode 100644
index 000000000000..0a3093145926
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentDetails.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// Role Assignment response details.
+ public partial class RoleAssignmentDetails
+ {
+ /// Initializes a new instance of RoleAssignmentDetails.
+ internal RoleAssignmentDetails()
+ {
+ }
+
+ /// Initializes a new instance of RoleAssignmentDetails.
+ /// Role Assignment ID.
+ /// Role ID of the Synapse Built-In Role.
+ /// Object ID of the AAD principal or security-group.
+ internal RoleAssignmentDetails(string id, string roleId, string principalId)
+ {
+ Id = id;
+ RoleId = roleId;
+ PrincipalId = principalId;
+ }
+
+ /// Role Assignment ID.
+ public string Id { get; }
+ /// Role ID of the Synapse Built-In Role.
+ public string RoleId { get; }
+ /// Object ID of the AAD principal or security-group.
+ public string PrincipalId { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.Serialization.cs
new file mode 100644
index 000000000000..0dfa9a4db410
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.Serialization.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ public partial class RoleAssignmentOptions : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("roleId");
+ writer.WriteStringValue(RoleId);
+ writer.WritePropertyName("principalId");
+ writer.WriteStringValue(PrincipalId);
+ writer.WriteEndObject();
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.cs
new file mode 100644
index 000000000000..cd6aee4019b7
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RoleAssignmentOptions.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// Role Assignment request details.
+ public partial class RoleAssignmentOptions
+ {
+ /// Initializes a new instance of RoleAssignmentOptions.
+ /// Role ID of the Synapse Built-In Role.
+ /// Object ID of the AAD principal or security-group.
+ public RoleAssignmentOptions(string roleId, string principalId)
+ {
+ if (roleId == null)
+ {
+ throw new ArgumentNullException(nameof(roleId));
+ }
+ if (principalId == null)
+ {
+ throw new ArgumentNullException(nameof(principalId));
+ }
+
+ RoleId = roleId;
+ PrincipalId = principalId;
+ }
+
+ /// Role ID of the Synapse Built-In Role.
+ public string RoleId { get; }
+ /// Object ID of the AAD principal or security-group.
+ public string PrincipalId { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.Serialization.cs
new file mode 100644
index 000000000000..960ac936dc37
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.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.Core;
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ public partial class RolesListResponse
+ {
+ internal static RolesListResponse DeserializeRolesListResponse(JsonElement element)
+ {
+ IReadOnlyList value = default;
+ string nextLink = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("value"))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(SynapseRole.DeserializeSynapseRole(item));
+ }
+ }
+ value = array;
+ continue;
+ }
+ if (property.NameEquals("nextLink"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ nextLink = property.Value.GetString();
+ continue;
+ }
+ }
+ return new RolesListResponse(value, nextLink);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.cs
new file mode 100644
index 000000000000..5ad90d8393f5
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/RolesListResponse.cs
@@ -0,0 +1,43 @@
+// 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.Synapse.AccessControl.Models
+{
+ /// A list of Synapse roles available.
+ public partial class RolesListResponse
+ {
+ /// Initializes a new instance of RolesListResponse.
+ /// List of Synapse roles.
+ internal RolesListResponse(IEnumerable value)
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException(nameof(value));
+ }
+
+ Value = value.ToArray();
+ }
+
+ /// Initializes a new instance of RolesListResponse.
+ /// List of Synapse roles.
+ /// The link to the next page of results, if any remaining results exist.
+ internal RolesListResponse(IReadOnlyList value, string nextLink)
+ {
+ Value = value;
+ NextLink = nextLink;
+ }
+
+ /// List of Synapse roles.
+ public IReadOnlyList Value { get; }
+ /// The link to the next page of results, if any remaining results exist.
+ public string NextLink { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.Serialization.cs
new file mode 100644
index 000000000000..d8ca3efdee57
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.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.Synapse.AccessControl.Models
+{
+ public partial class SynapseRole
+ {
+ internal static SynapseRole DeserializeSynapseRole(JsonElement element)
+ {
+ string id = default;
+ string name = default;
+ bool isBuiltIn = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ id = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("name"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("isBuiltIn"))
+ {
+ isBuiltIn = property.Value.GetBoolean();
+ continue;
+ }
+ }
+ return new SynapseRole(id, name, isBuiltIn);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.cs
new file mode 100644
index 000000000000..6ffbd4bb1978
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Generated/Models/SynapseRole.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+namespace Azure.Analytics.Synapse.AccessControl.Models
+{
+ /// Synapse role details.
+ public partial class SynapseRole
+ {
+ /// Initializes a new instance of SynapseRole.
+ /// Is a built-in role or not.
+ internal SynapseRole(bool isBuiltIn)
+ {
+ IsBuiltIn = isBuiltIn;
+ }
+
+ /// Initializes a new instance of SynapseRole.
+ /// Role ID.
+ /// Name of the Synapse role.
+ /// Is a built-in role or not.
+ internal SynapseRole(string id, string name, bool isBuiltIn)
+ {
+ Id = id;
+ Name = name;
+ IsBuiltIn = isBuiltIn;
+ }
+
+ /// Role ID.
+ public string Id { get; }
+ /// Name of the Synapse role.
+ public string Name { get; }
+ /// Is a built-in role or not.
+ public bool IsBuiltIn { get; }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Properties/AssemblyInfo.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..4dba1d949da2
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/Properties/AssemblyInfo.cs
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("Azure.Analytics.Synapse.AccessControl.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")]
+[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Synapse")]
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/autorest.md b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/autorest.md
new file mode 100644
index 000000000000..be3d3141cae2
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/src/autorest.md
@@ -0,0 +1,17 @@
+# Microsoft.Azure.Synapse
+
+Run `dotnet msbuild /t:GenerateCode` to generate code.
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+```yaml
+repo: https://github.com/Azure/azure-rest-api-specs/blob/fdf4bbfd7a73b28960d3a62490440345d6f2e8e3
+```
+
+``` yaml
+public-clients: true
+input-file:
+ - $(repo)/specification/synapse/data-plane/Microsoft.Synapse/preview/2020-02-01-preview/roleAssignments.json
+ - $(repo)/specification/synapse/data-plane/Microsoft.Synapse/preview/2020-02-01-preview/roles.json
+```
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs
new file mode 100644
index 000000000000..43fe776ca1cb
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientLiveTests.cs
@@ -0,0 +1,92 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Azure.Analytics.Synapse.AccessControl.Models;
+using Azure.Core.TestFramework;
+using Newtonsoft.Json.Linq;
+using NUnit.Framework;
+
+namespace Azure.Analytics.Synapse.Tests.AccessControl
+{
+ ///
+ /// The suite of tests for the class.
+ ///
+ ///
+ /// These tests have a dependency on live Azure services and may incur costs for the associated
+ /// Azure subscription.
+ ///
+ public class AccessControlClientLiveTests : AccessControlClientTestBase
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A flag used by the Azure Core Test Framework to differentiate between tests for asynchronous and synchronous methods.
+ public AccessControlClientLiveTests(bool isAsync) : base(isAsync)
+ {
+ }
+
+ [Test]
+ public async Task TestGetRoleDefinition()
+ {
+ List roles = await AccessControlClient.GetRoleDefinitionsAsync().ToEnumerableAsync();
+ CollectionAssert.IsNotEmpty(roles);
+ foreach (SynapseRole expectedRole in roles)
+ {
+ SynapseRole actualRole = await AccessControlClient.GetRoleDefinitionByIdAsync(expectedRole.Id.ToString());
+ Assert.AreEqual(expectedRole.Name, actualRole.Name);
+ Assert.AreEqual(expectedRole.Id, actualRole.Id);
+ Assert.AreEqual(expectedRole.IsBuiltIn, actualRole.IsBuiltIn);
+ }
+ }
+
+ [Test]
+ public async Task TestGetRoleAssignment()
+ {
+ IReadOnlyList roleAssignments = (await AccessControlClient.GetRoleAssignmentsAsync()).Value;
+ CollectionAssert.IsNotEmpty(roleAssignments);
+ foreach (RoleAssignmentDetails expectedRoleAssignment in roleAssignments)
+ {
+ RoleAssignmentDetails actualRoleAssignment = await AccessControlClient.GetRoleAssignmentByIdAsync(expectedRoleAssignment.Id);
+ Assert.AreEqual(expectedRoleAssignment.Id, actualRoleAssignment.Id);
+ Assert.AreEqual(expectedRoleAssignment.PrincipalId, actualRoleAssignment.PrincipalId);
+ Assert.AreEqual(expectedRoleAssignment.RoleId, actualRoleAssignment.RoleId);
+ }
+ }
+
+ [Test]
+ public async Task TestCreateAndDeleteRoleAssignment()
+ {
+ string sqlAdminRoleId = "7af0c69a-a548-47d6-aea3-d00e69bd83aa";
+ string principalId = Guid.NewGuid().ToString();
+
+ // Create role assignment.
+ RoleAssignmentDetails actualRoleAssignment = await AccessControlClient.CreateRoleAssignmentAsync(new RoleAssignmentOptions(roleId:sqlAdminRoleId, principalId: principalId));
+
+ // Verify the role assignment exists.
+ Assert.NotNull(actualRoleAssignment);
+ Assert.AreEqual(sqlAdminRoleId, actualRoleAssignment.RoleId);
+ Assert.AreEqual(principalId, actualRoleAssignment.PrincipalId);
+
+ // Remove the role assignment.
+ await AccessControlClient.DeleteRoleAssignmentByIdAsync(actualRoleAssignment.Id);
+
+ // Verify the role assignment doesn't exist.
+ actualRoleAssignment = (await AccessControlClient.GetRoleAssignmentsAsync()).Value.FirstOrDefault(ra => ra.PrincipalId == principalId);
+ Assert.IsNull(actualRoleAssignment);
+ }
+
+ [Test]
+ public async Task TesGetCallerRoleAssignments()
+ {
+ IEnumerable expectedRoleIds = (await AccessControlClient.GetRoleDefinitionsAsync().ToEnumerableAsync())
+ .Where(role=>role.IsBuiltIn)
+ .Select(role => role.Id);
+ Response> actualRoleIds = await AccessControlClient.GetCallerRoleAssignmentsAsync();
+ CollectionAssert.AreEquivalent(expectedRoleIds, actualRoleIds.Value);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientTestBase.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientTestBase.cs
new file mode 100644
index 000000000000..098eef3ffc24
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/AccessControlClientTestBase.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Analytics.Synapse.AccessControl;
+using Azure.Core.TestFramework;
+using NUnit.Framework;
+using System;
+using System.IO;
+
+namespace Azure.Analytics.Synapse.Tests.AccessControl
+{
+ [NonParallelizable]
+ public abstract class AccessControlClientTestBase : RecordedTestBase
+ {
+ public AccessControlClient AccessControlClient { get; set; }
+
+ protected AccessControlClientTestBase(bool isAsync) : base(isAsync)
+ {
+#if DEBUG
+ SaveDebugRecordingsOnFailure = true;
+#endif
+ }
+
+ public override void StartTestRecording()
+ {
+ base.StartTestRecording();
+
+ AccessControlClient = CreateAccessControlClient();
+ }
+
+ public override void StopTestRecording()
+ {
+ Recording.RewriteSessionRecords(GetSessionFilePath());
+ Recording.ClearTextReplacementRules();
+ base.StopTestRecording();
+ }
+
+ private string GetSessionFilePath(string name = null)
+ {
+ TestContext.TestAdapter testAdapter = TestContext.CurrentContext.Test;
+
+ name ??= testAdapter.Name;
+
+ string className = testAdapter.ClassName.Substring(testAdapter.ClassName.LastIndexOf('.') + 1);
+ string fileName = name + (IsAsync ? "Async" : string.Empty) + ".json";
+ return Path.Combine(TestContext.CurrentContext.TestDirectory, "SessionRecords", className, fileName);
+ }
+
+ internal AccessControlClient CreateAccessControlClient(TestRecording recording = null)
+ {
+ recording ??= Recording;
+ return InstrumentClient(new AccessControlClient(
+ new Uri(TestEnvironment.WorkspaceUrl),
+ TestEnvironment.Credential,
+ recording.InstrumentClientOptions(new AccessControlClientOptions())));
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/Azure.Analytics.Synapse.AccessControl.Tests.csproj b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/Azure.Analytics.Synapse.AccessControl.Tests.csproj
new file mode 100644
index 000000000000..852a7067cc8a
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/Azure.Analytics.Synapse.AccessControl.Tests.csproj
@@ -0,0 +1,22 @@
+
+
+ $(RequiredTargetFrameworks)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignments.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignments.json
new file mode 100644
index 000000000000..efcada75dee4
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignments.json
@@ -0,0 +1,83 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "3d2c25bc282aad39c91012ea9e321bc6",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "272",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:32 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "3d2c25bc282aad39c91012ea9e321bc6",
+ "x-ms-request-id": [
+ "3120ee90-e659-49e4-804b-dba500f0397f",
+ "3120ee90-e659-49e4-804b-dba500f0397f"
+ ]
+ },
+ "ResponseBody": {
+ "value": [
+ {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ ]
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/getMyAssignedRoles?api-version=2020-02-01-preview",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-35042a6b4342d9428958533de193ef5e-155c16897c659949-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "16353bb23649213bc7bdf1d984ac60b2",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "118",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:32 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "16353bb23649213bc7bdf1d984ac60b2",
+ "x-ms-request-id": "160996c9-6fb6-4c91-8469-cf31a6adaa16"
+ },
+ "ResponseBody": "[\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022]"
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "1572800930"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignmentsAsync.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignmentsAsync.json
new file mode 100644
index 000000000000..2de202453f75
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TesGetCallerRoleAssignmentsAsync.json
@@ -0,0 +1,83 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "43ee0239d7275c8456f1538df34357a7",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "272",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "43ee0239d7275c8456f1538df34357a7",
+ "x-ms-request-id": [
+ "90c44c19-b362-4f26-8706-b3c84ccbc5b7",
+ "90c44c19-b362-4f26-8706-b3c84ccbc5b7"
+ ]
+ },
+ "ResponseBody": {
+ "value": [
+ {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ ]
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/getMyAssignedRoles?api-version=2020-02-01-preview",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-f225c0429ccb944fa5d23d32a5ae5f92-e9493764cd7c4c40-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "a512669bc97ab3448e55b7b7cfaf26c2",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "118",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "a512669bc97ab3448e55b7b7cfaf26c2",
+ "x-ms-request-id": "9743aa2e-6390-4bc8-b559-6c217e7ed90f"
+ },
+ "ResponseBody": "[\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022]"
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "1543734388"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignment.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignment.json
new file mode 100644
index 000000000000..ca09d080d723
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignment.json
@@ -0,0 +1,95 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "Content-Length": "102",
+ "Content-Type": "application/json",
+ "traceparent": "00-ac107be093a6b64db4c1d559d5fc14ea-9458c530e4c08b45-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "024168579fe07bc36ae654f6bd999c12",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "e7c7f5fb-c89e-430e-98a8-10cbcca56870"
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:32 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "024168579fe07bc36ae654f6bd999c12",
+ "x-ms-request-id": "2266712c-6388-4b36-8311-ad1eb429994c"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-e7c7f5fb-c89e-430e-98a8-10cbcca56870",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "e7c7f5fb-c89e-430e-98a8-10cbcca56870"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-e7c7f5fb-c89e-430e-98a8-10cbcca56870?api-version=2020-02-01-preview",
+ "RequestMethod": "DELETE",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-1f7b5146916315478335f9b5b0ce84ac-fd59e8ba64820046-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "e2dff03ce48183bd49a6a31e22a23495",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "0",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "e2dff03ce48183bd49a6a31e22a23495",
+ "x-ms-request-id": "971ca785-5477-449a-a98f-0cb705c99518"
+ },
+ "ResponseBody": []
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-8c230bee99eda343aca994c0011a7559-aac5028762be5e4f-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "bb2b862d33e9dca343d3fd2cfe727ac9",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "2761",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "bb2b862d33e9dca343d3fd2cfe727ac9",
+ "x-ms-continuation": "",
+ "x-ms-request-id": "3cfef67f-2316-44d1-8f1f-548f2d6a493f"
+ },
+ "ResponseBody": "[{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00228f51e348-1fa6-4194-8d13-8e0368e3298a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00226ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00223e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00221424271a-af44-4fb2-9c34-4da0cd9e2055\u0022}]"
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "929018846"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignmentAsync.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignmentAsync.json
new file mode 100644
index 000000000000..f46d90a6ddff
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestCreateAndDeleteRoleAssignmentAsync.json
@@ -0,0 +1,95 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "POST",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "Content-Length": "102",
+ "Content-Type": "application/json",
+ "traceparent": "00-0af16b27dbef97428ed3165cbc226742-88b75863aa5eec4c-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "02ed50e4d1b31e3e286e52763c7ed103",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": {
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "da9bb1e9-c06f-4017-80da-7e1c352f6e03"
+ },
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "02ed50e4d1b31e3e286e52763c7ed103",
+ "x-ms-request-id": "47baf86d-e495-4810-9102-82d834fbe162"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-da9bb1e9-c06f-4017-80da-7e1c352f6e03",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "da9bb1e9-c06f-4017-80da-7e1c352f6e03"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-da9bb1e9-c06f-4017-80da-7e1c352f6e03?api-version=2020-02-01-preview",
+ "RequestMethod": "DELETE",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-6bdb9dff4d506a45879f8806bbef3f9c-40033d98f1580a49-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "8c8430fdda9285d522dd5c4867bb7865",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "0",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "8c8430fdda9285d522dd5c4867bb7865",
+ "x-ms-request-id": "4071f954-951a-40c7-a32f-c496969ea5dc"
+ },
+ "ResponseBody": []
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-b1b824cbdaaf354c89506513d9f42703-35361ce5c3485544-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "1acf3e4ce5541304c5cf300b3d286947",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "2761",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "1acf3e4ce5541304c5cf300b3d286947",
+ "x-ms-continuation": "",
+ "x-ms-request-id": "0afc60a8-5519-43e7-a13b-cb5f838e5def"
+ },
+ "ResponseBody": "[{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00228f51e348-1fa6-4194-8d13-8e0368e3298a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00226ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00223e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00221424271a-af44-4fb2-9c34-4da0cd9e2055\u0022}]"
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "1514913004"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignment.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignment.json
new file mode 100644
index 000000000000..844146165bd7
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignment.json
@@ -0,0 +1,485 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-424aa816363df744a621af69f7295f99-c472d22bba820d42-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "1becccee8c3a69bb246e33a04c5e0308",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "2761",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "1becccee8c3a69bb246e33a04c5e0308",
+ "x-ms-continuation": "",
+ "x-ms-request-id": "0b04efb3-45cd-4777-9b50-0b0ac931c798"
+ },
+ "ResponseBody": "[{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00228f51e348-1fa6-4194-8d13-8e0368e3298a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00226ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00223e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00221424271a-af44-4fb2-9c34-4da0cd9e2055\u0022}]"
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-48f18ef8d56107418f2ede969720d3ba-177db142f05cec46-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "8ff3a533bfc98a870e11b89e0a79614c",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "8ff3a533bfc98a870e11b89e0a79614c",
+ "x-ms-request-id": "66f11d07-c807-4ff4-8eeb-741209ddfa76"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "8f51e348-1fa6-4194-8d13-8e0368e3298a"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-0473b2a682d43d4e8bcd7f0dc9bc62e9-89b1fd9fb0b0e645-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "36156f365e1678d051e664f60e9f09d1",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "36156f365e1678d051e664f60e9f09d1",
+ "x-ms-request-id": "5a633e79-dd98-4f02-983d-511aedee5603"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "f63e7747-5fce-43a9-bd12-fb382caa5b7e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-683da92a2d5ef74ca319a2ce657e7955-f393d79a58398b41-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "e57bbd2e301c2e0a44610c29d31c5eaa",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "e57bbd2e301c2e0a44610c29d31c5eaa",
+ "x-ms-request-id": "a5ec2b1d-5eb9-43ef-abda-f2efe5d8b263"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "6ece8f98-43d0-41c6-bb9a-7a0172e5a645"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-b369c5f199fa4b43966e93d96c6706d9-e28546ea81b47646-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "dc6ae70ccd49d4f2d47b3de25b907b6f",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "dc6ae70ccd49d4f2d47b3de25b907b6f",
+ "x-ms-request-id": "f1cd8fc5-e34c-45be-8d1f-ef305232fadd"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-5bedfa7e76c65f49bf1d9ce2e0f2c44d-e9c8148997b7b44b-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "4d6fe7077cfe053064e6f1b451a7a534",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "4d6fe7077cfe053064e6f1b451a7a534",
+ "x-ms-request-id": "b7f5c332-9c9b-4454-925e-d54e487f1f9e"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-0f1e65b27d5990489a83dbdcebbc5bbb-41de23c2db7ef84e-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "27eab9872d356188cba610a1f227d3b3",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "27eab9872d356188cba610a1f227d3b3",
+ "x-ms-request-id": "25a0aaf8-a64b-4557-8a4b-5d6b10cafe90"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-fa1f26a6da32ac49826707ac20ff7ac3-3e4ff6c08623084c-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "ec229de611ad90acb7647862db3e822d",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "ec229de611ad90acb7647862db3e822d",
+ "x-ms-request-id": "6121d0a6-890f-497f-b744-5173e529d334"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-b979d26fbbeb9549a9cd63fa34b13868-6d5c651914bc3a4b-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "a25b09d554a6da395e0e81586b8f133c",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:33 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "a25b09d554a6da395e0e81586b8f133c",
+ "x-ms-request-id": "2d301d99-b2c2-4c71-92b0-7ab7a309ae7b"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-006120d5ba8f53439d2aac0d38869a31-969627840cd4f54e-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "b4cd3e13b98575870c5970d0b526868d",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "b4cd3e13b98575870c5970d0b526868d",
+ "x-ms-request-id": "856978a8-36ad-4346-8430-fe8d9cf94457"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-c7f4386c3bee554780a84977ab1ab1af-9a5d571c4b6c344d-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "e9cbe32330cc910c64488d9e8f542427",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "e9cbe32330cc910c64488d9e8f542427",
+ "x-ms-request-id": "4da8d55d-b72f-49c4-821b-b6f95d363167"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-ca9f1c019e5db34993ca158d3466ea71-8c86e769a9316b48-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "9d4e3b51ce701ca881e5954ce4682438",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "9d4e3b51ce701ca881e5954ce4682438",
+ "x-ms-request-id": "65b86684-7fbf-45f5-a73b-bdc440b28eb7"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-aadffdb92bf10440805c56aeb0a50926-59e525c46c5d1b40-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "8835f4882ac3e270313c4f3c2be8e5b8",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "8835f4882ac3e270313c4f3c2be8e5b8",
+ "x-ms-request-id": "dcfbcd32-f634-48f5-89bc-c546e57a1dd6"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-2a10fa73cca3114ab07440a60840beb4-33b0ec1d4f13af49-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "7a7f4835e8d7541d3baf67e79bc0adfb",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "7a7f4835e8d7541d3baf67e79bc0adfb",
+ "x-ms-request-id": "c71ef781-a929-4f19-950d-3b4c8fe100f7"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-df9e5959a85cf34f9168387291ff8e1f-3615b0f5182ceb49-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "9b1654239c1f2764ca6b6b337e6bf098",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "9b1654239c1f2764ca6b6b337e6bf098",
+ "x-ms-request-id": "37b11d74-55ee-493a-bc75-f688958b3da5"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "3e537dfe-8cfd-4b17-b9e3-ae366f099311"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-3cd6e0fc27bd9241b988e7b0c15da866-7c1001bb61acb741-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "9c17dcffaae99f61d7e04c14c2894771",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "9c17dcffaae99f61d7e04c14c2894771",
+ "x-ms-request-id": "2423d76e-e259-477b-a781-61ace46253ad"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "1424271a-af44-4fb2-9c34-4da0cd9e2055"
+ }
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "799761294"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignmentAsync.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignmentAsync.json
new file mode 100644
index 000000000000..59afbf64ce39
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleAssignmentAsync.json
@@ -0,0 +1,485 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-cb3d6e586f8fc54d868a3c2d5c64f398-b980eb4a23cadb4c-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "abc7b72b7f1159665dfd31a0862c31eb",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "2761",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "abc7b72b7f1159665dfd31a0862c31eb",
+ "x-ms-continuation": "",
+ "x-ms-request-id": "a1007dab-b32b-46dd-bf41-4bc95934caab"
+ },
+ "ResponseBody": "[{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00228f51e348-1fa6-4194-8d13-8e0368e3298a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022f63e7747-5fce-43a9-bd12-fb382caa5b7e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u00226ece8f98-43d0-41c6-bb9a-7a0172e5a645\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022b71a874a-f1a8-4811-b06d-6748316e45a7\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u0022c3a6d2f1-a26f-4810-9b0f-591308d5cbf1\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022ca728363-7297-4e35-a9c3-c6400837883e\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549\u0022,\u0022roleId\u0022:\u00226e4bf58a-b8e1-4cc3-bbf9-d73143322b78\u0022,\u0022principalId\u0022:\u0022e3688378-4440-43dc-9c10-8b8250fbd549\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00223e537dfe-8cfd-4b17-b9e3-ae366f099311\u0022},{\u0022id\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055\u0022,\u0022roleId\u0022:\u00227af0c69a-a548-47d6-aea3-d00e69bd83aa\u0022,\u0022principalId\u0022:\u00221424271a-af44-4fb2-9c34-4da0cd9e2055\u0022}]"
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-90d85f5168fb124dbd2f545fc6c59868-eb79b4d26394a041-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "4097d8b47c7292412ac801ffbab07c83",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "4097d8b47c7292412ac801ffbab07c83",
+ "x-ms-request-id": "de2b8a05-dc57-4be2-89ec-db46aa27e273"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-8f51e348-1fa6-4194-8d13-8e0368e3298a",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "8f51e348-1fa6-4194-8d13-8e0368e3298a"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-925f292ae1db074c91a108841f8ca8db-03ec7990fdf63043-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "c3181ab98ed96ef2eb008a6961c81fe5",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "c3181ab98ed96ef2eb008a6961c81fe5",
+ "x-ms-request-id": "23efb0cb-c1a4-41b5-bb16-5054c2d46a0d"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-f63e7747-5fce-43a9-bd12-fb382caa5b7e",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "f63e7747-5fce-43a9-bd12-fb382caa5b7e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-6ed08a209ea413428699e1095f16b433-075d414e7a2af342-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "775afa537d2cae1b753481487e679ead",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "775afa537d2cae1b753481487e679ead",
+ "x-ms-request-id": "5e7d78a7-7cc1-4f36-8301-5dd8a1c56379"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-6ece8f98-43d0-41c6-bb9a-7a0172e5a645",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "6ece8f98-43d0-41c6-bb9a-7a0172e5a645"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-35770d3f0e0227459cd34b3d7669a973-7542ce80317c5c4f-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "6be6ae806e132512e6295571f2d83162",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "6be6ae806e132512e6295571f2d83162",
+ "x-ms-request-id": "33a77662-aca5-44af-b82e-5aff28186d3a"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-3cad611c5dc2b049893b188226876339-67ee61c0b1642f43-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "bfab1ba804553b56fe694da50da9ef83",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "bfab1ba804553b56fe694da50da9ef83",
+ "x-ms-request-id": "8087b835-c0a6-4b4e-986a-03a11c902da0"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "ed3c5c21-4f5d-4476-b9f6-f0c4bb404e1a"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-d482eb3cddd08e449772e9c4e440f0f3-3f54dbf60ef06d4e-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "b3e8dc61b3e1e5d1e835910328a9bc9d",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "b3e8dc61b3e1e5d1e835910328a9bc9d",
+ "x-ms-request-id": "388bdd07-0b98-47b2-b5fd-ae31cb1c369b"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-23a5882195b65e48b3cbbe16a9242d6c-1475ad1096e13e46-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "629f1f03dfbb7c5757aa6ca9206c183c",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "629f1f03dfbb7c5757aa6ca9206c183c",
+ "x-ms-request-id": "5a36ce81-7621-4a54-86ca-08289515b39d"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-07f6d777638fb7449a618d0fa580e236-80eb77a41c07cb4e-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "1510d1397df0f58049c6d62072531355",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:36 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "1510d1397df0f58049c6d62072531355",
+ "x-ms-request-id": "2348eab4-e29f-45bf-9a55-cb674c34a03f"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-b71a874a-f1a8-4811-b06d-6748316e45a7",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "b71a874a-f1a8-4811-b06d-6748316e45a7"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-d99a1de4b32cbc49b1d394af6b511683-a4db1316beee4d48-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "eea2b0ad8c0981c7846c5c374627c57b",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "eea2b0ad8c0981c7846c5c374627c57b",
+ "x-ms-request-id": "ef6a1a4b-d988-4dd6-9520-e93c755a8f9d"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-46c962ff426b92448e038940313f0497-4d714d8db4214946-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "57c9551ca69885ad9faa19f509370903",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "57c9551ca69885ad9faa19f509370903",
+ "x-ms-request-id": "0c59d625-36be-47ac-91e8-7ca23b777c1f"
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-562552116a083e43a635474324d81a3f-8b4e9741270ad948-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "6ffc17972acaac32098e90832048ae21",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "6ffc17972acaac32098e90832048ae21",
+ "x-ms-request-id": "c71d481c-841a-455e-82b2-d64e53bcb456"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-ca728363-7297-4e35-a9c3-c6400837883e",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "ca728363-7297-4e35-a9c3-c6400837883e"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-0c93bacf0b92a04f879523547d853efc-43219264fb0a994c-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "1d035a01bb8a06bc031c4e5f73d2784d",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "1d035a01bb8a06bc031c4e5f73d2784d",
+ "x-ms-request-id": "7438fa9f-3131-4b50-b547-8c06d6b19f7b"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-4aab3cfc2faddf45b13e99c634a822f9-870885f2f3d2904e-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "2f9f5863552bf2b1231c4d0915296456",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "2f9f5863552bf2b1231c4d0915296456",
+ "x-ms-request-id": "ac758ae9-0715-49dc-aed4-98f84e64cce3"
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78-e3688378-4440-43dc-9c10-8b8250fbd549",
+ "roleId": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "principalId": "e3688378-4440-43dc-9c10-8b8250fbd549"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-d33ea99840b5a543822d1a8958a70f6b-1e966681a9a15341-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "aef4f7fceb33db795af56baedbd33837",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "aef4f7fceb33db795af56baedbd33837",
+ "x-ms-request-id": "f42968be-e510-47ee-8533-20575912dcea"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-3e537dfe-8cfd-4b17-b9e3-ae366f099311",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "3e537dfe-8cfd-4b17-b9e3-ae366f099311"
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roleAssignments/7af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-afff6d21d539d8408f44fbde7be695be-86d65dff24fe5440-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "c72043167ea8abf6a811fa6d6eb2f0da",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "183",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": "Microsoft-HTTPAPI/2.0",
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "c72043167ea8abf6a811fa6d6eb2f0da",
+ "x-ms-request-id": "8d450f8e-bc2a-4d7d-977a-64d6c222ce73"
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa-1424271a-af44-4fb2-9c34-4da0cd9e2055",
+ "roleId": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "principalId": "1424271a-af44-4fb2-9c34-4da0cd9e2055"
+ }
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "2115328457"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinition.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinition.json
new file mode 100644
index 000000000000..c9bf0af792d9
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinition.json
@@ -0,0 +1,165 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "8f88c26ee61806225a35fe3b5a364eb0",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "272",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "8f88c26ee61806225a35fe3b5a364eb0",
+ "x-ms-request-id": [
+ "7ebf2237-a9ff-45d6-9298-baa31b24bb5a",
+ "7ebf2237-a9ff-45d6-9298-baa31b24bb5a"
+ ]
+ },
+ "ResponseBody": {
+ "value": [
+ {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ ]
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-9470ca7f91961c48854b07760d8a37cd-f83b351f1679b448-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "49019b07a50e04483777cee9802600f4",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "87",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:34 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "49019b07a50e04483777cee9802600f4",
+ "x-ms-request-id": [
+ "9a3bcca4-b149-42c0-b474-7c2f3c609943",
+ "9a3bcca4-b149-42c0-b474-7c2f3c609943"
+ ]
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-bd8702a4e2cf964594be282d8d45a55e-c8326ed5dbc31344-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "2d13906b7980ff470efa84d09d2e4a2c",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "90",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "2d13906b7980ff470efa84d09d2e4a2c",
+ "x-ms-request-id": [
+ "22ea4671-6a44-4b15-bfff-142423847029",
+ "22ea4671-6a44-4b15-bfff-142423847029"
+ ]
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/7af0c69a-a548-47d6-aea3-d00e69bd83aa?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-dce74ce3eaac5c47af5bb063e85c1cbe-13091ea6f80fb240-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "a415bc2966d3c8fb7a8457a017388533",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "81",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:35 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "a415bc2966d3c8fb7a8457a017388533",
+ "x-ms-request-id": [
+ "b9465d1f-b603-4230-af65-c3bcd10cd345",
+ "b9465d1f-b603-4230-af65-c3bcd10cd345"
+ ]
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "1717972985"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinitionAsync.json b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinitionAsync.json
new file mode 100644
index 000000000000..7f60d0bc1b31
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/SessionRecords/AccessControlClientLiveTests/TestGetRoleDefinitionAsync.json
@@ -0,0 +1,165 @@
+{
+ "Entries": [
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "e35a3d49af69d045432ec763c800e2b5",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "272",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "e35a3d49af69d045432ec763c800e2b5",
+ "x-ms-request-id": [
+ "d17e4081-462b-46d5-868f-d37f1a88b76f",
+ "d17e4081-462b-46d5-868f-d37f1a88b76f"
+ ]
+ },
+ "ResponseBody": {
+ "value": [
+ {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ },
+ {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ ]
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/6e4bf58a-b8e1-4cc3-bbf9-d73143322b78?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-88298788dc2ca249b6d408e2875727e0-1afab985b023d843-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "70a97fc50dd05a4ffceacb3aad23af51",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "87",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "70a97fc50dd05a4ffceacb3aad23af51",
+ "x-ms-request-id": [
+ "9a6224be-86be-41d4-98c8-75ff1c33a58c",
+ "9a6224be-86be-41d4-98c8-75ff1c33a58c"
+ ]
+ },
+ "ResponseBody": {
+ "id": "6e4bf58a-b8e1-4cc3-bbf9-d73143322b78",
+ "name": "Workspace Admin",
+ "isBuiltIn": true
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/c3a6d2f1-a26f-4810-9b0f-591308d5cbf1?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-405ef6ed1defe04ea9a0d18ac197fda1-4696f3f061362142-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "88de35ed1e70c9c8c05e0764ea890bd5",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "90",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "88de35ed1e70c9c8c05e0764ea890bd5",
+ "x-ms-request-id": [
+ "6f64fad1-8a51-424d-b23a-b501a1574c1b",
+ "6f64fad1-8a51-424d-b23a-b501a1574c1b"
+ ]
+ },
+ "ResponseBody": {
+ "id": "c3a6d2f1-a26f-4810-9b0f-591308d5cbf1",
+ "name": "Apache Spark Admin",
+ "isBuiltIn": true
+ }
+ },
+ {
+ "RequestUri": "https://testsynapseworkspace.dev.azuresynapse.net/rbac/roles/7af0c69a-a548-47d6-aea3-d00e69bd83aa?api-version=2020-02-01-preview",
+ "RequestMethod": "GET",
+ "RequestHeaders": {
+ "Authorization": "Sanitized",
+ "traceparent": "00-28dcd453d7a62643a9d654d0211ca06c-d006277cd756ce40-00",
+ "User-Agent": [
+ "azsdk-net-Analytics.Synapse.AccessControl/1.0.0-dev.20200525.1",
+ "(.NET Core 4.6.28801.04; Microsoft Windows 10.0.17763 )"
+ ],
+ "x-ms-client-request-id": "dd928f27b3c63c3bed00e67ee30b231f",
+ "x-ms-return-client-request-id": "true"
+ },
+ "RequestBody": null,
+ "StatusCode": 200,
+ "ResponseHeaders": {
+ "Content-Length": "81",
+ "Content-Type": "application/json; charset=utf-8",
+ "Date": "Mon, 25 May 2020 09:53:37 GMT",
+ "Server": [
+ "Microsoft-HTTPAPI/2.0",
+ "Microsoft-HTTPAPI/2.0"
+ ],
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
+ "x-ms-client-request-id": "dd928f27b3c63c3bed00e67ee30b231f",
+ "x-ms-request-id": [
+ "65354f1d-ff01-4874-b2e0-383ad4821b2a",
+ "65354f1d-ff01-4874-b2e0-383ad4821b2a"
+ ]
+ },
+ "ResponseBody": {
+ "id": "7af0c69a-a548-47d6-aea3-d00e69bd83aa",
+ "name": "Sql Admin",
+ "isBuiltIn": true
+ }
+ }
+ ],
+ "Variables": {
+ "AZURE_SYNAPSE_WORKSPACE_URL": "https://testsynapseworkspace.dev.azuresynapse.net",
+ "RandomSeed": "1252128898"
+ }
+}
\ No newline at end of file
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/Sample1_AddAndRemoveRoleAssignment.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/Sample1_AddAndRemoveRoleAssignment.cs
new file mode 100644
index 000000000000..f17818078f53
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/Sample1_AddAndRemoveRoleAssignment.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using Azure.Analytics.Synapse.AccessControl;
+using Azure.Analytics.Synapse.AccessControl.Models;
+using Azure.Identity;
+using NUnit.Framework;
+
+namespace Azure.Analytics.Synapse.Samples
+{
+ ///
+ /// This sample demonstrates how to submit Spark job in Azure Synapse Analytics using synchronous methods of .
+ ///
+ public partial class AddAndRemoveRoleAssignment
+ {
+ [Test]
+ public void SubmitSparkJobSync()
+ {
+ // Environment variable with the Synapse workspace endpoint.
+ string workspaceUrl = TestEnvironment.WorkspaceUrl;
+
+ #region Snippet:AccessControlSample1AccessControlClient
+ AccessControlClient client = new AccessControlClient(new Uri(workspaceUrl), new DefaultAzureCredential());
+ #endregion
+
+ #region Snippet:AccessControlSample1GetWorkspaceAdminRole
+ SynapseRole role = client.GetRoleDefinitions().Single(role => role.Name == "Workspace Admin");
+ #endregion
+
+ #region Snippet:AccessControlSample1AddRoleAssignment
+ string principalId = Guid.NewGuid().ToString();
+ RoleAssignmentOptions request = new RoleAssignmentOptions(roleId:role.Id, principalId:principalId);
+ RoleAssignmentDetails roleAssignmentAdded = client.CreateRoleAssignment(request);
+ #endregion
+
+ #region Snippet:AccessControlSample1GetRoleAssignment
+ RoleAssignmentDetails roleAssignment = client.GetRoleAssignmentById(principalId);
+ Debug.WriteLine($"Role {roleAssignment.RoleId} is assigned to {roleAssignment.PrincipalId}. Role assignment id: {roleAssignment.Id}");
+ #endregion
+
+ #region Snippet:AccessControlSample1ListRoleAssignments
+ IReadOnlyList roleAssignments = client.GetRoleAssignments().Value;
+ foreach (RoleAssignmentDetails assignment in roleAssignments)
+ {
+ Console.WriteLine(assignment.Id);
+ }
+ #endregion
+
+ #region Snippet:AccessControlSample1RemoveRoleAssignment
+ client.DeleteRoleAssignmentById(roleAssignment.Id);
+ #endregion
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/SampleSnippets.cs b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/SampleSnippets.cs
new file mode 100644
index 000000000000..4ab7df0bfb42
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.AccessControl/tests/samples/SampleSnippets.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Azure.Analytics.Synapse.AccessControl.Models;
+using Azure.Analytics.Synapse.Samples;
+using Azure.Identity;
+using NUnit.Framework;
+
+namespace Azure.Analytics.Synapse.AccessControl.Samples
+{
+ public partial class Snippets : SampleFixture
+ {
+#pragma warning disable IDE1006 // Naming Styles
+ private AccessControlClient client;
+#pragma warning restore IDE1006 // Naming Styles
+
+ [OneTimeSetUp]
+ public void CreateClient()
+ {
+ // Environment variable with the Synapse workspace endpoint.
+ string workspaceUrl = TestEnvironment.WorkspaceUrl;
+
+ #region Snippet:CreateAccessControlClient
+ // Create a new access control client using the default credential from Azure.Identity using environment variables previously set,
+ // including AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID.
+ AccessControlClient client = new AccessControlClient(endpoint: new Uri(workspaceUrl), credential: new DefaultAzureCredential());
+ #endregion
+
+ this.client = client;
+ }
+
+ [Test]
+ public void CreateRoleAssignment()
+ {
+ string principalId = TestEnvironment.PrincipalId;
+ string sqlAdminRoleId = client.GetRoleDefinitions().AsEnumerable().Single(role => role.Name == "Sql Admin").Id;
+
+ #region Snippet:CreateRoleAssignment
+ RoleAssignmentOptions options = new RoleAssignmentOptions(sqlAdminRoleId, principalId);
+ RoleAssignmentDetails roleAssignment = client.CreateRoleAssignment(options);
+ #endregion
+ }
+
+ [Test]
+ public void RetrieveRoleAssignment()
+ {
+ string principalId = TestEnvironment.PrincipalId;
+
+ #region Snippet:RetrieveRoleAssignment
+ RoleAssignmentDetails roleAssignment = client.GetRoleAssignmentById(principalId);
+ #endregion
+ }
+
+ [Test]
+ public void ListRoleAssignments()
+ {
+ #region Snippet:ListRoleAssignments
+ IReadOnlyList roleAssignments = client.GetRoleAssignments().Value;
+ foreach (RoleAssignmentDetails assignment in roleAssignments)
+ {
+ Console.WriteLine(assignment.Id);
+ }
+ #endregion
+ }
+
+ [Test]
+ public void DeleteRoleAssignment()
+ {
+ string principalId = TestEnvironment.PrincipalId;
+ RoleAssignmentDetails roleAssignment = client.GetRoleAssignmentById(principalId);
+
+ #region Snippet:DeleteRoleAssignment
+ client.DeleteRoleAssignmentById(roleAssignment.Id);
+ #endregion
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/CHANGELOG.md b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/CHANGELOG.md
new file mode 100644
index 000000000000..6bb129c6bb9a
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/CHANGELOG.md
@@ -0,0 +1,4 @@
+# Release History
+
+## 1.0.0-preview.1 (Unreleased)
+- Initial release
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/Directory.Build.props b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/Directory.Build.props
new file mode 100644
index 000000000000..1a9611bd4924
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md
new file mode 100644
index 000000000000..e4078f796d0e
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/README.md
@@ -0,0 +1,126 @@
+# Azure Synapse Analytics Artifacts client library for .NET
+
+This directory contains the open source subset of the .NET SDK. For documentation of the complete Azure SDK, please see the [Microsoft Azure .NET Developer Center](http://azure.microsoft.com/en-us/develop/net/).
+
+The Azure Synapse Analytics development client library enables programmatically managing artifacts, offering methods to create, update, list, and delete pipelines, datasets, data flows, notebooks, Spark job definitions, SQL scripts, linked services and triggers.
+
+Azure Synapse is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless on-demand or provisioned resources—at scale. Azure Synapse brings these two worlds together with a unified experience to ingest, prepare, manage, and serve data for immediate BI and machine learning needs.
+
+## Getting started
+
+The complete Microsoft Azure SDK can be downloaded from the [Microsoft Azure Downloads Page](http://azure.microsoft.com/en-us/downloads/?sdk=net) and ships with support for building deployment packages, integrating with tooling, rich command line tooling, and more.
+
+For the best development experience, developers should use the official Microsoft NuGet packages for libraries. NuGet packages are regularly updated with new functionality and hotfixes.
+
+### Install the package
+Install the Azure Synapse Analytics development client library for .NET with [NuGet][nuget]:
+
+```PowerShell
+dotnet add package Azure.Analytics.Synapse.Artifacts --version 0.1.0-preview.1
+```
+
+### Prerequisites
+* An [Azure subscription][azure_sub].
+* An existing Azure Synapse workspace. If you need to create an Azure Synapse workspace, you can use the Azure Portal or [Azure CLI][azure_cli].
+
+If you use the Azure CLI, the command looks like below:
+
+```PowerShell
+az synapse workspace create \
+ --name \
+ --resource-group \
+ --storage-account \
+ --file-system \
+ --sql-admin-login-user \
+ --sql-admin-login-password \
+ --location
+```
+
+### Authenticate the client
+In order to interact with the Azure Synapse Analytics service, you'll need to create an instance of the [ArtifactsClient][development_client_class] class. You need a **workspace endpoint**, which you may see as "Development endpoint" in the portal,
+ and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object.
+
+Client secret credential authentication is being used in this getting started section but you can find more ways to authenticate with [Azure identity][azure_identity]. To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below,
+or other credential providers provided with the Azure SDK, you should install the Azure.Identity package:
+
+```PowerShell
+Install-Package Azure.Identity
+```
+
+## Examples
+The Azure.Analytics.Synapse.Artifacts package supports synchronous and asynchronous APIs. The following section covers some of the most common Azure Synapse Analytics development related tasks:
+
+### Notebook examples
+* [Create a notebook](#create-a-notebook)
+* [Retrieve a notebook](#retrieve-a-notebook)
+* [List notebooks](#list-notebooks)
+* [Delete a notebook](#delete-a-notebook)
+
+### Create a notebook
+
+`CreateOrUpdateNotebook` creates a notebook.
+
+```C# Snippet:CreateNotebook
+Notebook notebook = new Notebook(
+ new NotebookMetadata
+ {
+ LanguageInfo = new NotebookLanguageInfo(name: "Python")
+ },
+ nbformat: 4,
+ nbformatMinor: 2,
+ new List()
+);
+NotebookResource createdNotebook = notebookClient.CreateOrUpdateNotebook("MyNotebook", new NotebookResource(notebook));
+```
+
+### Retrieve a notebook
+
+`GetNoteBook` retrieves a notebook.
+
+```C# Snippet:RetrieveNotebook
+NotebookResource notebook = notebookClient.GetNotebook("MyNotebook");
+```
+
+### List notebooks
+`GetNotebooksByWorkspace` enumerates the notebooks in the Synapse workspace.
+
+```C# Snippet:ListNotebooks
+Pageable notebooks = notebookClient.GetNotebooksByWorkspace();
+foreach (NotebookResource notebook in notebooks)
+{
+ System.Console.WriteLine(notebook.Name);
+}
+```
+
+### Delete a notebook
+
+`DeleteNotebook` deletes a notebook.
+
+```C# Snippet:DeleteNotebook
+notebookClient.DeleteNotebook("MyNotebook");
+```
+
+## To build
+
+For information on building the Azure Synapse client library, please see [Building the Microsoft Azure SDK for .NET](https://github.com/azure/azure-sdk-for-net#to-build)
+
+## Target frameworks
+
+For information about the target frameworks of the Azure Synapse client library, please refer to the [Target Frameworks](https://github.com/azure/azure-sdk-for-net#target-frameworks) of the Microsoft Azure SDK for .NET.
+
+## Key concepts
+
+### NotebookControlClient
+With a notebook client you can create, update, list, and delete pipelines, datasets, data flows, notebooks, Spark job definitions, SQL scripts, linked services and triggers.
+
+## Troubleshooting
+
+Please open issue in github.
+
+## Next steps
+
+The next step is adding more examples
+
+## Contributing
+
+This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Azure.Analytics.Synapse.Artifacts.csproj b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Azure.Analytics.Synapse.Artifacts.csproj
new file mode 100644
index 000000000000..de503121e2ff
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Azure.Analytics.Synapse.Artifacts.csproj
@@ -0,0 +1,43 @@
+
+
+ This is the Microsoft Azure Synapse Analytics Artifacts client library
+ Azure.Analytics.Synapse.Artifacts
+ 1.0.0-preview.1
+ Microsoft Azure Synapse Artifacts;$(PackageCommonTags)
+ $(RequiredTargetFrameworks)
+ false
+
+
+ $(NoWarn);
+ SA1649;
+ CA1812;
+
+ CS1591;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/ArtifactsClientOptions.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/ArtifactsClientOptions.cs
new file mode 100644
index 000000000000..bb3b9ac8def2
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/ArtifactsClientOptions.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using Azure.Core;
+using System;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ ///
+ /// The options for Azure Synapse Artifacts.
+ ///
+ public class ArtifactsClientOptions : ClientOptions
+ {
+ private const ServiceVersion Latest = ServiceVersion.V2019_06_01_preview;
+
+ internal static ArtifactsClientOptions Default { get; } = new ArtifactsClientOptions();
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public ArtifactsClientOptions(ServiceVersion serviceVersion = Latest)
+ {
+ VersionString = serviceVersion switch
+ {
+ ServiceVersion.V2019_06_01_preview => "2019-06-01-preview",
+ _ => throw new ArgumentOutOfRangeException(nameof(serviceVersion))
+ };
+ }
+
+ ///
+ /// API version for Azuer Synapse Artifacts.
+ ///
+ internal string VersionString { get; }
+
+ ///
+ /// The Synapse service version.
+ ///
+ public enum ServiceVersion
+ {
+ ///
+ /// The 2019-06-01-preview of the template service.
+ ///
+#pragma warning disable CA1707
+ V2019_06_01_preview = 1
+#pragma warning restore CA1707
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowClient.cs
new file mode 100644
index 000000000000..ff3006a103c0
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class DataFlowClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DataFlowClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DataFlowClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowDebugSessionClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowDebugSessionClient.cs
new file mode 100644
index 000000000000..7a9e152195ca
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DataFlowDebugSessionClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class DataFlowDebugSessionClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DataFlowDebugSessionClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DataFlowDebugSessionClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DatasetClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DatasetClient.cs
new file mode 100644
index 000000000000..027867b3856d
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/DatasetClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class DatasetClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DatasetClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public DatasetClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/LinkedServiceClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/LinkedServiceClient.cs
new file mode 100644
index 000000000000..854c0da770f6
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/LinkedServiceClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class LinkedServiceClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public LinkedServiceClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public LinkedServiceClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/NotebookClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/NotebookClient.cs
new file mode 100644
index 000000000000..ee3a04ee8541
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/NotebookClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class NotebookClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public NotebookClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public NotebookClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineClient.cs
new file mode 100644
index 000000000000..73ab482b1c43
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class PipelineClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public PipelineClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public PipelineClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineRunClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineRunClient.cs
new file mode 100644
index 000000000000..7801cf8d0d81
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/PipelineRunClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class PipelineRunClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public PipelineRunClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public PipelineRunClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SparkJobDefinitionClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SparkJobDefinitionClient.cs
new file mode 100644
index 000000000000..772fc28e85af
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SparkJobDefinitionClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class SparkJobDefinitionClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public SparkJobDefinitionClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public SparkJobDefinitionClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SqlScriptClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SqlScriptClient.cs
new file mode 100644
index 000000000000..8629a715c3ae
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/SqlScriptClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class SqlScriptClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public SqlScriptClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public SqlScriptClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerClient.cs
new file mode 100644
index 000000000000..7e32c6b41110
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class TriggerClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public TriggerClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public TriggerClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerRunClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerRunClient.cs
new file mode 100644
index 000000000000..a7d42a3d1803
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Customization/TriggerRunClient.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ public partial class TriggerRunClient
+ {
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public TriggerRunClient(Uri endpoint, TokenCredential credential)
+ : this(endpoint, credential, ArtifactsClientOptions.Default)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ public TriggerRunClient(Uri endpoint, TokenCredential credential, ArtifactsClientOptions options)
+ : this(new ClientDiagnostics(options),
+ SynapseClientPipeline.Build(options, credential),
+ endpoint.ToString(),
+ options.VersionString)
+ {
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowClient.cs
new file mode 100644
index 000000000000..62c494014476
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowClient.cs
@@ -0,0 +1,228 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// The DataFlow service client.
+ public partial class DataFlowClient
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal DataFlowRestClient RestClient { get; }
+ /// Initializes a new instance of DataFlowClient for mocking.
+ protected DataFlowClient()
+ {
+ }
+ /// Initializes a new instance of DataFlowClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ internal DataFlowClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ RestClient = new DataFlowRestClient(clientDiagnostics, pipeline, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Creates or updates a data flow.
+ /// The data flow name.
+ /// Data flow resource definition.
+ /// ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual async Task> CreateOrUpdateDataFlowAsync(string dataFlowName, DataFlowResource dataFlow, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.CreateOrUpdateDataFlow");
+ scope.Start();
+ try
+ {
+ return await RestClient.CreateOrUpdateDataFlowAsync(dataFlowName, dataFlow, ifMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Creates or updates a data flow.
+ /// The data flow name.
+ /// Data flow resource definition.
+ /// ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual Response CreateOrUpdateDataFlow(string dataFlowName, DataFlowResource dataFlow, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.CreateOrUpdateDataFlow");
+ scope.Start();
+ try
+ {
+ return RestClient.CreateOrUpdateDataFlow(dataFlowName, dataFlow, ifMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a data flow.
+ /// The data flow name.
+ /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual async Task> GetDataFlowAsync(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlow");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetDataFlowAsync(dataFlowName, ifNoneMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a data flow.
+ /// The data flow name.
+ /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual Response GetDataFlow(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlow");
+ scope.Start();
+ try
+ {
+ return RestClient.GetDataFlow(dataFlowName, ifNoneMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a data flow.
+ /// The data flow name.
+ /// The cancellation token to use.
+ public virtual async Task DeleteDataFlowAsync(string dataFlowName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.DeleteDataFlow");
+ scope.Start();
+ try
+ {
+ return await RestClient.DeleteDataFlowAsync(dataFlowName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a data flow.
+ /// The data flow name.
+ /// The cancellation token to use.
+ public virtual Response DeleteDataFlow(string dataFlowName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.DeleteDataFlow");
+ scope.Start();
+ try
+ {
+ return RestClient.DeleteDataFlow(dataFlowName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Lists data flows.
+ /// The cancellation token to use.
+ public virtual AsyncPageable GetDataFlowsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlowsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetDataFlowsByWorkspaceAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlowsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetDataFlowsByWorkspaceNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Lists data flows.
+ /// The cancellation token to use.
+ public virtual Pageable GetDataFlowsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlowsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetDataFlowsByWorkspace(cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowClient.GetDataFlowsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetDataFlowsByWorkspaceNextPage(nextLink, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionClient.cs
new file mode 100644
index 000000000000..0cd1550ee549
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionClient.cs
@@ -0,0 +1,282 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// The DataFlowDebugSession service client.
+ public partial class DataFlowDebugSessionClient
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal DataFlowDebugSessionRestClient RestClient { get; }
+ /// Initializes a new instance of DataFlowDebugSessionClient for mocking.
+ protected DataFlowDebugSessionClient()
+ {
+ }
+ /// Initializes a new instance of DataFlowDebugSessionClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ internal DataFlowDebugSessionClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ RestClient = new DataFlowDebugSessionRestClient(clientDiagnostics, pipeline, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Add a data flow into debug session.
+ /// Data flow debug session definition with debug content.
+ /// The cancellation token to use.
+ public virtual async Task> AddDataFlowAsync(DataFlowDebugPackage request, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.AddDataFlow");
+ scope.Start();
+ try
+ {
+ return await RestClient.AddDataFlowAsync(request, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Add a data flow into debug session.
+ /// Data flow debug session definition with debug content.
+ /// The cancellation token to use.
+ public virtual Response AddDataFlow(DataFlowDebugPackage request, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.AddDataFlow");
+ scope.Start();
+ try
+ {
+ return RestClient.AddDataFlow(request, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a data flow debug session.
+ /// Data flow debug session definition for deletion.
+ /// The cancellation token to use.
+ public virtual async Task DeleteDataFlowDebugSessionAsync(DeleteDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.DeleteDataFlowDebugSession");
+ scope.Start();
+ try
+ {
+ return await RestClient.DeleteDataFlowDebugSessionAsync(request, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a data flow debug session.
+ /// Data flow debug session definition for deletion.
+ /// The cancellation token to use.
+ public virtual Response DeleteDataFlowDebugSession(DeleteDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.DeleteDataFlowDebugSession");
+ scope.Start();
+ try
+ {
+ return RestClient.DeleteDataFlowDebugSession(request, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The cancellation token to use.
+ public virtual AsyncPageable QueryDataFlowDebugSessionsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.QueryDataFlowDebugSessionsByWorkspaceAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.QueryDataFlowDebugSessionsByWorkspaceNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The cancellation token to use.
+ public virtual Pageable QueryDataFlowDebugSessionsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.QueryDataFlowDebugSessionsByWorkspace(cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.QueryDataFlowDebugSessionsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.QueryDataFlowDebugSessionsByWorkspaceNextPage(nextLink, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Creates a data flow debug session.
+ /// Data flow debug session definition.
+ /// The cancellation token to use.
+ public virtual async Task StartCreateDataFlowDebugSessionAsync(CreateDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartCreateDataFlowDebugSession");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.CreateDataFlowDebugSessionAsync(request, cancellationToken).ConfigureAwait(false);
+ return new DataFlowDebugSessionCreateDataFlowDebugSessionOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateDataFlowDebugSessionRequest(request).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Creates a data flow debug session.
+ /// Data flow debug session definition.
+ /// The cancellation token to use.
+ public virtual DataFlowDebugSessionCreateDataFlowDebugSessionOperation StartCreateDataFlowDebugSession(CreateDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartCreateDataFlowDebugSession");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.CreateDataFlowDebugSession(request, cancellationToken);
+ return new DataFlowDebugSessionCreateDataFlowDebugSessionOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateDataFlowDebugSessionRequest(request).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Execute a data flow debug command.
+ /// Data flow debug command definition.
+ /// The cancellation token to use.
+ public virtual async Task StartExecuteCommandAsync(DataFlowDebugCommandRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartExecuteCommand");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.ExecuteCommandAsync(request, cancellationToken).ConfigureAwait(false);
+ return new DataFlowDebugSessionExecuteCommandOperation(_clientDiagnostics, _pipeline, RestClient.CreateExecuteCommandRequest(request).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Execute a data flow debug command.
+ /// Data flow debug command definition.
+ /// The cancellation token to use.
+ public virtual DataFlowDebugSessionExecuteCommandOperation StartExecuteCommand(DataFlowDebugCommandRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("DataFlowDebugSessionClient.StartExecuteCommand");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.ExecuteCommand(request, cancellationToken);
+ return new DataFlowDebugSessionExecuteCommandOperation(_clientDiagnostics, _pipeline, RestClient.CreateExecuteCommandRequest(request).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionCreateDataFlowDebugSessionOperation.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionCreateDataFlowDebugSessionOperation.cs
new file mode 100644
index 000000000000..308208b988ae
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionCreateDataFlowDebugSessionOperation.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// Creates a data flow debug session.
+ public partial class DataFlowDebugSessionCreateDataFlowDebugSessionOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+ internal DataFlowDebugSessionCreateDataFlowDebugSessionOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "DataFlowDebugSessionCreateDataFlowDebugSessionOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override CreateDataFlowDebugSessionResponse Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ CreateDataFlowDebugSessionResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ else
+ {
+ return CreateDataFlowDebugSessionResponse.DeserializeCreateDataFlowDebugSessionResponse(document.RootElement);
+ }
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ else
+ {
+ return CreateDataFlowDebugSessionResponse.DeserializeCreateDataFlowDebugSessionResponse(document.RootElement);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionExecuteCommandOperation.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionExecuteCommandOperation.cs
new file mode 100644
index 000000000000..d2a5657f22e4
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionExecuteCommandOperation.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// Execute a data flow debug command.
+ public partial class DataFlowDebugSessionExecuteCommandOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+ internal DataFlowDebugSessionExecuteCommandOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "DataFlowDebugSessionExecuteCommandOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override DataFlowDebugCommandResponse Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ DataFlowDebugCommandResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ else
+ {
+ return DataFlowDebugCommandResponse.DeserializeDataFlowDebugCommandResponse(document.RootElement);
+ }
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ else
+ {
+ return DataFlowDebugCommandResponse.DeserializeDataFlowDebugCommandResponse(document.RootElement);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionRestClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionRestClient.cs
new file mode 100644
index 000000000000..051c8298c49a
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowDebugSessionRestClient.cs
@@ -0,0 +1,458 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ internal partial class DataFlowDebugSessionRestClient
+ {
+ private string endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of DataFlowDebugSessionRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ /// This occurs when one of the required arguments is null.
+ public DataFlowDebugSessionRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ if (endpoint == null)
+ {
+ throw new ArgumentNullException(nameof(endpoint));
+ }
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateCreateDataFlowDebugSessionRequest(CreateDataFlowDebugSessionRequest request)
+ {
+ var message = _pipeline.CreateMessage();
+ var request0 = message.Request;
+ request0.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/createDataFlowDebugSession", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request0.Uri = uri;
+ request0.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(request);
+ request0.Content = content;
+ return message;
+ }
+
+ /// Creates a data flow debug session.
+ /// Data flow debug session definition.
+ /// The cancellation token to use.
+ public async Task CreateDataFlowDebugSessionAsync(CreateDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateCreateDataFlowDebugSessionRequest(request);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Creates a data flow debug session.
+ /// Data flow debug session definition.
+ /// The cancellation token to use.
+ public Response CreateDataFlowDebugSession(CreateDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateCreateDataFlowDebugSessionRequest(request);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateQueryDataFlowDebugSessionsByWorkspaceRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/queryDataFlowDebugSessions", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The cancellation token to use.
+ public async Task> QueryDataFlowDebugSessionsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateQueryDataFlowDebugSessionsByWorkspaceRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ QueryDataFlowDebugSessionsResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The cancellation token to use.
+ public Response QueryDataFlowDebugSessionsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateQueryDataFlowDebugSessionsByWorkspaceRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ QueryDataFlowDebugSessionsResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateAddDataFlowRequest(DataFlowDebugPackage request)
+ {
+ var message = _pipeline.CreateMessage();
+ var request0 = message.Request;
+ request0.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/addDataFlowToDebugSession", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request0.Uri = uri;
+ request0.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(request);
+ request0.Content = content;
+ return message;
+ }
+
+ /// Add a data flow into debug session.
+ /// Data flow debug session definition with debug content.
+ /// The cancellation token to use.
+ public async Task> AddDataFlowAsync(DataFlowDebugPackage request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateAddDataFlowRequest(request);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ AddDataFlowToDebugSessionResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = AddDataFlowToDebugSessionResponse.DeserializeAddDataFlowToDebugSessionResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Add a data flow into debug session.
+ /// Data flow debug session definition with debug content.
+ /// The cancellation token to use.
+ public Response AddDataFlow(DataFlowDebugPackage request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateAddDataFlowRequest(request);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ AddDataFlowToDebugSessionResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = AddDataFlowToDebugSessionResponse.DeserializeAddDataFlowToDebugSessionResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteDataFlowDebugSessionRequest(DeleteDataFlowDebugSessionRequest request)
+ {
+ var message = _pipeline.CreateMessage();
+ var request0 = message.Request;
+ request0.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/deleteDataFlowDebugSession", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request0.Uri = uri;
+ request0.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(request);
+ request0.Content = content;
+ return message;
+ }
+
+ /// Deletes a data flow debug session.
+ /// Data flow debug session definition for deletion.
+ /// The cancellation token to use.
+ public async Task DeleteDataFlowDebugSessionAsync(DeleteDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateDeleteDataFlowDebugSessionRequest(request);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes a data flow debug session.
+ /// Data flow debug session definition for deletion.
+ /// The cancellation token to use.
+ public Response DeleteDataFlowDebugSession(DeleteDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateDeleteDataFlowDebugSessionRequest(request);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateExecuteCommandRequest(DataFlowDebugCommandRequest request)
+ {
+ var message = _pipeline.CreateMessage();
+ var request0 = message.Request;
+ request0.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/executeDataFlowDebugCommand", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request0.Uri = uri;
+ request0.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(request);
+ request0.Content = content;
+ return message;
+ }
+
+ /// Execute a data flow debug command.
+ /// Data flow debug command definition.
+ /// The cancellation token to use.
+ public async Task ExecuteCommandAsync(DataFlowDebugCommandRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateExecuteCommandRequest(request);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Execute a data flow debug command.
+ /// Data flow debug command definition.
+ /// The cancellation token to use.
+ public Response ExecuteCommand(DataFlowDebugCommandRequest request, CancellationToken cancellationToken = default)
+ {
+ if (request == null)
+ {
+ throw new ArgumentNullException(nameof(request));
+ }
+
+ using var message = CreateExecuteCommandRequest(request);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(string nextLink)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public async Task> QueryDataFlowDebugSessionsByWorkspaceNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(nextLink);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ QueryDataFlowDebugSessionsResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Query all active data flow debug sessions.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public Response QueryDataFlowDebugSessionsByWorkspaceNextPage(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateQueryDataFlowDebugSessionsByWorkspaceNextPageRequest(nextLink);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ QueryDataFlowDebugSessionsResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = QueryDataFlowDebugSessionsResponse.DeserializeQueryDataFlowDebugSessionsResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowRestClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowRestClient.cs
new file mode 100644
index 000000000000..587a91dc610c
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DataFlowRestClient.cs
@@ -0,0 +1,438 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ internal partial class DataFlowRestClient
+ {
+ private string endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of DataFlowRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ /// This occurs when one of the required arguments is null.
+ public DataFlowRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ if (endpoint == null)
+ {
+ throw new ArgumentNullException(nameof(endpoint));
+ }
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateCreateOrUpdateDataFlowRequest(string dataFlowName, DataFlowResource dataFlow, string ifMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/dataflows/", false);
+ uri.AppendPath(dataFlowName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifMatch != null)
+ {
+ request.Headers.Add("If-Match", ifMatch);
+ }
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(dataFlow);
+ request.Content = content;
+ return message;
+ }
+
+ /// Creates or updates a data flow.
+ /// The data flow name.
+ /// Data flow resource definition.
+ /// ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public async Task> CreateOrUpdateDataFlowAsync(string dataFlowName, DataFlowResource dataFlow, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+ if (dataFlow == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlow));
+ }
+
+ using var message = CreateCreateOrUpdateDataFlowRequest(dataFlowName, dataFlow, ifMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowResource.DeserializeDataFlowResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Creates or updates a data flow.
+ /// The data flow name.
+ /// Data flow resource definition.
+ /// ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public Response CreateOrUpdateDataFlow(string dataFlowName, DataFlowResource dataFlow, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+ if (dataFlow == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlow));
+ }
+
+ using var message = CreateCreateOrUpdateDataFlowRequest(dataFlowName, dataFlow, ifMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowResource.DeserializeDataFlowResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetDataFlowRequest(string dataFlowName, string ifNoneMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/dataflows/", false);
+ uri.AppendPath(dataFlowName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifNoneMatch != null)
+ {
+ request.Headers.Add("If-None-Match", ifNoneMatch);
+ }
+ return message;
+ }
+
+ /// Gets a data flow.
+ /// The data flow name.
+ /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public async Task> GetDataFlowAsync(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+
+ using var message = CreateGetDataFlowRequest(dataFlowName, ifNoneMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowResource.DeserializeDataFlowResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Gets a data flow.
+ /// The data flow name.
+ /// ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public Response GetDataFlow(string dataFlowName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+
+ using var message = CreateGetDataFlowRequest(dataFlowName, ifNoneMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowResource.DeserializeDataFlowResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteDataFlowRequest(string dataFlowName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/dataflows/", false);
+ uri.AppendPath(dataFlowName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Deletes a data flow.
+ /// The data flow name.
+ /// The cancellation token to use.
+ public async Task DeleteDataFlowAsync(string dataFlowName, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+
+ using var message = CreateDeleteDataFlowRequest(dataFlowName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes a data flow.
+ /// The data flow name.
+ /// The cancellation token to use.
+ public Response DeleteDataFlow(string dataFlowName, CancellationToken cancellationToken = default)
+ {
+ if (dataFlowName == null)
+ {
+ throw new ArgumentNullException(nameof(dataFlowName));
+ }
+
+ using var message = CreateDeleteDataFlowRequest(dataFlowName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetDataFlowsByWorkspaceRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/dataflows", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists data flows.
+ /// The cancellation token to use.
+ public async Task> GetDataFlowsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetDataFlowsByWorkspaceRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowListResponse.DeserializeDataFlowListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists data flows.
+ /// The cancellation token to use.
+ public Response GetDataFlowsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetDataFlowsByWorkspaceRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowListResponse.DeserializeDataFlowListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetDataFlowsByWorkspaceNextPageRequest(string nextLink)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists data flows.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public async Task> GetDataFlowsByWorkspaceNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetDataFlowsByWorkspaceNextPageRequest(nextLink);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowListResponse.DeserializeDataFlowListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists data flows.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public Response GetDataFlowsByWorkspaceNextPage(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetDataFlowsByWorkspaceNextPageRequest(nextLink);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataFlowListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DataFlowListResponse.DeserializeDataFlowListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetClient.cs
new file mode 100644
index 000000000000..b95014a09a4b
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetClient.cs
@@ -0,0 +1,228 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// The Dataset service client.
+ public partial class DatasetClient
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal DatasetRestClient RestClient { get; }
+ /// Initializes a new instance of DatasetClient for mocking.
+ protected DatasetClient()
+ {
+ }
+ /// Initializes a new instance of DatasetClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ internal DatasetClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ RestClient = new DatasetRestClient(clientDiagnostics, pipeline, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Creates or updates a dataset.
+ /// The dataset name.
+ /// Dataset resource definition.
+ /// ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual async Task> CreateOrUpdateDatasetAsync(string datasetName, DatasetResource dataset, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.CreateOrUpdateDataset");
+ scope.Start();
+ try
+ {
+ return await RestClient.CreateOrUpdateDatasetAsync(datasetName, dataset, ifMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Creates or updates a dataset.
+ /// The dataset name.
+ /// Dataset resource definition.
+ /// ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual Response CreateOrUpdateDataset(string datasetName, DatasetResource dataset, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.CreateOrUpdateDataset");
+ scope.Start();
+ try
+ {
+ return RestClient.CreateOrUpdateDataset(datasetName, dataset, ifMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a dataset.
+ /// The dataset name.
+ /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual async Task> GetDatasetAsync(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDataset");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetDatasetAsync(datasetName, ifNoneMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a dataset.
+ /// The dataset name.
+ /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual Response GetDataset(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDataset");
+ scope.Start();
+ try
+ {
+ return RestClient.GetDataset(datasetName, ifNoneMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a dataset.
+ /// The dataset name.
+ /// The cancellation token to use.
+ public virtual async Task DeleteDatasetAsync(string datasetName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.DeleteDataset");
+ scope.Start();
+ try
+ {
+ return await RestClient.DeleteDatasetAsync(datasetName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a dataset.
+ /// The dataset name.
+ /// The cancellation token to use.
+ public virtual Response DeleteDataset(string datasetName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.DeleteDataset");
+ scope.Start();
+ try
+ {
+ return RestClient.DeleteDataset(datasetName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Lists datasets.
+ /// The cancellation token to use.
+ public virtual AsyncPageable GetDatasetsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDatasetsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetDatasetsByWorkspaceAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDatasetsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetDatasetsByWorkspaceNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Lists datasets.
+ /// The cancellation token to use.
+ public virtual Pageable GetDatasetsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDatasetsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetDatasetsByWorkspace(cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("DatasetClient.GetDatasetsByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetDatasetsByWorkspaceNextPage(nextLink, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetRestClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetRestClient.cs
new file mode 100644
index 000000000000..939ec0ec3971
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/DatasetRestClient.cs
@@ -0,0 +1,442 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ internal partial class DatasetRestClient
+ {
+ private string endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of DatasetRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ /// This occurs when one of the required arguments is null.
+ public DatasetRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ if (endpoint == null)
+ {
+ throw new ArgumentNullException(nameof(endpoint));
+ }
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateGetDatasetsByWorkspaceRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/datasets", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists datasets.
+ /// The cancellation token to use.
+ public async Task> GetDatasetsByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetDatasetsByWorkspaceRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetListResponse.DeserializeDatasetListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists datasets.
+ /// The cancellation token to use.
+ public Response GetDatasetsByWorkspace(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetDatasetsByWorkspaceRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetListResponse.DeserializeDatasetListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateOrUpdateDatasetRequest(string datasetName, DatasetResource dataset, string ifMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/datasets/", false);
+ uri.AppendPath(datasetName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifMatch != null)
+ {
+ request.Headers.Add("If-Match", ifMatch);
+ }
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(dataset);
+ request.Content = content;
+ return message;
+ }
+
+ /// Creates or updates a dataset.
+ /// The dataset name.
+ /// Dataset resource definition.
+ /// ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public async Task> CreateOrUpdateDatasetAsync(string datasetName, DatasetResource dataset, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+ if (dataset == null)
+ {
+ throw new ArgumentNullException(nameof(dataset));
+ }
+
+ using var message = CreateCreateOrUpdateDatasetRequest(datasetName, dataset, ifMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetResource.DeserializeDatasetResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Creates or updates a dataset.
+ /// The dataset name.
+ /// Dataset resource definition.
+ /// ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public Response CreateOrUpdateDataset(string datasetName, DatasetResource dataset, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+ if (dataset == null)
+ {
+ throw new ArgumentNullException(nameof(dataset));
+ }
+
+ using var message = CreateCreateOrUpdateDatasetRequest(datasetName, dataset, ifMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetResource.DeserializeDatasetResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetDatasetRequest(string datasetName, string ifNoneMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/datasets/", false);
+ uri.AppendPath(datasetName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifNoneMatch != null)
+ {
+ request.Headers.Add("If-None-Match", ifNoneMatch);
+ }
+ return message;
+ }
+
+ /// Gets a dataset.
+ /// The dataset name.
+ /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public async Task> GetDatasetAsync(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+
+ using var message = CreateGetDatasetRequest(datasetName, ifNoneMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetResource.DeserializeDatasetResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ case 304:
+ return Response.FromValue(null, message.Response);
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Gets a dataset.
+ /// The dataset name.
+ /// ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public Response GetDataset(string datasetName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+
+ using var message = CreateGetDatasetRequest(datasetName, ifNoneMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetResource.DeserializeDatasetResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ case 304:
+ return Response.FromValue(null, message.Response);
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteDatasetRequest(string datasetName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/datasets/", false);
+ uri.AppendPath(datasetName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Deletes a dataset.
+ /// The dataset name.
+ /// The cancellation token to use.
+ public async Task DeleteDatasetAsync(string datasetName, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+
+ using var message = CreateDeleteDatasetRequest(datasetName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes a dataset.
+ /// The dataset name.
+ /// The cancellation token to use.
+ public Response DeleteDataset(string datasetName, CancellationToken cancellationToken = default)
+ {
+ if (datasetName == null)
+ {
+ throw new ArgumentNullException(nameof(datasetName));
+ }
+
+ using var message = CreateDeleteDatasetRequest(datasetName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetDatasetsByWorkspaceNextPageRequest(string nextLink)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists datasets.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public async Task> GetDatasetsByWorkspaceNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetDatasetsByWorkspaceNextPageRequest(nextLink);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetListResponse.DeserializeDatasetListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists datasets.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public Response GetDatasetsByWorkspaceNextPage(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetDatasetsByWorkspaceNextPageRequest(nextLink);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DatasetListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = DatasetListResponse.DeserializeDatasetListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceClient.cs
new file mode 100644
index 000000000000..6d1099fa2193
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceClient.cs
@@ -0,0 +1,228 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ /// The LinkedService service client.
+ public partial class LinkedServiceClient
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal LinkedServiceRestClient RestClient { get; }
+ /// Initializes a new instance of LinkedServiceClient for mocking.
+ protected LinkedServiceClient()
+ {
+ }
+ /// Initializes a new instance of LinkedServiceClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ internal LinkedServiceClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ RestClient = new LinkedServiceRestClient(clientDiagnostics, pipeline, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Creates or updates a linked service.
+ /// The linked service name.
+ /// Linked service resource definition.
+ /// ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual async Task> CreateOrUpdateLinkedServiceAsync(string linkedServiceName, LinkedServiceResource linkedService, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.CreateOrUpdateLinkedService");
+ scope.Start();
+ try
+ {
+ return await RestClient.CreateOrUpdateLinkedServiceAsync(linkedServiceName, linkedService, ifMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Creates or updates a linked service.
+ /// The linked service name.
+ /// Linked service resource definition.
+ /// ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public virtual Response CreateOrUpdateLinkedService(string linkedServiceName, LinkedServiceResource linkedService, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.CreateOrUpdateLinkedService");
+ scope.Start();
+ try
+ {
+ return RestClient.CreateOrUpdateLinkedService(linkedServiceName, linkedService, ifMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a linked service.
+ /// The linked service name.
+ /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual async Task> GetLinkedServiceAsync(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedService");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetLinkedServiceAsync(linkedServiceName, ifNoneMatch, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets a linked service.
+ /// The linked service name.
+ /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public virtual Response GetLinkedService(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedService");
+ scope.Start();
+ try
+ {
+ return RestClient.GetLinkedService(linkedServiceName, ifNoneMatch, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a linked service.
+ /// The linked service name.
+ /// The cancellation token to use.
+ public virtual async Task DeleteLinkedServiceAsync(string linkedServiceName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.DeleteLinkedService");
+ scope.Start();
+ try
+ {
+ return await RestClient.DeleteLinkedServiceAsync(linkedServiceName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a linked service.
+ /// The linked service name.
+ /// The cancellation token to use.
+ public virtual Response DeleteLinkedService(string linkedServiceName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.DeleteLinkedService");
+ scope.Start();
+ try
+ {
+ return RestClient.DeleteLinkedService(linkedServiceName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Lists linked services.
+ /// The cancellation token to use.
+ public virtual AsyncPageable GetLinkedServicesByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedServicesByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetLinkedServicesByWorkspaceAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedServicesByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.GetLinkedServicesByWorkspaceNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Lists linked services.
+ /// The cancellation token to use.
+ public virtual Pageable GetLinkedServicesByWorkspace(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedServicesByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetLinkedServicesByWorkspace(cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("LinkedServiceClient.GetLinkedServicesByWorkspace");
+ scope.Start();
+ try
+ {
+ var response = RestClient.GetLinkedServicesByWorkspaceNextPage(nextLink, cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceRestClient.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceRestClient.cs
new file mode 100644
index 000000000000..85dbfedb1896
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/LinkedServiceRestClient.cs
@@ -0,0 +1,442 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Analytics.Synapse.Artifacts.Models;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.Analytics.Synapse.Artifacts
+{
+ internal partial class LinkedServiceRestClient
+ {
+ private string endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of LinkedServiceRestClient.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
+ /// Api Version.
+ /// This occurs when one of the required arguments is null.
+ public LinkedServiceRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2019-06-01-preview")
+ {
+ if (endpoint == null)
+ {
+ throw new ArgumentNullException(nameof(endpoint));
+ }
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateGetLinkedServicesByWorkspaceRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/linkedservices", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists linked services.
+ /// The cancellation token to use.
+ public async Task> GetLinkedServicesByWorkspaceAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetLinkedServicesByWorkspaceRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceListResponse.DeserializeLinkedServiceListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists linked services.
+ /// The cancellation token to use.
+ public Response GetLinkedServicesByWorkspace(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateGetLinkedServicesByWorkspaceRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceListResponse.DeserializeLinkedServiceListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateOrUpdateLinkedServiceRequest(string linkedServiceName, LinkedServiceResource linkedService, string ifMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/linkedservices/", false);
+ uri.AppendPath(linkedServiceName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifMatch != null)
+ {
+ request.Headers.Add("If-Match", ifMatch);
+ }
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(linkedService);
+ request.Content = content;
+ return message;
+ }
+
+ /// Creates or updates a linked service.
+ /// The linked service name.
+ /// Linked service resource definition.
+ /// ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public async Task> CreateOrUpdateLinkedServiceAsync(string linkedServiceName, LinkedServiceResource linkedService, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+ if (linkedService == null)
+ {
+ throw new ArgumentNullException(nameof(linkedService));
+ }
+
+ using var message = CreateCreateOrUpdateLinkedServiceRequest(linkedServiceName, linkedService, ifMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceResource.DeserializeLinkedServiceResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Creates or updates a linked service.
+ /// The linked service name.
+ /// Linked service resource definition.
+ /// ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update.
+ /// The cancellation token to use.
+ public Response CreateOrUpdateLinkedService(string linkedServiceName, LinkedServiceResource linkedService, string ifMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+ if (linkedService == null)
+ {
+ throw new ArgumentNullException(nameof(linkedService));
+ }
+
+ using var message = CreateCreateOrUpdateLinkedServiceRequest(linkedServiceName, linkedService, ifMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceResource.DeserializeLinkedServiceResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetLinkedServiceRequest(string linkedServiceName, string ifNoneMatch)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/linkedservices/", false);
+ uri.AppendPath(linkedServiceName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ if (ifNoneMatch != null)
+ {
+ request.Headers.Add("If-None-Match", ifNoneMatch);
+ }
+ return message;
+ }
+
+ /// Gets a linked service.
+ /// The linked service name.
+ /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public async Task> GetLinkedServiceAsync(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+
+ using var message = CreateGetLinkedServiceRequest(linkedServiceName, ifNoneMatch);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceResource.DeserializeLinkedServiceResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ case 304:
+ return Response.FromValue(null, message.Response);
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Gets a linked service.
+ /// The linked service name.
+ /// ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned.
+ /// The cancellation token to use.
+ public Response GetLinkedService(string linkedServiceName, string ifNoneMatch = null, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+
+ using var message = CreateGetLinkedServiceRequest(linkedServiceName, ifNoneMatch);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceResource.DeserializeLinkedServiceResource(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ case 304:
+ return Response.FromValue(null, message.Response);
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteLinkedServiceRequest(string linkedServiceName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendPath("/linkedservices/", false);
+ uri.AppendPath(linkedServiceName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Deletes a linked service.
+ /// The linked service name.
+ /// The cancellation token to use.
+ public async Task DeleteLinkedServiceAsync(string linkedServiceName, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+
+ using var message = CreateDeleteLinkedServiceRequest(linkedServiceName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes a linked service.
+ /// The linked service name.
+ /// The cancellation token to use.
+ public Response DeleteLinkedService(string linkedServiceName, CancellationToken cancellationToken = default)
+ {
+ if (linkedServiceName == null)
+ {
+ throw new ArgumentNullException(nameof(linkedServiceName));
+ }
+
+ using var message = CreateDeleteLinkedServiceRequest(linkedServiceName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetLinkedServicesByWorkspaceNextPageRequest(string nextLink)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.AppendRaw(endpoint, false);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Lists linked services.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public async Task> GetLinkedServicesByWorkspaceNextPageAsync(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetLinkedServicesByWorkspaceNextPageRequest(nextLink);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceListResponse value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceListResponse.DeserializeLinkedServiceListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists linked services.
+ /// The URL to the next page of results.
+ /// The cancellation token to use.
+ public Response GetLinkedServicesByWorkspaceNextPage(string nextLink, CancellationToken cancellationToken = default)
+ {
+ if (nextLink == null)
+ {
+ throw new ArgumentNullException(nameof(nextLink));
+ }
+
+ using var message = CreateGetLinkedServicesByWorkspaceNextPageRequest(nextLink);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LinkedServiceListResponse value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ if (document.RootElement.ValueKind == JsonValueKind.Null)
+ {
+ value = null;
+ }
+ else
+ {
+ value = LinkedServiceListResponse.DeserializeLinkedServiceListResponse(document.RootElement);
+ }
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.Serialization.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.Serialization.cs
new file mode 100644
index 000000000000..7dfcd8e9bedb
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.Serialization.cs
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Analytics.Synapse.Artifacts.Models
+{
+ public partial class Activity : IUtf8JsonSerializable
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
+ {
+ writer.WriteStartObject();
+ writer.WritePropertyName("name");
+ writer.WriteStringValue(Name);
+ writer.WritePropertyName("type");
+ writer.WriteStringValue(Type);
+ if (Description != null)
+ {
+ writer.WritePropertyName("description");
+ writer.WriteStringValue(Description);
+ }
+ if (DependsOn != null)
+ {
+ writer.WritePropertyName("dependsOn");
+ writer.WriteStartArray();
+ foreach (var item in DependsOn)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ if (UserProperties != null)
+ {
+ writer.WritePropertyName("userProperties");
+ writer.WriteStartArray();
+ foreach (var item in UserProperties)
+ {
+ writer.WriteObjectValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ foreach (var item in AdditionalProperties)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteObjectValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+
+ internal static Activity DeserializeActivity(JsonElement element)
+ {
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "AppendVariable": return AppendVariableActivity.DeserializeAppendVariableActivity(element);
+ case "AzureDataExplorerCommand": return AzureDataExplorerCommandActivity.DeserializeAzureDataExplorerCommandActivity(element);
+ case "AzureFunctionActivity": return AzureFunctionActivity.DeserializeAzureFunctionActivity(element);
+ case "AzureMLBatchExecution": return AzureMLBatchExecutionActivity.DeserializeAzureMLBatchExecutionActivity(element);
+ case "AzureMLExecutePipeline": return AzureMLExecutePipelineActivity.DeserializeAzureMLExecutePipelineActivity(element);
+ case "AzureMLUpdateResource": return AzureMLUpdateResourceActivity.DeserializeAzureMLUpdateResourceActivity(element);
+ case "Container": return ControlActivity.DeserializeControlActivity(element);
+ case "Copy": return CopyActivity.DeserializeCopyActivity(element);
+ case "Custom": return CustomActivity.DeserializeCustomActivity(element);
+ case "DataLakeAnalyticsU-SQL": return DataLakeAnalyticsUsqlActivity.DeserializeDataLakeAnalyticsUsqlActivity(element);
+ case "DatabricksNotebook": return DatabricksNotebookActivity.DeserializeDatabricksNotebookActivity(element);
+ case "DatabricksSparkJar": return DatabricksSparkJarActivity.DeserializeDatabricksSparkJarActivity(element);
+ case "DatabricksSparkPython": return DatabricksSparkPythonActivity.DeserializeDatabricksSparkPythonActivity(element);
+ case "Delete": return DeleteActivity.DeserializeDeleteActivity(element);
+ case "ExecuteDataFlow": return ExecuteDataFlowActivity.DeserializeExecuteDataFlowActivity(element);
+ case "ExecutePipeline": return ExecutePipelineActivity.DeserializeExecutePipelineActivity(element);
+ case "ExecuteSSISPackage": return ExecuteSsisPackageActivity.DeserializeExecuteSsisPackageActivity(element);
+ case "Execution": return ExecutionActivity.DeserializeExecutionActivity(element);
+ case "Filter": return FilterActivity.DeserializeFilterActivity(element);
+ case "ForEach": return ForEachActivity.DeserializeForEachActivity(element);
+ case "GetMetadata": return GetMetadataActivity.DeserializeGetMetadataActivity(element);
+ case "HDInsightHive": return HDInsightHiveActivity.DeserializeHDInsightHiveActivity(element);
+ case "HDInsightMapReduce": return HDInsightMapReduceActivity.DeserializeHDInsightMapReduceActivity(element);
+ case "HDInsightPig": return HDInsightPigActivity.DeserializeHDInsightPigActivity(element);
+ case "HDInsightSpark": return HDInsightSparkActivity.DeserializeHDInsightSparkActivity(element);
+ case "HDInsightStreaming": return HDInsightStreamingActivity.DeserializeHDInsightStreamingActivity(element);
+ case "IfCondition": return IfConditionActivity.DeserializeIfConditionActivity(element);
+ case "Lookup": return LookupActivity.DeserializeLookupActivity(element);
+ case "SetVariable": return SetVariableActivity.DeserializeSetVariableActivity(element);
+ case "SqlServerStoredProcedure": return SqlServerStoredProcedureActivity.DeserializeSqlServerStoredProcedureActivity(element);
+ case "Switch": return SwitchActivity.DeserializeSwitchActivity(element);
+ case "Until": return UntilActivity.DeserializeUntilActivity(element);
+ case "Validation": return ValidationActivity.DeserializeValidationActivity(element);
+ case "Wait": return WaitActivity.DeserializeWaitActivity(element);
+ case "WebActivity": return WebActivity.DeserializeWebActivity(element);
+ case "WebHook": return WebHookActivity.DeserializeWebHookActivity(element);
+ }
+ }
+ string name = default;
+ string type = default;
+ string description = default;
+ IList dependsOn = default;
+ IList userProperties = default;
+ IDictionary additionalProperties = default;
+ Dictionary additionalPropertiesDictionary = default;
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"))
+ {
+ type = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("dependsOn"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(ActivityDependency.DeserializeActivityDependency(item));
+ }
+ }
+ dependsOn = array;
+ continue;
+ }
+ if (property.NameEquals("userProperties"))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ if (item.ValueKind == JsonValueKind.Null)
+ {
+ array.Add(null);
+ }
+ else
+ {
+ array.Add(UserProperty.DeserializeUserProperty(item));
+ }
+ }
+ userProperties = array;
+ continue;
+ }
+ additionalPropertiesDictionary ??= new Dictionary();
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ additionalPropertiesDictionary.Add(property.Name, null);
+ }
+ else
+ {
+ additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
+ }
+ }
+ additionalProperties = additionalPropertiesDictionary;
+ return new Activity(name, type, description, dependsOn, userProperties, additionalProperties);
+ }
+ }
+}
diff --git a/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.cs b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.cs
new file mode 100644
index 000000000000..097f800754d0
--- /dev/null
+++ b/sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/Activity.cs
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Azure.Analytics.Synapse.Artifacts.Models
+{
+ /// A pipeline activity.
+ public partial class Activity : IDictionary
+ {
+ /// Initializes a new instance of Activity.
+ /// Activity name.
+ public Activity(string name)
+ {
+ if (name == null)
+ {
+ throw new ArgumentNullException(nameof(name));
+ }
+
+ Name = name;
+ AdditionalProperties = new Dictionary();
+ Type = "Activity";
+ }
+
+ /// Initializes a new instance of Activity.
+ /// Activity name.
+ /// Type of activity.
+ /// Activity description.
+ /// Activity depends on condition.
+ /// Activity user properties.
+ /// .
+ internal Activity(string name, string type, string description, IList dependsOn, IList userProperties, IDictionary additionalProperties)
+ {
+ Name = name;
+ Type = type ?? "Activity";
+ Description = description;
+ DependsOn = dependsOn;
+ UserProperties = userProperties;
+ AdditionalProperties = additionalProperties ?? new Dictionary();
+ }
+
+ /// Activity name.
+ public string Name { get; set; }
+ /// Type of activity.
+ internal string Type { get; set; }
+ /// Activity description.
+ public string Description { get; set; }
+ /// Activity depends on condition.
+ public IList DependsOn { get; set; }
+ /// Activity user properties.
+ public IList UserProperties { get; set; }
+ internal IDictionary AdditionalProperties { get; }
+ ///
+ public IEnumerator> GetEnumerator() => AdditionalProperties.GetEnumerator();
+ ///
+ IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
+ ///
+ public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
+ ///
+ public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
+ ///
+ public ICollection Keys => AdditionalProperties.Keys;
+ ///
+ public ICollection