diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/Azure.AgriculturePlatform.sln b/sdk/agricultureplatform/Azure.AgriculturePlatform/Azure.AgriculturePlatform.sln
new file mode 100644
index 000000000000..df9004d44743
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/Azure.AgriculturePlatform.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AgriculturePlatform", "src\Azure.AgriculturePlatform.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AgriculturePlatform.Tests", "tests\Azure.AgriculturePlatform.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/CHANGELOG.md b/sdk/agricultureplatform/Azure.AgriculturePlatform/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
\ No newline at end of file
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/Directory.Build.props b/sdk/agricultureplatform/Azure.AgriculturePlatform/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/README.md b/sdk/agricultureplatform/Azure.AgriculturePlatform/README.md
new file mode 100644
index 000000000000..3ab14fea1b97
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/README.md
@@ -0,0 +1,107 @@
+# Azure.AgriculturePlatform client library for .NET
+
+Azure.AgriculturePlatform is a managed service that helps developers get secret simply and securely.
+
+Use the client library for to:
+
+* [Get secret](https://docs.microsoft.com/azure)
+
+[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples]
+
+ [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/agricultureplatform/Azure.AgriculturePlatform/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure)
+
+## Getting started
+
+This section should include everything a developer needs to do to install and create their first client connection *very quickly*.
+
+### Install the package
+
+First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository.
+
+Install the client library for .NET with [NuGet](https://www.nuget.org/ ):
+
+```dotnetcli
+dotnet add package Azure.AgriculturePlatform --prerelease
+```
+
+### Prerequisites
+
+Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:
+
+> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`.
+
+### Authenticate the client
+
+If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.
+
+For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.
+
+### Service API versions
+
+The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate.
+
+#### Select a service API version
+
+You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version.
+
+For example,
+
+```C# Snippet:CreateClientForSpecificApiVersion
+Uri endpoint = new Uri("");
+DefaultAzureCredential credential = new DefaultAzureCredential();
+ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.)
+var client = new Client(endpoint, credential, options);
+```
+
+When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility.
+
+Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
+
+## Key concepts
+
+The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.
+
+Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of:
+
+### Thread safety
+
+We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.
+
+### Additional concepts
+
+[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
+[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
+[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
+[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
+[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
+[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) |
+[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
+
+
+## Examples
+
+You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/agricultureplatform/Azure.AgriculturePlatform/samples).
+
+## Troubleshooting
+
+Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.
+
+Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.
+
+If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.
+
+## Next steps
+
+* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
+* If appropriate, point users to other packages that might be useful.
+* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.
+
+## Contributing
+
+This is a template, but your SDK readme should include details on how to contribute code to the repo/package.
+
+
+[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
+[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
+
+
\ No newline at end of file
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Azure.AgriculturePlatform.csproj b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Azure.AgriculturePlatform.csproj
new file mode 100644
index 000000000000..3fd302b4f066
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Azure.AgriculturePlatform.csproj
@@ -0,0 +1,20 @@
+
+
+ This is the Azure.AgriculturePlatform client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.AgriculturePlatform for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.AgriculturePlatform
+ $(RequiredTargetFrameworks)
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AcceptHeaderEnum.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AcceptHeaderEnum.cs
new file mode 100644
index 000000000000..d3e39af982b0
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AcceptHeaderEnum.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AgriculturePlatform
+{
+ /// enum for request "accept" header.
+ public readonly partial struct AcceptHeaderEnum : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AcceptHeaderEnum(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string JsonValue = "application/json";
+ private const string OctetStreamValue = "application/octet-stream";
+
+ /// application/json.
+ public static AcceptHeaderEnum Json { get; } = new AcceptHeaderEnum(JsonValue);
+ /// application/octet-stream.
+ public static AcceptHeaderEnum OctetStream { get; } = new AcceptHeaderEnum(OctetStreamValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AcceptHeaderEnum left, AcceptHeaderEnum right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AcceptHeaderEnum left, AcceptHeaderEnum right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator AcceptHeaderEnum(string value) => new AcceptHeaderEnum(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AcceptHeaderEnum other && Equals(other);
+ ///
+ public bool Equals(AcceptHeaderEnum 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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClient.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClient.cs
new file mode 100644
index 000000000000..1212b3750c67
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClient.cs
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.AgriculturePlatform
+{
+ // Data plane generated client.
+ /// APIs documentation for Azure AgPlatform DataPlane Service.
+ public partial class AgriculturePlatformClient
+ {
+ private const string AuthorizationHeader = "Authorization";
+ private readonly AzureKeyCredential _keyCredential;
+ 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 AgriculturePlatformClient for mocking.
+ protected AgriculturePlatformClient()
+ {
+ }
+
+ /// Initializes a new instance of AgriculturePlatformClient.
+ /// The to use.
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AgriculturePlatformClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AgriculturePlatformClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AgriculturePlatformClient.
+ /// The to use.
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public AgriculturePlatformClient(Uri endpoint, AzureKeyCredential credential, AgriculturePlatformClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new AgriculturePlatformClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _keyCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ /// Initializes a new instance of Catalogs.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Catalogs GetCatalogsClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Catalogs(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Collections.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Collections GetCollectionsClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Collections(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of File.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual File GetFileClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new File(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Items.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Items GetItemsClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Items(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Satellite.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Satellite GetSatelliteClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Satellite(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Schemas.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Schemas GetSchemasClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Schemas(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Solutions.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Solutions GetSolutionsClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Solutions(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Weather.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Weather GetWeatherClient(string apiVersion = "2024-11-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Weather(ClientDiagnostics, _pipeline, _keyCredential, _endpoint, apiVersion);
+ }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientBuilderExtensions.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientBuilderExtensions.cs
new file mode 100644
index 000000000000..f11771de89cb
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientBuilderExtensions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure;
+using Azure.AgriculturePlatform;
+using Azure.Core.Extensions;
+
+namespace Microsoft.Extensions.Azure
+{
+ /// Extension methods to add to client builder.
+ public static partial class AgriculturePlatformClientBuilderExtensions
+ {
+ /// Registers a instance.
+ /// The builder to register with.
+ /// The to use.
+ /// A credential used to authenticate to an Azure Service.
+ public static IAzureClientBuilder AddAgriculturePlatformClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential)
+ where TBuilder : IAzureClientFactoryBuilder
+ {
+ return builder.RegisterClientFactory((options) => new AgriculturePlatformClient(endpoint, credential, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// The configuration values.
+ public static IAzureClientBuilder AddAgriculturePlatformClient(this TBuilder builder, TConfiguration configuration)
+ where TBuilder : IAzureClientFactoryBuilderWithConfiguration
+ {
+ return builder.RegisterClientFactory(configuration);
+ }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientOptions.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientOptions.cs
new file mode 100644
index 000000000000..c025141f4905
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformClientOptions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Client options for AgriculturePlatformClient.
+ public partial class AgriculturePlatformClientOptions : ClientOptions
+ {
+ private const ServiceVersion LatestVersion = ServiceVersion.V2024_11_01_Preview;
+
+ /// The version of the service to use.
+ public enum ServiceVersion
+ {
+ /// Service version "2024-11-01-preview".
+ V2024_11_01_Preview = 1,
+ }
+
+ internal string Version { get; }
+
+ /// Initializes new instance of AgriculturePlatformClientOptions.
+ public AgriculturePlatformClientOptions(ServiceVersion version = LatestVersion)
+ {
+ Version = version switch
+ {
+ ServiceVersion.V2024_11_01_Preview => "2024-11-01-preview",
+ _ => throw new NotSupportedException()
+ };
+ }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformModelFactory.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformModelFactory.cs
new file mode 100644
index 000000000000..c49fccc7ffff
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AgriculturePlatformModelFactory.cs
@@ -0,0 +1,658 @@
+// 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.AgriculturePlatform
+{
+ /// Model factory for models.
+ public static partial class AgriculturePlatformModelFactory
+ {
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Id of the Catalog.
+ /// A new instance for mocking.
+ public static Catalog Catalog(IEnumerable links = null, string eTag = null, string status = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? modifiedDateTime = null, string source = null, string name = null, string description = null, string createdBy = null, string modifiedBy = null, IDictionary properties = null, string id = null)
+ {
+ links ??= new List();
+ properties ??= new Dictionary();
+
+ return new Catalog(
+ links?.ToList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties,
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Schema Foreign Key.
+ /// Id of the Catalog.
+ /// Unique resource ID.
+ /// A new instance for mocking.
+ public static Collection Collection(IEnumerable links = null, string eTag = null, string status = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? modifiedDateTime = null, string source = null, string name = null, string description = null, string createdBy = null, string modifiedBy = null, IDictionary properties = null, string schemaId = null, string catalogId = null, string id = null)
+ {
+ links ??= new List();
+ properties ??= new Dictionary();
+
+ return new Collection(
+ links?.ToList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties,
+ schemaId,
+ catalogId,
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// FilePath.
+ /// A new instance for mocking.
+ public static FileModel FileModel(string filePath = null)
+ {
+ return new FileModel(filePath, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Schema for records under the dataset.
+ /// OwnerItemId.
+ /// CatalogId.
+ /// CollectionId.
+ /// Assets.
+ /// Unique resource ID.
+ /// A new instance for mocking.
+ public static ItemResponse ItemResponse(IEnumerable links = null, string eTag = null, string status = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? modifiedDateTime = null, string source = null, string name = null, string description = null, string createdBy = null, string modifiedBy = null, IReadOnlyDictionary properties = null, IReadOnlyDictionary data = null, string ownerItemId = null, string catalogId = null, string collectionId = null, IEnumerable assets = null, string id = null)
+ {
+ links ??= new List();
+ properties ??= new Dictionary();
+ data ??= new Dictionary();
+ assets ??= new List();
+
+ return new ItemResponse(
+ links?.ToList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties,
+ data,
+ ownerItemId,
+ catalogId,
+ collectionId,
+ assets?.ToList(),
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Schema for records under the dataset.
+ /// Owner Item Ids of the resource.
+ /// Id of the Catalog resource.
+ /// Id of the Collection resource.
+ /// Assets.
+ /// Id of the Item.
+ /// A new instance for mocking.
+ public static Item Item(IEnumerable links = null, string eTag = null, string status = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? modifiedDateTime = null, string source = null, string name = null, string description = null, string createdBy = null, string modifiedBy = null, IDictionary properties = null, IDictionary data = null, string ownerItemId = null, string catalogId = null, string collectionId = null, IEnumerable assets = null, string id = null)
+ {
+ links ??= new List();
+ properties ??= new Dictionary();
+ data ??= new Dictionary();
+ assets ??= new List();
+
+ return new Item(
+ links?.ToList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties,
+ data,
+ ownerItemId,
+ catalogId,
+ collectionId,
+ assets?.ToList(),
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// List of Items.
+ /// Skip token for getting next set of results.
+ ///
+ /// URL to do the POST request with same filters,
+ /// to get next set of items.
+ ///
+ /// A new instance for mocking.
+ public static ItemListResponse ItemListResponse(IEnumerable- value = null, string skipToken = null, string nextLink = null)
+ {
+ value ??= new List
- ();
+
+ return new ItemListResponse(value?.ToList(), skipToken, nextLink, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// ClientId associated with the provider.
+ /// Properties of the key vault.
+ /// A new instance for mocking.
+ public static OauthClientCredentials OauthClientCredentials(string clientId = null, KeyVaultProperties clientSecret = null)
+ {
+ return new OauthClientCredentials(AuthCredentialsKind.OAuthClientCredentials, serializedAdditionalRawData: null, clientId, clientSecret);
+ }
+
+ /// Initializes a new instance of .
+ /// Properties of the key vault.
+ /// A new instance for mocking.
+ public static ApiKeyAuthCredentials ApiKeyAuthCredentials(KeyVaultProperties apiKey = null)
+ {
+ return new ApiKeyAuthCredentials(AuthCredentialsKind.ApiKeyAuthCredentials, serializedAdditionalRawData: null, apiKey);
+ }
+
+ /// Initializes a new instance of .
+ /// Value.
+ /// A new instance for mocking.
+ public static SatelliteFetchResponse SatelliteFetchResponse(IEnumerable value = null)
+ {
+ value ??= new List();
+
+ return new SatelliteFetchResponse(value?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Start Date.
+ /// Provider of satellite data. Available Value: SentinelHub.
+ /// Collection of satellite data. Available Value: sentinel-2-l2a, sentinel-2-l1c.
+ /// Feature Id.
+ /// ImageFiles.
+ /// ItemUri.
+ /// Id.
+ /// A new instance for mocking.
+ public static SatelliteFetchData SatelliteFetchData(DateTimeOffset? dateTime = null, string provider = null, string providerCollectionId = null, string featureId = null, IEnumerable imageFiles = null, string itemUri = null, string id = null)
+ {
+ imageFiles ??= new List();
+
+ return new SatelliteFetchData(
+ dateTime,
+ provider,
+ providerCollectionId,
+ featureId,
+ imageFiles?.ToList(),
+ itemUri,
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// ADLS path of the image file.
+ /// Name of the image file.
+ /// Supported image formats for scene resource.
+ /// Resolution of image file in meters.
+ /// A new instance for mocking.
+ public static ImageFile ImageFile(string filePath = null, string name = null, ImageFormat? imageFormat = null, double? resolution = null)
+ {
+ return new ImageFile(filePath, name, imageFormat, resolution, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// List of items.
+ ///
+ /// URL to do the POST request with same filters,
+ /// to get next set of items.
+ ///
+ /// A new instance for mocking.
+ public static SearchFeaturesResponse SearchFeaturesResponse(IEnumerable features = null, string nextLink = null)
+ {
+ features ??= new List();
+
+ return new SearchFeaturesResponse(features?.ToList(), nextLink, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The STAC version the Stac Item implements.
+ /// A list of extensions the Stac Item implements.
+ /// Provider identifier. Globally unique ID by Data provider.
+ /// Type of the GeoJSON Object. It's value is always Feature.
+ ///
+ /// Defines the full footprint of the asset represented by this item.
+ /// Its a GeoJSON geometry.
+ ///
+ /// Bounding box of the item.
+ /// A dictionary of additional metadata for the item.
+ /// List of link objects to resources and related URLs.
+ /// Dictionary of asset objects, each with a unique key.
+ /// The id of the STAC Collection this Stac Item references.
+ /// A new instance for mocking.
+ public static StacItem StacItem(string stacVersion = null, IEnumerable stacExtensions = null, string id = null, string type = null, BinaryData geometry = null, IEnumerable bbox = null, BinaryData properties = null, IEnumerable links = null, IReadOnlyDictionary assets = null, string providerCollectionId = null)
+ {
+ stacExtensions ??= new List();
+ bbox ??= new List();
+ links ??= new List();
+ assets ??= new Dictionary();
+
+ return new StacItem(
+ stacVersion,
+ stacExtensions?.ToList(),
+ id,
+ type,
+ geometry,
+ bbox?.ToList(),
+ properties,
+ links?.ToList(),
+ assets,
+ providerCollectionId,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The HREF of the link.
+ /// The relation type of the link.
+ /// The type of the link. Optional.
+ /// The title of the link. Optional.
+ /// A new instance for mocking.
+ public static StacLink StacLink(string href = null, string rel = null, string type = null, string title = null)
+ {
+ return new StacLink(href, rel, type, title, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The HREF of the asset.
+ /// The title of the asset.
+ /// The description of the asset.
+ /// The type of the asset.
+ /// The roles of the asset.
+ /// A new instance for mocking.
+ public static StacAsset StacAsset(string href = null, string title = null, string description = null, string type = null, IEnumerable roles = null)
+ {
+ roles ??= new List();
+
+ return new StacAsset(
+ href,
+ title,
+ description,
+ type,
+ roles?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Dependent Collections.
+ /// Schema.
+ /// Id of the Schema.
+ /// A new instance for mocking.
+ public static Schema Schema(IEnumerable links = null, string eTag = null, string status = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? modifiedDateTime = null, string source = null, string name = null, string description = null, string createdBy = null, string modifiedBy = null, IDictionary properties = null, IEnumerable dependentCollections = null, IDictionary schemaModel = null, string id = null)
+ {
+ links ??= new List();
+ properties ??= new Dictionary();
+ dependentCollections ??= new List();
+ schemaModel ??= new Dictionary();
+
+ return new Schema(
+ links?.ToList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties,
+ dependentCollections?.ToList(),
+ schemaModel,
+ id,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Catalog Id.
+ /// Collection Id.
+ /// A new instance for mocking.
+ public static CatalogCollection CatalogCollection(string catalogId = null, string collectionId = null)
+ {
+ return new CatalogCollection(catalogId, collectionId, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Id.
+ /// Message.
+ /// Status.
+ /// JobCreatedDateTime.
+ /// JobLastActionDateTime.
+ /// E2eid.
+ /// SamplePartnerRequestBody.
+ /// A new instance for mocking.
+ public static SamplePartnerResponse SamplePartnerResponse(string id = null, string message = null, string status = null, DateTimeOffset? jobCreatedDateTime = null, DateTimeOffset? jobLastActionDateTime = null, string e2Eid = null, SamplePartnerRequestBody partnerRequestBody = null)
+ {
+ return new SamplePartnerResponse(
+ id,
+ message,
+ status,
+ jobCreatedDateTime,
+ jobLastActionDateTime,
+ e2Eid,
+ partnerRequestBody,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// SolutionId.
+ /// PartyId.
+ /// GddStartDate.
+ /// GddEndDate.
+ /// ResourceId.
+ /// ResourceType.
+ /// Crop.
+ /// TemperatureUnit.
+ /// Method.
+ /// A new instance for mocking.
+ public static SamplePartnerRequestBody SamplePartnerRequestBody(string solutionId = null, string partyId = null, DateTimeOffset? gddStartDate = null, DateTimeOffset? gddEndDate = null, string resourceId = null, string resourceType = null, string crop = null, string temperatureUnit = null, string method = null)
+ {
+ return new SamplePartnerRequestBody(
+ solutionId,
+ partyId,
+ gddStartDate,
+ gddEndDate,
+ resourceId,
+ resourceType,
+ crop,
+ temperatureUnit,
+ method,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Schema of Weather Metadata.
+ /// Indicates a Succeeded, Failed, or PartiallySucceeded response.
+ /// List of weather data for all the weather locations.
+ /// Model for errors encountered for all failed locations.
+ /// A new instance for mocking.
+ public static WeatherResponse WeatherResponse(WeatherMetadata weatherMetadata = null, string status = null, IEnumerable locations = null, WeatherDataErrors errors = null)
+ {
+ locations ??= new List();
+
+ return new WeatherResponse(weatherMetadata, status, locations?.ToList(), errors, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Weather provider name.
+ /// Provider's api name to which request is to be made.
+ ///
+ /// Language (IETF BCP 47 language tag) in which search results should be returned
+ /// by the data provider. Examples: 'en-US', 'es', 'es-MX', 'fr-FR'.
+ ///
+ ///
+ /// Units for which request to data provider is to be sent. Supported values are
+ /// 'e' for English units, 'm' for Metric units, 'h' for Hybrid units (UK) and 's'
+ /// for Metric SI units.
+ ///
+ /// Type of weather data (forecast/historical).
+ /// A new instance for mocking.
+ public static WeatherMetadata WeatherMetadata(string providerName = null, string providerApiName = null, string language = null, string units = null, string weatherDataType = null)
+ {
+ return new WeatherMetadata(
+ providerName,
+ providerApiName,
+ language,
+ units,
+ weatherDataType,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Schema of Location data.
+ /// Request Completion Time in Utc of the location.
+ /// Date-time when resource was last requested, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Schema of weather data.
+ /// A new instance for mocking.
+ public static WeatherLocationData WeatherLocationData(WeatherLocation location = null, string requestCompletionTime = null, DateTimeOffset? lastRefreshedDateTime = null, WeatherData data = null)
+ {
+ return new WeatherLocationData(location, requestCompletionTime, lastRefreshedDateTime, data, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ ///
+ /// A collection of key value pairs that belongs to the resource. Each pair must
+ /// not have a key greater than 50 characters and must not have a value greater
+ /// than 250 characters. Note: A maximum of 100 key value pairs can be provided for
+ /// a resource and only string and numeral values are supported.
+ ///
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Day of week.
+ ///
+ /// This data field indicates whether it is daytime or nighttime based on the Local
+ /// Apparent Time of the location.
+ ///
+ /// Expiration time in Utc format.
+ ///
+ /// This number is the key to the weather icon lookup. The data field shows the
+ /// icon number that is matched to represent the observed weather conditions.
+ ///
+ /// Code representing full set sensible weather.
+ /// Indicates whether there is precipitation or not.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ ///
+ /// The UV Index Description which complements the UV Index value by providing an
+ /// associated level of risk of skin damage due to exposure (-2 = Not Available, -1
+ /// = No Report, 0 to 2 = Low, 3 to 5 = Moderate, 6 to 7 = High, 8 to 10 = Very
+ /// High, 11 to 16 = Extreme).
+ ///
+ /// Hourly maximum UV index.
+ /// Time forecast is valid in local apparent time.
+ /// Time forecast is valid in Utc format.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Schema for storing measurement readings and unit.
+ /// Hourly sensible weather phrase containing longer description.
+ /// Hourly sensible weather phrase containing short description.
+ /// A new instance for mocking.
+ public static WeatherData WeatherData(IReadOnlyDictionary additionalAttributes = null, Measures wetBulbTemperature = null, Measures cloudCover = null, IEnumerable dayOfWeek = null, IEnumerable dayOrNight = null, IEnumerable expirationTime = null, IEnumerable iconCode = null, IEnumerable iconCodeExtend = null, IEnumerable hasPrecipitation = null, Measures pressureMeanSeaLevel = null, Measures relativeHumidity = null, Measures temperature = null, Measures temperatureDewPoint = null, Measures temperatureFeelsLike = null, Measures temperatureHeatIndex = null, Measures temperatureWindChill = null, IEnumerable uvDescription = null, IEnumerable uvIndex = null, IEnumerable validTimeLocal = null, IEnumerable validTime = null, Measures visibility = null, Measures windDirection = null, Measures windGust = null, Measures windSpeed = null, IEnumerable wxPhraseLong = null, IEnumerable wxPhraseShort = null)
+ {
+ additionalAttributes ??= new Dictionary();
+ dayOfWeek ??= new List();
+ dayOrNight ??= new List();
+ expirationTime ??= new List();
+ iconCode ??= new List();
+ iconCodeExtend ??= new List();
+ hasPrecipitation ??= new List();
+ uvDescription ??= new List();
+ uvIndex ??= new List();
+ validTimeLocal ??= new List();
+ validTime ??= new List();
+ wxPhraseLong ??= new List();
+ wxPhraseShort ??= new List();
+
+ return new WeatherData(
+ additionalAttributes,
+ wetBulbTemperature,
+ cloudCover,
+ dayOfWeek?.ToList(),
+ dayOrNight?.ToList(),
+ expirationTime?.ToList(),
+ iconCode?.ToList(),
+ iconCodeExtend?.ToList(),
+ hasPrecipitation?.ToList(),
+ pressureMeanSeaLevel,
+ relativeHumidity,
+ temperature,
+ temperatureDewPoint,
+ temperatureFeelsLike,
+ temperatureHeatIndex,
+ temperatureWindChill,
+ uvDescription?.ToList(),
+ uvIndex?.ToList(),
+ validTimeLocal?.ToList(),
+ validTime?.ToList(),
+ visibility,
+ windDirection,
+ windGust,
+ windSpeed,
+ wxPhraseLong?.ToList(),
+ wxPhraseShort?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Data unit.
+ /// Data values.
+ /// A new instance for mocking.
+ public static Measures Measures(string unit = null, IEnumerable value = null)
+ {
+ value ??= new List();
+
+ return new Measures(unit, value?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// List of errors encountered for all failed locations.
+ /// A new instance for mocking.
+ public static WeatherDataErrors WeatherDataErrors(IEnumerable locations = null)
+ {
+ locations ??= new List();
+
+ return new WeatherDataErrors(locations?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Schema of Location data.
+ /// Status code returned by data provider.
+ /// Description of the error.
+ ///
+ /// Flag suggesting if retry attempt with same request body should be made to fetch
+ /// required data.
+ ///
+ /// A new instance for mocking.
+ public static ErrorForLocation ErrorForLocation(WeatherLocation location = null, int? code = null, string description = null, bool? retryable = null)
+ {
+ return new ErrorForLocation(location, code, description, retryable, serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.Serialization.cs
new file mode 100644
index 000000000000..a6b423a601f3
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.Serialization.cs
@@ -0,0 +1,134 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ public partial class ApiKeyAuthCredentials : 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 override 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(ApiKeyAuthCredentials)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("apiKey"u8);
+ writer.WriteObjectValue(ApiKey, options);
+ }
+
+ ApiKeyAuthCredentials 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(ApiKeyAuthCredentials)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeApiKeyAuthCredentials(document.RootElement, options);
+ }
+
+ internal static ApiKeyAuthCredentials DeserializeApiKeyAuthCredentials(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ KeyVaultProperties apiKey = default;
+ AuthCredentialsKind kind = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("apiKey"u8))
+ {
+ apiKey = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("kind"u8))
+ {
+ kind = new AuthCredentialsKind(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ApiKeyAuthCredentials(kind, serializedAdditionalRawData, apiKey);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(ApiKeyAuthCredentials)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ApiKeyAuthCredentials 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 DeserializeApiKeyAuthCredentials(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ApiKeyAuthCredentials)} 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 new ApiKeyAuthCredentials FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeApiKeyAuthCredentials(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.cs
new file mode 100644
index 000000000000..d4474c415a17
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/ApiKeyAuthCredentials.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Api Key Auth Credentials class for API Key based Auth.
+ public partial class ApiKeyAuthCredentials : AuthCredentials
+ {
+ /// Initializes a new instance of .
+ /// Properties of the key vault.
+ /// is null.
+ public ApiKeyAuthCredentials(KeyVaultProperties apiKey)
+ {
+ Argument.AssertNotNull(apiKey, nameof(apiKey));
+
+ Kind = AuthCredentialsKind.ApiKeyAuthCredentials;
+ ApiKey = apiKey;
+ }
+
+ /// Initializes a new instance of .
+ /// Enum for different types of AuthCredentials supported.
+ /// Keeps track of any properties unknown to the library.
+ /// Properties of the key vault.
+ internal ApiKeyAuthCredentials(AuthCredentialsKind kind, IDictionary serializedAdditionalRawData, KeyVaultProperties apiKey) : base(kind, serializedAdditionalRawData)
+ {
+ ApiKey = apiKey;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal ApiKeyAuthCredentials()
+ {
+ }
+
+ /// Properties of the key vault.
+ public KeyVaultProperties ApiKey { get; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.Serialization.cs
new file mode 100644
index 000000000000..9d772bf63f12
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.Serialization.cs
@@ -0,0 +1,171 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ public partial class Asset : 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(Asset)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(Type))
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.Value.ToString());
+ }
+ if (Optional.IsDefined(Name))
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (Optional.IsDefined(Href))
+ {
+ writer.WritePropertyName("href"u8);
+ writer.WriteStringValue(Href);
+ }
+ 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
+ }
+ }
+ }
+
+ Asset 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(Asset)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAsset(document.RootElement, options);
+ }
+
+ internal static Asset DeserializeAsset(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DataFormat? type = default;
+ string name = default;
+ string href = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ type = new DataFormat(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("href"u8))
+ {
+ href = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Asset(type, name, href, 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);
+ default:
+ throw new FormatException($"The model {nameof(Asset)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Asset 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 DeserializeAsset(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Asset)} 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 Asset FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAsset(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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.cs
new file mode 100644
index 000000000000..c5e2f63e5878
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Asset.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Asset.
+ public partial class Asset
+ {
+ ///
+ /// 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 .
+ public Asset()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Type of dataset.
+ /// Name.
+ /// Href.
+ /// Keeps track of any properties unknown to the library.
+ internal Asset(DataFormat? type, string name, string href, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ Name = name;
+ Href = href;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Type of dataset.
+ public DataFormat? Type { get; set; }
+ /// Name.
+ public string Name { get; set; }
+ /// Href.
+ public string Href { get; set; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.Serialization.cs
new file mode 100644
index 000000000000..666e07045adf
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.Serialization.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ [PersistableModelProxy(typeof(UnknownAuthCredentials))]
+ public partial class AuthCredentials : 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(AuthCredentials)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("kind"u8);
+ writer.WriteStringValue(Kind.ToString());
+ 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
+ }
+ }
+ }
+
+ AuthCredentials 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(AuthCredentials)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAuthCredentials(document.RootElement, options);
+ }
+
+ internal static AuthCredentials DeserializeAuthCredentials(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("kind", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "ApiKeyAuthCredentials": return ApiKeyAuthCredentials.DeserializeApiKeyAuthCredentials(element, options);
+ case "OAuthClientCredentials": return OauthClientCredentials.DeserializeOauthClientCredentials(element, options);
+ }
+ }
+ return UnknownAuthCredentials.DeserializeUnknownAuthCredentials(element, options);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AuthCredentials)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AuthCredentials 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 DeserializeAuthCredentials(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AuthCredentials)} 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 AuthCredentials FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAuthCredentials(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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.cs
new file mode 100644
index 000000000000..16a3e4d56a64
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentials.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ ///
+ /// AuthCredentials abstract base class for Auth Purpose.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include and .
+ ///
+ public abstract partial class AuthCredentials
+ {
+ ///
+ /// 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 protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected AuthCredentials()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Enum for different types of AuthCredentials supported.
+ /// Keeps track of any properties unknown to the library.
+ internal AuthCredentials(AuthCredentialsKind kind, IDictionary serializedAdditionalRawData)
+ {
+ Kind = kind;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Enum for different types of AuthCredentials supported.
+ internal AuthCredentialsKind Kind { get; set; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentialsKind.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentialsKind.cs
new file mode 100644
index 000000000000..9115d709c947
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/AuthCredentialsKind.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Enum for different types of AuthCredentials supported.
+ internal readonly partial struct AuthCredentialsKind : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AuthCredentialsKind(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string OAuthClientCredentialsValue = "OAuthClientCredentials";
+ private const string ApiKeyAuthCredentialsValue = "ApiKeyAuthCredentials";
+
+ /// OAuthClientCredentials.
+ public static AuthCredentialsKind OAuthClientCredentials { get; } = new AuthCredentialsKind(OAuthClientCredentialsValue);
+ /// ApiKeyAuthCredentials.
+ public static AuthCredentialsKind ApiKeyAuthCredentials { get; } = new AuthCredentialsKind(ApiKeyAuthCredentialsValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AuthCredentialsKind left, AuthCredentialsKind right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AuthCredentialsKind left, AuthCredentialsKind right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator AuthCredentialsKind(string value) => new AuthCredentialsKind(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AuthCredentialsKind other && Equals(other);
+ ///
+ public bool Equals(AuthCredentialsKind 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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.Serialization.cs
new file mode 100644
index 000000000000..0c2cff172e8f
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.Serialization.cs
@@ -0,0 +1,226 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ internal partial class CancelJobRequest : 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(CancelJobRequest)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("solutionId"u8);
+ writer.WriteStringValue(SolutionId);
+ writer.WritePropertyName("requestPath"u8);
+ writer.WriteStringValue(RequestPath);
+ writer.WritePropertyName("partnerRequestBody"u8);
+ writer.WriteStartObject();
+ foreach (var item in PartnerRequestBody)
+ {
+ writer.WritePropertyName(item.Key);
+ if (item.Value == null)
+ {
+ writer.WriteNullValue();
+ continue;
+ }
+#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
+ }
+ writer.WriteEndObject();
+ writer.WritePropertyName("partnerRequestHeaders"u8);
+ writer.WriteStartObject();
+ foreach (var item in PartnerRequestHeaders)
+ {
+ writer.WritePropertyName(item.Key);
+ if (item.Value == null)
+ {
+ writer.WriteNullValue();
+ continue;
+ }
+#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
+ }
+ writer.WriteEndObject();
+ 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
+ }
+ }
+ }
+
+ CancelJobRequest 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(CancelJobRequest)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCancelJobRequest(document.RootElement, options);
+ }
+
+ internal static CancelJobRequest DeserializeCancelJobRequest(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string solutionId = default;
+ string requestPath = default;
+ IReadOnlyDictionary partnerRequestBody = default;
+ IReadOnlyDictionary partnerRequestHeaders = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("solutionId"u8))
+ {
+ solutionId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("requestPath"u8))
+ {
+ requestPath = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("partnerRequestBody"u8))
+ {
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText()));
+ }
+ }
+ partnerRequestBody = dictionary;
+ continue;
+ }
+ if (property.NameEquals("partnerRequestHeaders"u8))
+ {
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText()));
+ }
+ }
+ partnerRequestHeaders = dictionary;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new CancelJobRequest(solutionId, requestPath, partnerRequestBody, partnerRequestHeaders, 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);
+ default:
+ throw new FormatException($"The model {nameof(CancelJobRequest)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CancelJobRequest 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 DeserializeCancelJobRequest(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CancelJobRequest)} 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 CancelJobRequest FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCancelJobRequest(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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.cs
new file mode 100644
index 000000000000..2d6b6c3e8857
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CancelJobRequest.cs
@@ -0,0 +1,154 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ /// The CancelJobRequest.
+ internal partial class CancelJobRequest
+ {
+ ///
+ /// 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 .
+ /// SolutionId.
+ /// RequestPath.
+ /// Properties.
+ /// Properties.
+ /// , , or is null.
+ internal CancelJobRequest(string solutionId, string requestPath, IReadOnlyDictionary partnerRequestBody, IReadOnlyDictionary partnerRequestHeaders)
+ {
+ Argument.AssertNotNull(solutionId, nameof(solutionId));
+ Argument.AssertNotNull(requestPath, nameof(requestPath));
+ Argument.AssertNotNull(partnerRequestBody, nameof(partnerRequestBody));
+ Argument.AssertNotNull(partnerRequestHeaders, nameof(partnerRequestHeaders));
+
+ SolutionId = solutionId;
+ RequestPath = requestPath;
+ PartnerRequestBody = partnerRequestBody;
+ PartnerRequestHeaders = partnerRequestHeaders;
+ }
+
+ /// Initializes a new instance of .
+ /// SolutionId.
+ /// RequestPath.
+ /// Properties.
+ /// Properties.
+ /// Keeps track of any properties unknown to the library.
+ internal CancelJobRequest(string solutionId, string requestPath, IReadOnlyDictionary partnerRequestBody, IReadOnlyDictionary partnerRequestHeaders, IDictionary serializedAdditionalRawData)
+ {
+ SolutionId = solutionId;
+ RequestPath = requestPath;
+ PartnerRequestBody = partnerRequestBody;
+ PartnerRequestHeaders = partnerRequestHeaders;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal CancelJobRequest()
+ {
+ }
+
+ /// SolutionId.
+ public string SolutionId { get; }
+ /// RequestPath.
+ public string RequestPath { get; }
+ ///
+ /// Properties.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ public IReadOnlyDictionary PartnerRequestBody { get; }
+ ///
+ /// Properties.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ public IReadOnlyDictionary PartnerRequestHeaders { get; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.Serialization.cs
new file mode 100644
index 000000000000..ae86cc834e57
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.Serialization.cs
@@ -0,0 +1,335 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ public partial class Catalog : 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(Catalog)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsCollectionDefined(Links))
+ {
+ writer.WritePropertyName("links"u8);
+ writer.WriteStartArray();
+ foreach (var item in Links)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && Optional.IsDefined(ETag))
+ {
+ writer.WritePropertyName("eTag"u8);
+ writer.WriteStringValue(ETag);
+ }
+ if (Optional.IsDefined(Status))
+ {
+ writer.WritePropertyName("status"u8);
+ writer.WriteStringValue(Status);
+ }
+ if (options.Format != "W" && Optional.IsDefined(CreatedDateTime))
+ {
+ writer.WritePropertyName("createdDateTime"u8);
+ writer.WriteStringValue(CreatedDateTime.Value, "O");
+ }
+ if (options.Format != "W" && Optional.IsDefined(ModifiedDateTime))
+ {
+ writer.WritePropertyName("modifiedDateTime"u8);
+ writer.WriteStringValue(ModifiedDateTime.Value, "O");
+ }
+ if (Optional.IsDefined(Source))
+ {
+ writer.WritePropertyName("source"u8);
+ writer.WriteStringValue(Source);
+ }
+ if (Optional.IsDefined(Name))
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (options.Format != "W" && Optional.IsDefined(CreatedBy))
+ {
+ writer.WritePropertyName("createdBy"u8);
+ writer.WriteStringValue(CreatedBy);
+ }
+ if (options.Format != "W" && Optional.IsDefined(ModifiedBy))
+ {
+ writer.WritePropertyName("modifiedBy"u8);
+ writer.WriteStringValue(ModifiedBy);
+ }
+ if (Optional.IsCollectionDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteStartObject();
+ foreach (var item in Properties)
+ {
+ writer.WritePropertyName(item.Key);
+ if (item.Value == null)
+ {
+ writer.WriteNullValue();
+ continue;
+ }
+#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
+ }
+ writer.WriteEndObject();
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ 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
+ }
+ }
+ }
+
+ Catalog 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(Catalog)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCatalog(document.RootElement, options);
+ }
+
+ internal static Catalog DeserializeCatalog(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IList links = default;
+ string eTag = default;
+ string status = default;
+ DateTimeOffset? createdDateTime = default;
+ DateTimeOffset? modifiedDateTime = default;
+ string source = default;
+ string name = default;
+ string description = default;
+ string createdBy = default;
+ string modifiedBy = default;
+ IDictionary properties = default;
+ string id = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("links"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(Link.DeserializeLink(item, options));
+ }
+ links = array;
+ continue;
+ }
+ if (property.NameEquals("eTag"u8))
+ {
+ eTag = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("status"u8))
+ {
+ status = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdDateTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ createdDateTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("modifiedDateTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ modifiedDateTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("source"u8))
+ {
+ source = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdBy"u8))
+ {
+ createdBy = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("modifiedBy"u8))
+ {
+ modifiedBy = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText()));
+ }
+ }
+ properties = dictionary;
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Catalog(
+ links ?? new ChangeTrackingList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties ?? new ChangeTrackingDictionary(),
+ id,
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(Catalog)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Catalog 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 DeserializeCatalog(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Catalog)} 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 Catalog FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCatalog(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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.cs
new file mode 100644
index 000000000000..3951e3c52382
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalog.cs
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Catalog.
+ public partial class Catalog
+ {
+ ///
+ /// 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 .
+ public Catalog()
+ {
+ Links = new ChangeTrackingList();
+ Properties = new ChangeTrackingDictionary();
+ }
+
+ /// Initializes a new instance of .
+ /// Links for referencing other objects.
+ /// The ETag value to implement optimistic concurrency.
+ /// Status of the resource.
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ /// Source of the resource.
+ /// Name to identify resource.
+ /// Textual description of the resource.
+ /// Created by user/tenant id.
+ /// Modified by user/tenant id.
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// Id of the Catalog.
+ /// Keeps track of any properties unknown to the library.
+ internal Catalog(IList links, string eTag, string status, DateTimeOffset? createdDateTime, DateTimeOffset? modifiedDateTime, string source, string name, string description, string createdBy, string modifiedBy, IDictionary properties, string id, IDictionary serializedAdditionalRawData)
+ {
+ Links = links;
+ ETag = eTag;
+ Status = status;
+ CreatedDateTime = createdDateTime;
+ ModifiedDateTime = modifiedDateTime;
+ Source = source;
+ Name = name;
+ Description = description;
+ CreatedBy = createdBy;
+ ModifiedBy = modifiedBy;
+ Properties = properties;
+ Id = id;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Links for referencing other objects.
+ public IList Links { get; }
+ /// The ETag value to implement optimistic concurrency.
+ public string ETag { get; }
+ /// Status of the resource.
+ public string Status { get; set; }
+ /// Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ public DateTimeOffset? CreatedDateTime { get; }
+ /// Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.
+ public DateTimeOffset? ModifiedDateTime { get; }
+ /// Source of the resource.
+ public string Source { get; set; }
+ /// Name to identify resource.
+ public string Name { get; set; }
+ /// Textual description of the resource.
+ public string Description { get; set; }
+ /// Created by user/tenant id.
+ public string CreatedBy { get; }
+ /// Modified by user/tenant id.
+ public string ModifiedBy { get; }
+ ///
+ /// A collection of key value pairs that belongs to the resource.
+ /// Each pair must not have a key greater than 50 characters
+ /// and must not have a value greater than 150 characters.
+ /// Note: A maximum of 25 key value pairs can be provided for a resource and only
+ /// string,
+ /// numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ public IDictionary Properties { get; }
+ /// Id of the Catalog.
+ public string Id { get; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.Serialization.cs
new file mode 100644
index 000000000000..66d046e48ce2
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.Serialization.cs
@@ -0,0 +1,156 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ public partial class CatalogCollection : 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(CatalogCollection)} does not support writing '{format}' format.");
+ }
+
+ if (options.Format != "W" && Optional.IsDefined(CatalogId))
+ {
+ writer.WritePropertyName("catalogId"u8);
+ writer.WriteStringValue(CatalogId);
+ }
+ if (options.Format != "W" && Optional.IsDefined(CollectionId))
+ {
+ writer.WritePropertyName("collectionId"u8);
+ writer.WriteStringValue(CollectionId);
+ }
+ 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
+ }
+ }
+ }
+
+ CatalogCollection 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(CatalogCollection)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCatalogCollection(document.RootElement, options);
+ }
+
+ internal static CatalogCollection DeserializeCatalogCollection(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string catalogId = default;
+ string collectionId = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("catalogId"u8))
+ {
+ catalogId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("collectionId"u8))
+ {
+ collectionId = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new CatalogCollection(catalogId, collectionId, 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);
+ default:
+ throw new FormatException($"The model {nameof(CatalogCollection)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CatalogCollection 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 DeserializeCatalogCollection(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CatalogCollection)} 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 CatalogCollection FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCatalogCollection(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/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.cs
new file mode 100644
index 000000000000..0b0b207b24a3
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/CatalogCollection.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AgriculturePlatform
+{
+ /// Schema for storing catalog and collection id.
+ public partial class CatalogCollection
+ {
+ ///
+ /// 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 .
+ internal CatalogCollection()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Catalog Id.
+ /// Collection Id.
+ /// Keeps track of any properties unknown to the library.
+ internal CatalogCollection(string catalogId, string collectionId, IDictionary serializedAdditionalRawData)
+ {
+ CatalogId = catalogId;
+ CollectionId = collectionId;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Catalog Id.
+ public string CatalogId { get; }
+ /// Collection Id.
+ public string CollectionId { get; }
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalogs.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalogs.cs
new file mode 100644
index 000000000000..86e7458ab614
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Catalogs.cs
@@ -0,0 +1,592 @@
+// 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 Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.AgriculturePlatform
+{
+ // Data plane generated sub-client.
+ /// The Catalogs sub-client.
+ public partial class Catalogs
+ {
+ private const string AuthorizationHeader = "Authorization";
+ private readonly AzureKeyCredential _keyCredential;
+ 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 Catalogs for mocking.
+ protected Catalogs()
+ {
+ }
+
+ /// Initializes a new instance of Catalogs.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The key credential to copy.
+ /// The to use.
+ /// The API version to use for this operation.
+ internal Catalogs(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _keyCredential = keyCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Gets a specified Catalog resource.
+ /// Id of the Catalog.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetCatalogAsync(string catalogId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetCatalogAsync(catalogId, context).ConfigureAwait(false);
+ return Response.FromValue(Catalog.FromResponse(response), response);
+ }
+
+ /// Gets a specified Catalog resource.
+ /// Id of the Catalog.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetCatalog(string catalogId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetCatalog(catalogId, context);
+ return Response.FromValue(Catalog.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Gets a specified Catalog resource.
+ ///
+ /// -
+ ///
+ /// 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.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task GetCatalogAsync(string catalogId, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.GetCatalog");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetCatalogRequest(catalogId, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Gets a specified Catalog resource.
+ ///
+ /// -
+ ///
+ /// 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.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response GetCatalog(string catalogId, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.GetCatalog");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetCatalogRequest(catalogId, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Creates or updates a Catalog resource.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task CreateOrUpdateAsync(string catalogId, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateOrUpdateRequest(catalogId, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Creates or updates a Catalog resource.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response CreateOrUpdate(string catalogId, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateOrUpdateRequest(catalogId, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes Catalog for given Catalog id.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task DeleteAsync(string catalogId, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.Delete");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteRequest(catalogId, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes Catalog for given Catalog id.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// Id of the Catalog.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response Delete(string catalogId, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(catalogId, nameof(catalogId));
+
+ using var scope = ClientDiagnostics.CreateScope("Catalogs.Delete");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteRequest(catalogId, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Returns a paginated list of Catalog resources.
+ /// Names of the resource.
+ ///
+ /// Filters on key-value pairs within the Properties object.
+ /// eg. "{testKey} eq {testValue}".
+ ///
+ /// Statuses of the resource.
+ /// Ids of the resource.
+ /// Minimum creation date of resource (inclusive).
+ /// Maximum creation date of resource (inclusive).
+ /// Minimum last modified date of resource (inclusive).
+ /// Maximum last modified date of resource (inclusive).
+ ///
+ /// Maximum number of items needed (inclusive).
+ /// Minimum = 10, Maximum = 1000, Default value = 50.
+ ///
+ /// Skip token for getting next set of results.
+ /// The cancellation token to use.
+ ///
+ public virtual AsyncPageable GetCatalogsAsync(IEnumerable names = null, IEnumerable propertyFilters = null, IEnumerable statuses = null, IEnumerable ids = null, DateTimeOffset? minCreatedDateTime = null, DateTimeOffset? maxCreatedDateTime = null, DateTimeOffset? minLastModifiedDateTime = null, DateTimeOffset? maxLastModifiedDateTime = null, int? maxPageSize = null, string skipToken = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null;
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCatalogsRequest(names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCatalogsNextPageRequest(nextLink, names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Catalog.DeserializeCatalog(e), ClientDiagnostics, _pipeline, "Catalogs.GetCatalogs", "value", "nextLink", context);
+ }
+
+ /// Returns a paginated list of Catalog resources.
+ /// Names of the resource.
+ ///
+ /// Filters on key-value pairs within the Properties object.
+ /// eg. "{testKey} eq {testValue}".
+ ///
+ /// Statuses of the resource.
+ /// Ids of the resource.
+ /// Minimum creation date of resource (inclusive).
+ /// Maximum creation date of resource (inclusive).
+ /// Minimum last modified date of resource (inclusive).
+ /// Maximum last modified date of resource (inclusive).
+ ///
+ /// Maximum number of items needed (inclusive).
+ /// Minimum = 10, Maximum = 1000, Default value = 50.
+ ///
+ /// Skip token for getting next set of results.
+ /// The cancellation token to use.
+ ///
+ public virtual Pageable GetCatalogs(IEnumerable names = null, IEnumerable propertyFilters = null, IEnumerable statuses = null, IEnumerable ids = null, DateTimeOffset? minCreatedDateTime = null, DateTimeOffset? maxCreatedDateTime = null, DateTimeOffset? minLastModifiedDateTime = null, DateTimeOffset? maxLastModifiedDateTime = null, int? maxPageSize = null, string skipToken = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null;
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCatalogsRequest(names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCatalogsNextPageRequest(nextLink, names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Catalog.DeserializeCatalog(e), ClientDiagnostics, _pipeline, "Catalogs.GetCatalogs", "value", "nextLink", context);
+ }
+
+ ///
+ /// [Protocol Method] Returns a paginated list of Catalog resources.
+ ///
+ /// -
+ ///
+ /// 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.
+ ///
+ ///
+ ///
+ ///
+ /// Names of the resource.
+ ///
+ /// Filters on key-value pairs within the Properties object.
+ /// eg. "{testKey} eq {testValue}".
+ ///
+ /// Statuses of the resource.
+ /// Ids of the resource.
+ /// Minimum creation date of resource (inclusive).
+ /// Maximum creation date of resource (inclusive).
+ /// Minimum last modified date of resource (inclusive).
+ /// Maximum last modified date of resource (inclusive).
+ ///
+ /// Maximum number of items needed (inclusive).
+ /// Minimum = 10, Maximum = 1000, Default value = 50.
+ ///
+ /// Skip token for getting next set of results.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// Service returned a non-success status code.
+ /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below.
+ ///
+ public virtual AsyncPageable GetCatalogsAsync(IEnumerable names, IEnumerable propertyFilters, IEnumerable statuses, IEnumerable ids, DateTimeOffset? minCreatedDateTime, DateTimeOffset? maxCreatedDateTime, DateTimeOffset? minLastModifiedDateTime, DateTimeOffset? maxLastModifiedDateTime, int? maxPageSize, string skipToken, RequestContext context)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCatalogsRequest(names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCatalogsNextPageRequest(nextLink, names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Catalogs.GetCatalogs", "value", "nextLink", context);
+ }
+
+ ///
+ /// [Protocol Method] Returns a paginated list of Catalog resources.
+ ///
+ /// -
+ ///
+ /// 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.
+ ///
+ ///
+ ///
+ ///
+ /// Names of the resource.
+ ///
+ /// Filters on key-value pairs within the Properties object.
+ /// eg. "{testKey} eq {testValue}".
+ ///
+ /// Statuses of the resource.
+ /// Ids of the resource.
+ /// Minimum creation date of resource (inclusive).
+ /// Maximum creation date of resource (inclusive).
+ /// Minimum last modified date of resource (inclusive).
+ /// Maximum last modified date of resource (inclusive).
+ ///
+ /// Maximum number of items needed (inclusive).
+ /// Minimum = 10, Maximum = 1000, Default value = 50.
+ ///
+ /// Skip token for getting next set of results.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// Service returned a non-success status code.
+ /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below.
+ ///
+ public virtual Pageable GetCatalogs(IEnumerable names, IEnumerable propertyFilters, IEnumerable statuses, IEnumerable ids, DateTimeOffset? minCreatedDateTime, DateTimeOffset? maxCreatedDateTime, DateTimeOffset? minLastModifiedDateTime, DateTimeOffset? maxLastModifiedDateTime, int? maxPageSize, string skipToken, RequestContext context)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetCatalogsRequest(names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetCatalogsNextPageRequest(nextLink, names, propertyFilters, statuses, ids, minCreatedDateTime, maxCreatedDateTime, minLastModifiedDateTime, maxLastModifiedDateTime, maxPageSize, skipToken, context);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Catalogs.GetCatalogs", "value", "nextLink", context);
+ }
+
+ internal HttpMessage CreateGetCatalogsRequest(IEnumerable names, IEnumerable propertyFilters, IEnumerable statuses, IEnumerable ids, DateTimeOffset? minCreatedDateTime, DateTimeOffset? maxCreatedDateTime, DateTimeOffset? minLastModifiedDateTime, DateTimeOffset? maxLastModifiedDateTime, int? maxPageSize, string skipToken, 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("/catalogs", false);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ if (names != null && !(names is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined))
+ {
+ foreach (var param in names)
+ {
+ uri.AppendQuery("names", param, true);
+ }
+ }
+ if (propertyFilters != null && !(propertyFilters is ChangeTrackingList changeTrackingList0 && changeTrackingList0.IsUndefined))
+ {
+ foreach (var param in propertyFilters)
+ {
+ uri.AppendQuery("propertyFilters", param, true);
+ }
+ }
+ if (statuses != null && !(statuses is ChangeTrackingList changeTrackingList1 && changeTrackingList1.IsUndefined))
+ {
+ foreach (var param in statuses)
+ {
+ uri.AppendQuery("statuses", param, true);
+ }
+ }
+ if (ids != null && !(ids is ChangeTrackingList changeTrackingList2 && changeTrackingList2.IsUndefined))
+ {
+ foreach (var param in ids)
+ {
+ uri.AppendQuery("ids", param, true);
+ }
+ }
+ if (minCreatedDateTime != null)
+ {
+ uri.AppendQuery("minCreatedDateTime", minCreatedDateTime.Value, "O", true);
+ }
+ if (maxCreatedDateTime != null)
+ {
+ uri.AppendQuery("maxCreatedDateTime", maxCreatedDateTime.Value, "O", true);
+ }
+ if (minLastModifiedDateTime != null)
+ {
+ uri.AppendQuery("minLastModifiedDateTime", minLastModifiedDateTime.Value, "O", true);
+ }
+ if (maxLastModifiedDateTime != null)
+ {
+ uri.AppendQuery("maxLastModifiedDateTime", maxLastModifiedDateTime.Value, "O", true);
+ }
+ if (maxPageSize != null)
+ {
+ uri.AppendQuery("maxPageSize", maxPageSize.Value, true);
+ }
+ if (skipToken != null)
+ {
+ uri.AppendQuery("skipToken", skipToken, true);
+ }
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ internal HttpMessage CreateGetCatalogRequest(string catalogId, 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("/catalogs/", false);
+ uri.AppendPath(catalogId, true);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ internal HttpMessage CreateCreateOrUpdateRequest(string catalogId, RequestContent content, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200201);
+ var request = message.Request;
+ request.Method = RequestMethod.Patch;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/catalogs/", false);
+ uri.AppendPath(catalogId, true);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/merge-patch+json");
+ request.Content = content;
+ return message;
+ }
+
+ internal HttpMessage CreateDeleteRequest(string catalogId, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier204);
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/catalogs/", false);
+ uri.AppendPath(catalogId, true);
+ uri.AppendQuery("api-version", _apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ internal HttpMessage CreateGetCatalogsNextPageRequest(string nextLink, IEnumerable names, IEnumerable propertyFilters, IEnumerable statuses, IEnumerable ids, DateTimeOffset? minCreatedDateTime, DateTimeOffset? maxCreatedDateTime, DateTimeOffset? minLastModifiedDateTime, DateTimeOffset? maxLastModifiedDateTime, int? maxPageSize, string skipToken, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200);
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ private static RequestContext DefaultRequestContext = new RequestContext();
+ internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default)
+ {
+ if (!cancellationToken.CanBeCanceled)
+ {
+ return DefaultRequestContext;
+ }
+
+ return new RequestContext() { CancellationToken = cancellationToken };
+ }
+
+ private static ResponseClassifier _responseClassifier200;
+ private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 });
+ private static ResponseClassifier _responseClassifier200201;
+ private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 });
+ private static ResponseClassifier _responseClassifier204;
+ private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 });
+ }
+}
diff --git a/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Collection.Serialization.cs b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Collection.Serialization.cs
new file mode 100644
index 000000000000..2abb9f1dfc82
--- /dev/null
+++ b/sdk/agricultureplatform/Azure.AgriculturePlatform/src/Generated/Collection.Serialization.cs
@@ -0,0 +1,356 @@
+// 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.Core;
+
+namespace Azure.AgriculturePlatform
+{
+ public partial class Collection : 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(Collection)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsCollectionDefined(Links))
+ {
+ writer.WritePropertyName("links"u8);
+ writer.WriteStartArray();
+ foreach (var item in Links)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && Optional.IsDefined(ETag))
+ {
+ writer.WritePropertyName("eTag"u8);
+ writer.WriteStringValue(ETag);
+ }
+ if (Optional.IsDefined(Status))
+ {
+ writer.WritePropertyName("status"u8);
+ writer.WriteStringValue(Status);
+ }
+ if (options.Format != "W" && Optional.IsDefined(CreatedDateTime))
+ {
+ writer.WritePropertyName("createdDateTime"u8);
+ writer.WriteStringValue(CreatedDateTime.Value, "O");
+ }
+ if (options.Format != "W" && Optional.IsDefined(ModifiedDateTime))
+ {
+ writer.WritePropertyName("modifiedDateTime"u8);
+ writer.WriteStringValue(ModifiedDateTime.Value, "O");
+ }
+ if (Optional.IsDefined(Source))
+ {
+ writer.WritePropertyName("source"u8);
+ writer.WriteStringValue(Source);
+ }
+ if (Optional.IsDefined(Name))
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (options.Format != "W" && Optional.IsDefined(CreatedBy))
+ {
+ writer.WritePropertyName("createdBy"u8);
+ writer.WriteStringValue(CreatedBy);
+ }
+ if (options.Format != "W" && Optional.IsDefined(ModifiedBy))
+ {
+ writer.WritePropertyName("modifiedBy"u8);
+ writer.WriteStringValue(ModifiedBy);
+ }
+ if (Optional.IsCollectionDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteStartObject();
+ foreach (var item in Properties)
+ {
+ writer.WritePropertyName(item.Key);
+ if (item.Value == null)
+ {
+ writer.WriteNullValue();
+ continue;
+ }
+#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
+ }
+ writer.WriteEndObject();
+ }
+ writer.WritePropertyName("schemaId"u8);
+ writer.WriteStringValue(SchemaId);
+ if (options.Format != "W" && Optional.IsDefined(CatalogId))
+ {
+ writer.WritePropertyName("catalogId"u8);
+ writer.WriteStringValue(CatalogId);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ 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
+ }
+ }
+ }
+
+ Collection 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(Collection)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCollection(document.RootElement, options);
+ }
+
+ internal static Collection DeserializeCollection(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IList links = default;
+ string eTag = default;
+ string status = default;
+ DateTimeOffset? createdDateTime = default;
+ DateTimeOffset? modifiedDateTime = default;
+ string source = default;
+ string name = default;
+ string description = default;
+ string createdBy = default;
+ string modifiedBy = default;
+ IDictionary properties = default;
+ string schemaId = default;
+ string catalogId = default;
+ string id = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("links"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(Link.DeserializeLink(item, options));
+ }
+ links = array;
+ continue;
+ }
+ if (property.NameEquals("eTag"u8))
+ {
+ eTag = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("status"u8))
+ {
+ status = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdDateTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ createdDateTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("modifiedDateTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ modifiedDateTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("source"u8))
+ {
+ source = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdBy"u8))
+ {
+ createdBy = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("modifiedBy"u8))
+ {
+ modifiedBy = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ if (property0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(property0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText()));
+ }
+ }
+ properties = dictionary;
+ continue;
+ }
+ if (property.NameEquals("schemaId"u8))
+ {
+ schemaId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("catalogId"u8))
+ {
+ catalogId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Collection(
+ links ?? new ChangeTrackingList(),
+ eTag,
+ status,
+ createdDateTime,
+ modifiedDateTime,
+ source,
+ name,
+ description,
+ createdBy,
+ modifiedBy,
+ properties ?? new ChangeTrackingDictionary(),
+ schemaId,
+ catalogId,
+ id,
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(Collection)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Collection 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 DeserializeCollection(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Collection)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel