diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln b/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln
new file mode 100644
index 000000000000..1e89be24951a
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/Microsoft.App.DynamicSessions.sln
@@ -0,0 +1,50 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.App.DynamicSessions", "src\Microsoft.App.DynamicSessions.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.App.DynamicSessions.Tests", "tests\Microsoft.App.DynamicSessions.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs
new file mode 100644
index 000000000000..1ad451e837bc
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeExecution.cs
@@ -0,0 +1,355 @@
+// 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.Core;
+using Azure.Core.Pipeline;
+
+namespace Microsoft.App.DynamicSessions
+{
+ // Data plane generated sub-client.
+ /// The CodeExecution sub-client.
+ public partial class CodeExecution
+ {
+ private static readonly string[] AuthorizationScopes = new string[] { "https://dynamicsessions.io/.default" };
+ private readonly TokenCredential _tokenCredential;
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of CodeExecution for mocking.
+ protected CodeExecution()
+ {
+ }
+
+ /// Initializes a new instance of CodeExecution.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The token credential to copy.
+ /// The management endpoint of the session pool.
+ /// The API version to use for this operation.
+ internal CodeExecution(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _tokenCredential = tokenCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Get the code execution result.
+ /// Session code execution id.
+ /// The user-assigned identifier of the session.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetSessionCodeExecutionResourceAsync(string executionId, string identifier, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(executionId, nameof(executionId));
+ Argument.AssertNotNull(identifier, nameof(identifier));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetSessionCodeExecutionResourceAsync(executionId, identifier, context).ConfigureAwait(false);
+ return Response.FromValue(SessionCodeExecutionResource.FromResponse(response), response);
+ }
+
+ /// Get the code execution result.
+ /// Session code execution id.
+ /// The user-assigned identifier of the session.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetSessionCodeExecutionResource(string executionId, string identifier, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(executionId, nameof(executionId));
+ Argument.AssertNotNull(identifier, nameof(identifier));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetSessionCodeExecutionResource(executionId, identifier, context);
+ return Response.FromValue(SessionCodeExecutionResource.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Get the code execution result.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// Session code execution id.
+ /// The user-assigned identifier of the session.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task GetSessionCodeExecutionResourceAsync(string executionId, string identifier, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(executionId, nameof(executionId));
+ Argument.AssertNotNull(identifier, nameof(identifier));
+
+ using var scope = ClientDiagnostics.CreateScope("CodeExecution.GetSessionCodeExecutionResource");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetSessionCodeExecutionResourceRequest(executionId, identifier, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Get the code execution result.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// Session code execution id.
+ /// The user-assigned identifier of the session.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response GetSessionCodeExecutionResource(string executionId, string identifier, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(executionId, nameof(executionId));
+ Argument.AssertNotNull(identifier, nameof(identifier));
+
+ using var scope = ClientDiagnostics.CreateScope("CodeExecution.GetSessionCodeExecutionResource");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetSessionCodeExecutionResourceRequest(executionId, identifier, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Execute code in a session.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The user-assigned identifier of the session.
+ /// The request to execute code.
+ /// The id of this execution operation.
+ /// The cancellation token to use.
+ /// or is null.
+ ///
+ public virtual async Task> ExecuteAsync(WaitUntil waitUntil, string identifier, SessionCodeExecutionRequest codeExecutionRequest, string operationId = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(identifier, nameof(identifier));
+ Argument.AssertNotNull(codeExecutionRequest, nameof(codeExecutionRequest));
+
+ using RequestContent content = codeExecutionRequest.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Operation response = await ExecuteAsync(waitUntil, identifier, content, operationId, context).ConfigureAwait(false);
+ return ProtocolOperationHelpers.Convert(response, FetchSessionCodeExecutionResultFromSessionCodeExecutionResource, ClientDiagnostics, "CodeExecution.Execute");
+ }
+
+ /// Execute code in a session.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The user-assigned identifier of the session.
+ /// The request to execute code.
+ /// The id of this execution operation.
+ /// The cancellation token to use.
+ /// or is null.
+ ///
+ public virtual Operation Execute(WaitUntil waitUntil, string identifier, SessionCodeExecutionRequest codeExecutionRequest, string operationId = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(identifier, nameof(identifier));
+ Argument.AssertNotNull(codeExecutionRequest, nameof(codeExecutionRequest));
+
+ using RequestContent content = codeExecutionRequest.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Operation response = Execute(waitUntil, identifier, content, operationId, context);
+ return ProtocolOperationHelpers.Convert(response, FetchSessionCodeExecutionResultFromSessionCodeExecutionResource, ClientDiagnostics, "CodeExecution.Execute");
+ }
+
+ ///
+ /// [Protocol Method] Execute code in a session.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The user-assigned identifier of the session.
+ /// The content to send as the body of the request.
+ /// The id of this execution operation.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// Service returned a non-success status code.
+ /// The representing an asynchronous operation on the service.
+ ///
+ public virtual async Task> ExecuteAsync(WaitUntil waitUntil, string identifier, RequestContent content, string operationId = null, RequestContext context = null)
+ {
+ Argument.AssertNotNull(identifier, nameof(identifier));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("CodeExecution.Execute");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateExecuteRequest(identifier, content, operationId, context);
+ return await ProtocolOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "CodeExecution.Execute", OperationFinalStateVia.OperationLocation, context, waitUntil).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Execute code in a session.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The user-assigned identifier of the session.
+ /// The content to send as the body of the request.
+ /// The id of this execution operation.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// Service returned a non-success status code.
+ /// The representing an asynchronous operation on the service.
+ ///
+ public virtual Operation Execute(WaitUntil waitUntil, string identifier, RequestContent content, string operationId = null, RequestContext context = null)
+ {
+ Argument.AssertNotNull(identifier, nameof(identifier));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("CodeExecution.Execute");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateExecuteRequest(identifier, content, operationId, context);
+ return ProtocolOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "CodeExecution.Execute", OperationFinalStateVia.OperationLocation, context, waitUntil);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ internal HttpMessage CreateExecuteRequest(string identifier, RequestContent content, string operationId, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier202);
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/executions", false);
+ uri.AppendQuery("identifier", identifier, true);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ if (operationId != null)
+ {
+ request.Headers.Add("operation-id", operationId);
+ }
+ request.Headers.Add("Content-Type", "application/json");
+ request.Content = content;
+ return message;
+ }
+
+ internal HttpMessage CreateGetSessionCodeExecutionResourceRequest(string executionId, string identifier, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200);
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/executions/", false);
+ uri.AppendPath(executionId, true);
+ uri.AppendQuery("identifier", identifier, true);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ private static RequestContext DefaultRequestContext = new RequestContext();
+ internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default)
+ {
+ if (!cancellationToken.CanBeCanceled)
+ {
+ return DefaultRequestContext;
+ }
+
+ return new RequestContext() { CancellationToken = cancellationToken };
+ }
+
+ private static ResponseClassifier _responseClassifier202;
+ private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 });
+ private static ResponseClassifier _responseClassifier200;
+ private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 });
+
+ private SessionCodeExecutionResult FetchSessionCodeExecutionResultFromSessionCodeExecutionResource(Response response)
+ {
+ var resultJsonElement = JsonDocument.Parse(response.Content).RootElement.GetProperty("result");
+ return SessionCodeExecutionResult.DeserializeSessionCodeExecutionResult(resultJsonElement);
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs
new file mode 100644
index 000000000000..6d931a411fcf
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/CodeInputType.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Microsoft.App.DynamicSessions
+{
+ /// Code input type.
+ public readonly partial struct CodeInputType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public CodeInputType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string InlineValue = "Inline";
+ private const string InlineBase64Value = "InlineBase64";
+ private const string InlineTextValue = "InlineText";
+
+ /// Inline.
+ public static CodeInputType Inline { get; } = new CodeInputType(InlineValue);
+ /// InlineBase64.
+ public static CodeInputType InlineBase64 { get; } = new CodeInputType(InlineBase64Value);
+ /// InlineText.
+ public static CodeInputType InlineText { get; } = new CodeInputType(InlineTextValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(CodeInputType left, CodeInputType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(CodeInputType left, CodeInputType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator CodeInputType(string value) => new CodeInputType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is CodeInputType other && Equals(other);
+ ///
+ public bool Equals(CodeInputType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml
new file mode 100644
index 000000000000..1f7cf7d6e2b1
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/CodeExecution.xml
@@ -0,0 +1,291 @@
+
+
+
+
+
+This sample shows how to call GetSessionCodeExecutionResourceAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier");
+]]>
+This sample shows how to call GetSessionCodeExecutionResourceAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetSessionCodeExecutionResource.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier");
+]]>
+This sample shows how to call GetSessionCodeExecutionResource.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetSessionCodeExecutionResourceAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("id").ToString());
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("executionType").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+This sample shows how to call GetSessionCodeExecutionResourceAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionCodeExecutionResourceAsync("testExecutionId", "testSessionIdentifier", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("id").ToString());
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("executionType").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call GetSessionCodeExecutionResource and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("id").ToString());
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("executionType").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+This sample shows how to call GetSessionCodeExecutionResource and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionCodeExecutionResource("testExecutionId", "testSessionIdentifier", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("id").ToString());
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("executionType").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call ExecuteAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L);
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+This sample shows how to call ExecuteAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L);
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+This sample shows how to call ExecuteAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L);
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+
+
+
+This sample shows how to call Execute.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L);
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+This sample shows how to call Execute.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Asynchronous, "print(7*9)", 60L);
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+This sample shows how to call Execute.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+SessionCodeExecutionRequest codeExecutionRequest = new SessionCodeExecutionRequest(CodeInputType.Inline, ExecutionType.Synchronous, "print(7*9)", 60L);
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", codeExecutionRequest);
+SessionCodeExecutionResult responseData = operation.Value;
+]]>
+
+
+
+This sample shows how to call ExecuteAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Asynchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+This sample shows how to call ExecuteAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Asynchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+This sample shows how to call ExecuteAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Synchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = await client.ExecuteAsync(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+
+
+
+This sample shows how to call Execute and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Asynchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+This sample shows how to call Execute and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Asynchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+This sample shows how to call Execute and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+CodeExecution client = new DynamicSessionsClient(endpoint, credential).GetCodeExecutionClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = RequestContent.Create(new
+{
+ codeInputType = "Inline",
+ executionType = "Synchronous",
+ code = "print(7*9)",
+ timeoutInSeconds = 60L,
+});
+Operation operation = client.Execute(WaitUntil.Completed, "testSessionIdentifier", content);
+BinaryData responseData = operation.Value;
+
+JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+
+
+
\ No newline at end of file
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/ListSessions.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/ListSessions.xml
new file mode 100644
index 000000000000..a6a5dd759211
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/ListSessions.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+This sample shows how to call GetListSessionAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetListSessionAsync();
+]]>
+This sample shows how to call GetListSessionAsync with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetListSessionAsync(skip: 1234);
+]]>
+
+
+
+This sample shows how to call GetListSession.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetListSession();
+]]>
+This sample shows how to call GetListSession with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetListSession(skip: 1234);
+]]>
+
+
+
+This sample shows how to call GetListSessionAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetListSessionAsync(null, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("etag").ToString());
+]]>
+This sample shows how to call GetListSessionAsync with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetListSessionAsync(1234, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("etag").ToString());
+Console.WriteLine(result.GetProperty("nextLink").ToString());
+]]>
+
+
+
+This sample shows how to call GetListSession and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetListSession(null, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("etag").ToString());
+]]>
+This sample shows how to call GetListSession with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+ListSessions client = new DynamicSessionsClient(endpoint, credential).GetListSessionsClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetListSession(1234, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("sessions")[0].GetProperty("etag").ToString());
+Console.WriteLine(result.GetProperty("nextLink").ToString());
+]]>
+
+
+
\ No newline at end of file
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionManagement.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionManagement.xml
new file mode 100644
index 000000000000..a354efc73fc8
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionManagement.xml
@@ -0,0 +1,155 @@
+
+
+
+
+
+This sample shows how to call GetSessionManagementAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionManagementAsync("");
+]]>
+This sample shows how to call GetSessionManagementAsync with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionManagementAsync("");
+]]>
+
+
+
+This sample shows how to call GetSessionManagement.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionManagement("");
+]]>
+This sample shows how to call GetSessionManagement with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionManagement("");
+]]>
+
+
+
+This sample shows how to call GetSessionManagementAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionManagementAsync("", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("etag").ToString());
+]]>
+This sample shows how to call GetSessionManagementAsync with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionManagementAsync("", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("etag").ToString());
+]]>
+
+
+
+This sample shows how to call GetSessionManagement and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionManagement("", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("etag").ToString());
+]]>
+This sample shows how to call GetSessionManagement with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionManagement("", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("identifier").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastAccessedAt").ToString());
+Console.WriteLine(result.GetProperty("expireAt").ToString());
+Console.WriteLine(result.GetProperty("etag").ToString());
+]]>
+
+
+
+This sample shows how to call DeleteAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.DeleteAsync("");
+
+Console.WriteLine(response.Status);
+]]>
+This sample shows how to call DeleteAsync with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.DeleteAsync("");
+
+Console.WriteLine(response.Status);
+]]>
+
+
+
+This sample shows how to call Delete.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.Delete("");
+
+Console.WriteLine(response.Status);
+]]>
+This sample shows how to call Delete with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionManagement client = new DynamicSessionsClient(endpoint, credential).GetSessionManagementClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.Delete("");
+
+Console.WriteLine(response.Status);
+]]>
+
+
+
\ No newline at end of file
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionPoolMetadata.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionPoolMetadata.xml
new file mode 100644
index 000000000000..ac38d5ef7fd2
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionPoolMetadata.xml
@@ -0,0 +1,129 @@
+
+
+
+
+
+This sample shows how to call GetSessionPoolMetadataAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionPoolMetadataAsync();
+]]>
+This sample shows how to call GetSessionPoolMetadataAsync with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionPoolMetadataAsync();
+]]>
+
+
+
+This sample shows how to call GetSessionPoolMetadata.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionPoolMetadata();
+]]>
+This sample shows how to call GetSessionPoolMetadata with all parameters.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionPoolMetadata();
+]]>
+
+
+
+This sample shows how to call GetSessionPoolMetadataAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionPoolMetadataAsync(null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("projectUrl").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("description").ToString());
+]]>
+This sample shows how to call GetSessionPoolMetadataAsync with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionPoolMetadataAsync(null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("projectUrl").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("description").ToString());
+]]>
+
+
+
+This sample shows how to call GetSessionPoolMetadata and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionPoolMetadata(null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("projectUrl").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("description").ToString());
+]]>
+This sample shows how to call GetSessionPoolMetadata with all parameters and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionPoolMetadata client = new DynamicSessionsClient(endpoint, credential).GetSessionPoolMetadataClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionPoolMetadata(null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("runtimes")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("preInstalledPackages")[0].GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("createdAt").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedAt").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("version").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("projectUrl").ToString());
+Console.WriteLine(result.GetProperty("jupyterKernel").GetProperty("description").ToString());
+]]>
+
+
+
\ No newline at end of file
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml
new file mode 100644
index 000000000000..b756e760389f
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Docs/SessionResourceFiles.xml
@@ -0,0 +1,253 @@
+
+
+
+
+
+This sample shows how to call GetSessionResourceFileAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFile.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFileAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetSessionResourceFileAsync("testfile", "testSessionIdentifier", "/", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("type").ToString());
+Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFile and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetSessionResourceFile("testfile", "testSessionIdentifier", "/", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("type").ToString());
+Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+]]>
+
+
+
+This sample shows how to call DeleteAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.DeleteAsync("testfile", "testSessionIdentifier");
+
+Console.WriteLine(response.Status);
+]]>
+
+
+
+This sample shows how to call Delete.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.Delete("testfile", "testSessionIdentifier");
+
+Console.WriteLine(response.Status);
+]]>
+
+
+
+This sample shows how to call UploadAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+UploadRequest body = null;
+Response response = await client.UploadAsync("testSessionIdentifier", body);
+]]>
+
+
+
+This sample shows how to call Upload.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+UploadRequest body = null;
+Response response = client.Upload("testSessionIdentifier", body);
+]]>
+
+
+
+This sample shows how to call UploadAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = null;
+Response response = await client.UploadAsync("testSessionIdentifier", content, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("type").ToString());
+Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+]]>
+
+
+
+This sample shows how to call Upload and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+using RequestContent content = null;
+Response response = client.Upload("testSessionIdentifier", content, null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("name").ToString());
+Console.WriteLine(result.GetProperty("type").ToString());
+Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+]]>
+
+
+
+This sample shows how to call GetContentAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetContentAsync("testfile", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetContent.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetContent("testfile", "testSessionIdentifier");
+]]>
+
+
+
+This sample shows how to call GetContentAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = await client.GetContentAsync("testfile", "testSessionIdentifier", "/", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+
+
+
+This sample shows how to call GetContent and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+Response response = client.GetContent("testfile", "testSessionIdentifier", "/", null);
+
+JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.ToString());
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFilesAsync.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+await foreach (SessionResourceFile item in client.GetSessionResourceFilesAsync("testSessionIdentifier"))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFiles.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+foreach (SessionResourceFile item in client.GetSessionResourceFiles("testSessionIdentifier"))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFilesAsync and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+await foreach (BinaryData item in client.GetSessionResourceFilesAsync("testSessionIdentifier", "/", null))
+{
+ JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
+ Console.WriteLine(result.GetProperty("name").ToString());
+ Console.WriteLine(result.GetProperty("type").ToString());
+ Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+}
+]]>
+
+
+
+This sample shows how to call GetSessionResourceFiles and parse the result.
+");
+TokenCredential credential = new DefaultAzureCredential();
+SessionResourceFiles client = new DynamicSessionsClient(endpoint, credential).GetSessionResourceFilesClient(apiVersion: "2024-10-02-preview");
+
+foreach (BinaryData item in client.GetSessionResourceFiles("testSessionIdentifier", "/", null))
+{
+ JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
+ Console.WriteLine(result.GetProperty("name").ToString());
+ Console.WriteLine(result.GetProperty("type").ToString());
+ Console.WriteLine(result.GetProperty("lastModifiedAt").ToString());
+}
+]]>
+
+
+
\ No newline at end of file
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs
new file mode 100644
index 000000000000..8e25932cc1c8
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClient.cs
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Microsoft.App.DynamicSessions
+{
+ // Data plane generated client.
+ /// The DynamicSessions service client.
+ public partial class DynamicSessionsClient
+ {
+ private static readonly string[] AuthorizationScopes = new string[] { "https://dynamicsessions.io/.default" };
+ private readonly TokenCredential _tokenCredential;
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of DynamicSessionsClient for mocking.
+ protected DynamicSessionsClient()
+ {
+ }
+
+ /// Initializes a new instance of DynamicSessionsClient.
+ /// The management endpoint of the session pool.
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public DynamicSessionsClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new DynamicSessionsClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of DynamicSessionsClient.
+ /// The management endpoint of the session pool.
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public DynamicSessionsClient(Uri endpoint, TokenCredential credential, DynamicSessionsClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new DynamicSessionsClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _tokenCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ /// Initializes a new instance of CodeExecution.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual CodeExecution GetCodeExecutionClient(string apiVersion = "2024-10-02-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new CodeExecution(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of SessionResourceFiles.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual SessionResourceFiles GetSessionResourceFilesClient(string apiVersion = "2024-10-02-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new SessionResourceFiles(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of SessionManagement.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual SessionManagement GetSessionManagementClient(string apiVersion = "2024-10-02-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new SessionManagement(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of ListSessions.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual ListSessions GetListSessionsClient(string apiVersion = "2024-10-02-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new ListSessions(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of SessionPoolMetadata.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual SessionPoolMetadata GetSessionPoolMetadataClient(string apiVersion = "2024-10-02-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new SessionPoolMetadata(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs
new file mode 100644
index 000000000000..31ad50ae5345
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/DynamicSessionsClientOptions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Microsoft.App.DynamicSessions
+{
+ /// Client options for DynamicSessionsClient.
+ public partial class DynamicSessionsClientOptions : ClientOptions
+ {
+ private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_02_Preview;
+
+ /// The version of the service to use.
+ public enum ServiceVersion
+ {
+ /// Service version "2024-10-02-preview".
+ V2024_10_02_Preview = 1,
+ }
+
+ internal string Version { get; }
+
+ /// Initializes new instance of DynamicSessionsClientOptions.
+ public DynamicSessionsClientOptions(ServiceVersion version = LatestVersion)
+ {
+ Version = version switch
+ {
+ ServiceVersion.V2024_10_02_Preview => "2024-10-02-preview",
+ _ => throw new NotSupportedException()
+ };
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs
new file mode 100644
index 000000000000..8bb9ae55203a
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.Serialization.cs
@@ -0,0 +1,143 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure;
+using Azure.Core;
+
+namespace Microsoft.App.DynamicSessions
+{
+ public partial class ErrorResponse : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("error"u8);
+ JsonSerializer.Serialize(writer, Error);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ErrorResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeErrorResponse(document.RootElement, options);
+ }
+
+ internal static ErrorResponse DeserializeErrorResponse(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ResponseError error = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("error"u8))
+ {
+ error = JsonSerializer.Deserialize(property.Value.GetRawText());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ErrorResponse(error, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options, MicrosoftAppDynamicSessionsContext.Default);
+ default:
+ throw new FormatException($"The model {nameof(ErrorResponse)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ErrorResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeErrorResponse(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ErrorResponse)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static ErrorResponse FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeErrorResponse(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs
new file mode 100644
index 000000000000..365411fe4646
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ErrorResponse.cs
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+
+namespace Microsoft.App.DynamicSessions
+{
+ /// A response containing error details.
+ public partial class ErrorResponse
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The error object.
+ /// is null.
+ internal ErrorResponse(ResponseError error)
+ {
+ Argument.AssertNotNull(error, nameof(error));
+
+ Error = error;
+ }
+
+ /// Initializes a new instance of .
+ /// The error object.
+ /// Keeps track of any properties unknown to the library.
+ internal ErrorResponse(ResponseError error, IDictionary serializedAdditionalRawData)
+ {
+ Error = error;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ErrorResponse()
+ {
+ }
+
+ /// The error object.
+ public ResponseError Error { get; }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs
new file mode 100644
index 000000000000..8a5b0220c472
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/ExecutionType.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Microsoft.App.DynamicSessions
+{
+ /// Execution Type.
+ public readonly partial struct ExecutionType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ExecutionType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string SynchronousValue = "Synchronous";
+ private const string AsynchronousValue = "Asynchronous";
+
+ /// Synchronous.
+ public static ExecutionType Synchronous { get; } = new ExecutionType(SynchronousValue);
+ /// Asynchronous.
+ public static ExecutionType Asynchronous { get; } = new ExecutionType(AsynchronousValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ExecutionType left, ExecutionType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ExecutionType left, ExecutionType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator ExecutionType(string value) => new ExecutionType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ExecutionType other && Equals(other);
+ ///
+ public bool Equals(ExecutionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs
new file mode 100644
index 000000000000..b29962ac493f
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/Argument.cs
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Microsoft.App.DynamicSessions
+{
+ internal static class Argument
+ {
+ public static void AssertNotNull(T value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNull(T? value, string name)
+ where T : struct
+ {
+ if (!value.HasValue)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(IEnumerable value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value is ICollection collectionOfT && collectionOfT.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ if (value is ICollection collection && collection.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ using IEnumerator e = value.GetEnumerator();
+ if (!e.MoveNext())
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value.Length == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty string.", name);
+ }
+ }
+
+ public static void AssertNotNullOrWhiteSpace(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name);
+ }
+ }
+
+ public static void AssertNotDefault(ref T value, string name)
+ where T : struct, IEquatable
+ {
+ if (value.Equals(default))
+ {
+ throw new ArgumentException("Value cannot be empty.", name);
+ }
+ }
+
+ public static void AssertInRange(T value, T minimum, T maximum, string name)
+ where T : notnull, IComparable
+ {
+ if (minimum.CompareTo(value) > 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed.");
+ }
+ if (maximum.CompareTo(value) < 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed.");
+ }
+ }
+
+ public static void AssertEnumDefined(Type enumType, object value, string name)
+ {
+ if (!Enum.IsDefined(enumType, value))
+ {
+ throw new ArgumentException($"Value not defined for {enumType.FullName}.", name);
+ }
+ }
+
+ public static T CheckNotNull(T value, string name)
+ where T : class
+ {
+ AssertNotNull(value, name);
+ return value;
+ }
+
+ public static string CheckNotNullOrEmpty(string value, string name)
+ {
+ AssertNotNullOrEmpty(value, name);
+ return value;
+ }
+
+ public static void AssertNull(T value, string name, string message = null)
+ {
+ if (value != null)
+ {
+ throw new ArgumentException(message ?? "Value must be null.", name);
+ }
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs
new file mode 100644
index 000000000000..2f625026ca9e
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingDictionary.cs
@@ -0,0 +1,167 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Microsoft.App.DynamicSessions
+{
+ internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull
+ {
+ private IDictionary _innerDictionary;
+
+ public ChangeTrackingDictionary()
+ {
+ }
+
+ public ChangeTrackingDictionary(IDictionary dictionary)
+ {
+ if (dictionary == null)
+ {
+ return;
+ }
+ _innerDictionary = new Dictionary(dictionary);
+ }
+
+ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary)
+ {
+ if (dictionary == null)
+ {
+ return;
+ }
+ _innerDictionary = new Dictionary();
+ foreach (var pair in dictionary)
+ {
+ _innerDictionary.Add(pair);
+ }
+ }
+
+ public bool IsUndefined => _innerDictionary == null;
+
+ public int Count => IsUndefined ? 0 : EnsureDictionary().Count;
+
+ public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly;
+
+ public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys;
+
+ public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values;
+
+ public TValue this[TKey key]
+ {
+ get
+ {
+ if (IsUndefined)
+ {
+ throw new KeyNotFoundException(nameof(key));
+ }
+ return EnsureDictionary()[key];
+ }
+ set
+ {
+ EnsureDictionary()[key] = value;
+ }
+ }
+
+ IEnumerable IReadOnlyDictionary.Keys => Keys;
+
+ IEnumerable IReadOnlyDictionary.Values => Values;
+
+ public IEnumerator> GetEnumerator()
+ {
+ if (IsUndefined)
+ {
+ IEnumerator> enumerateEmpty()
+ {
+ yield break;
+ }
+ return enumerateEmpty();
+ }
+ return EnsureDictionary().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(KeyValuePair item)
+ {
+ EnsureDictionary().Add(item);
+ }
+
+ public void Clear()
+ {
+ EnsureDictionary().Clear();
+ }
+
+ public bool Contains(KeyValuePair item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Contains(item);
+ }
+
+ public void CopyTo(KeyValuePair[] array, int index)
+ {
+ if (IsUndefined)
+ {
+ return;
+ }
+ EnsureDictionary().CopyTo(array, index);
+ }
+
+ public bool Remove(KeyValuePair item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Remove(item);
+ }
+
+ public void Add(TKey key, TValue value)
+ {
+ EnsureDictionary().Add(key, value);
+ }
+
+ public bool ContainsKey(TKey key)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().ContainsKey(key);
+ }
+
+ public bool Remove(TKey key)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Remove(key);
+ }
+
+ public bool TryGetValue(TKey key, out TValue value)
+ {
+ if (IsUndefined)
+ {
+ value = default;
+ return false;
+ }
+ return EnsureDictionary().TryGetValue(key, out value);
+ }
+
+ public IDictionary EnsureDictionary()
+ {
+ return _innerDictionary ??= new Dictionary();
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs
new file mode 100644
index 000000000000..d9cfe9c47a7f
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ChangeTrackingList.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Microsoft.App.DynamicSessions
+{
+ internal class ChangeTrackingList : IList, IReadOnlyList
+ {
+ private IList _innerList;
+
+ public ChangeTrackingList()
+ {
+ }
+
+ public ChangeTrackingList(IList innerList)
+ {
+ if (innerList != null)
+ {
+ _innerList = innerList;
+ }
+ }
+
+ public ChangeTrackingList(IReadOnlyList innerList)
+ {
+ if (innerList != null)
+ {
+ _innerList = innerList.ToList();
+ }
+ }
+
+ public bool IsUndefined => _innerList == null;
+
+ public int Count => IsUndefined ? 0 : EnsureList().Count;
+
+ public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly;
+
+ public T this[int index]
+ {
+ get
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ return EnsureList()[index];
+ }
+ set
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ EnsureList()[index] = value;
+ }
+ }
+
+ public void Reset()
+ {
+ _innerList = null;
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ if (IsUndefined)
+ {
+ IEnumerator enumerateEmpty()
+ {
+ yield break;
+ }
+ return enumerateEmpty();
+ }
+ return EnsureList().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(T item)
+ {
+ EnsureList().Add(item);
+ }
+
+ public void Clear()
+ {
+ EnsureList().Clear();
+ }
+
+ public bool Contains(T item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureList().Contains(item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ if (IsUndefined)
+ {
+ return;
+ }
+ EnsureList().CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(T item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureList().Remove(item);
+ }
+
+ public int IndexOf(T item)
+ {
+ if (IsUndefined)
+ {
+ return -1;
+ }
+ return EnsureList().IndexOf(item);
+ }
+
+ public void Insert(int index, T item)
+ {
+ EnsureList().Insert(index, item);
+ }
+
+ public void RemoveAt(int index)
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ EnsureList().RemoveAt(index);
+ }
+
+ public IList EnsureList()
+ {
+ return _innerList ??= new List();
+ }
+ }
+}
diff --git a/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs
new file mode 100644
index 000000000000..bfaa03837995
--- /dev/null
+++ b/sdk/microsoft.app/Microsoft.App.DynamicSessions/src/Generated/Internal/ModelSerializationExtensions.cs
@@ -0,0 +1,407 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Text.Json;
+using System.Xml;
+using Azure.Core;
+
+namespace Microsoft.App.DynamicSessions
+{
+ internal static class ModelSerializationExtensions
+ {
+ internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 };
+ internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
+ internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray());
+
+ public static object GetObject(this JsonElement element)
+ {
+ switch (element.ValueKind)
+ {
+ case JsonValueKind.String:
+ return element.GetString();
+ case JsonValueKind.Number:
+ if (element.TryGetInt32(out int intValue))
+ {
+ return intValue;
+ }
+ if (element.TryGetInt64(out long longValue))
+ {
+ return longValue;
+ }
+ return element.GetDouble();
+ case JsonValueKind.True:
+ return true;
+ case JsonValueKind.False:
+ return false;
+ case JsonValueKind.Undefined:
+ case JsonValueKind.Null:
+ return null;
+ case JsonValueKind.Object:
+ var dictionary = new Dictionary();
+ foreach (var jsonProperty in element.EnumerateObject())
+ {
+ dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject());
+ }
+ return dictionary;
+ case JsonValueKind.Array:
+ var list = new List