diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 408e324d6c..7a4197f934 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -145,3 +145,23 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
+- package-ecosystem: nuget
+ directory: "/petstore/dotnet"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+- package-ecosystem: gradle
+ directory: "/petstore/java"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+- package-ecosystem: npm
+ directory: "/petstore/typescript"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+- package-ecosystem: gomod
+ directory: "/petstore/go"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
diff --git a/petstore/README.md b/petstore/README.md
new file mode 100644
index 0000000000..e56c18b487
--- /dev/null
+++ b/petstore/README.md
@@ -0,0 +1,60 @@
+# Swagger Petstore samples
+
+The following section showcases client SDK generated using the [OpenApi 'Swagger Petstore'](https://petstore.swagger.io/) using Kiota.
+
+NOTE: Kiota version 1.0.1 was used to generate these SDK's.
+
+## Table of content
+
+| Language | Command line |
+| -------- | ------------ |
+| [dotnet](./dotnet) | `kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --additional-data false --language csharp -o PetstoreClient -c PetstoreApiClient --log-level information --clean-output true --namespace-name KiotaSamples.PetStoreSdk` |
+| [java](./java) | `kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --language java -o utilities/src/main/java/petstore/utilities -n petstore.utilities` |
+| [typescript](./typescript) | |
+| [go](./go) | | `kiota generate --openapi https://petstore.swagger.io/v2/swagger.json --language go -o utilities -n github.com/microsoft/kiota-samples/petstore/go/utilities/`
+
+## Example of data retrieved
+
+This is a dotnet example that shows how the data looks, after generation AND the target api is called:
+
+
+
+
+## How to generate an SDK against the Swagger Petstore
+
+These steps are all based on the official docs for [generating dotnet Kiota SDK's](https://microsoft.github.io/kiota/get-started/dotnet.html):
+
+- Create a new project or solution.
+ e.g.
+ ```
+ dotnet new console -o petstore
+ cd petstore
+ ```
+- Add the nuget dependencies, which we will need for the SDK generated code to work:
+ e.g.
+ ```
+ dotnet add package Microsoft.Kiota.Abstractions
+ dotnet add package Microsoft.Kiota.Http.HttpClientLibrary
+ dotnet add package Microsoft.Kiota.Serialization.Json
+ dotnet add package Microsoft.Kiota.Serialization.Text
+ dotnet add package Microsoft.Kiota.Serialization.Form
+ ```
+- Create the Petstore SDK using Kiota and [the custom params](https://microsoft.github.io/kiota/using.html):
+ e.g.
+ ```
+ kiota generate \
+ --openapi https://petstore.swagger.io/v2/swagger.json \
+ --additional-data false \
+ --language csharp \
+ --output src\PetstoreClient \
+ --class-name PetstoreApiClient \
+ --log-level information \
+ --clean-output true \
+ --namespace-name KiotaSamples.PetStoreSdk
+ ```
+- And that's it! you're ready to go! So, lets grab some pets:
+ ```
+ var pet = await client.Pet["69"].GetAsync();
+ ```
+
+-- end of readme --
\ No newline at end of file
diff --git a/petstore/dotnet/.gitignore b/petstore/dotnet/.gitignore
new file mode 100644
index 0000000000..920d1cde17
--- /dev/null
+++ b/petstore/dotnet/.gitignore
@@ -0,0 +1,442 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*[.json, .xml, .info]
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+##
+## Visual studio for Mac
+##
+
+
+# globs
+Makefile.in
+*.userprefs
+*.usertasks
+config.make
+config.status
+aclocal.m4
+install-sh
+autom4te.cache/
+*.tar.gz
+tarballs/
+test-results/
+
+# Mac bundle stuff
+*.dmg
+*.app
+
+# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+[Dd]esktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+##
+## Visual Studio Code
+##
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
diff --git a/petstore/dotnet/.vscode/launch.json b/petstore/dotnet/.vscode/launch.json
new file mode 100644
index 0000000000..a851ec5e51
--- /dev/null
+++ b/petstore/dotnet/.vscode/launch.json
@@ -0,0 +1,25 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (console)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ "program": "${workspaceFolder}/bin/Debug/net5.0/dotnet.dll",
+ "args": [],
+ "cwd": "${workspaceFolder}",
+ "console": "internalConsole",
+ "stopAtEntry": false
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach",
+ "processId": "${command:pickProcess}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/petstore/dotnet/.vscode/tasks.json b/petstore/dotnet/.vscode/tasks.json
new file mode 100644
index 0000000000..1563eed509
--- /dev/null
+++ b/petstore/dotnet/.vscode/tasks.json
@@ -0,0 +1,24 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "command": "dotnet",
+ "type": "shell",
+ "args": [
+ "build",
+ // Ask dotnet build to generate full paths for file names.
+ "/property:GenerateFullPaths=true",
+ // Do not generate summary otherwise it leads to duplicate errors in Problems panel
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "group": "build",
+ "presentation": {
+ "reveal": "silent"
+ },
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/petstore/dotnet/GlobalUsings.cs b/petstore/dotnet/GlobalUsings.cs
new file mode 100644
index 0000000000..b113e751b3
--- /dev/null
+++ b/petstore/dotnet/GlobalUsings.cs
@@ -0,0 +1,3 @@
+global using KiotaSamples.PetStoreSdk;
+global using System.Text.Json;
+global using System.Text.Json.Serialization;
\ No newline at end of file
diff --git a/petstore/dotnet/PetstoreClient/Models/ApiResponse.cs b/petstore/dotnet/PetstoreClient/Models/ApiResponse.cs
new file mode 100644
index 0000000000..72aae602bd
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/ApiResponse.cs
@@ -0,0 +1,55 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class ApiResponse : IParsable {
+ /// The code property
+ public int? Code { get; set; }
+ /// The message property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Message { get; set; }
+#nullable restore
+#else
+ public string Message { get; set; }
+#endif
+ /// The type property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Type { get; set; }
+#nullable restore
+#else
+ public string Type { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static ApiResponse CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new ApiResponse();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"code", n => { Code = n.GetIntValue(); } },
+ {"message", n => { Message = n.GetStringValue(); } },
+ {"type", n => { Type = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteIntValue("code", Code);
+ writer.WriteStringValue("message", Message);
+ writer.WriteStringValue("type", Type);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Category.cs b/petstore/dotnet/PetstoreClient/Models/Category.cs
new file mode 100644
index 0000000000..06016f9000
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Category.cs
@@ -0,0 +1,45 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class Category : IParsable {
+ /// The id property
+ public long? Id { get; set; }
+ /// The name property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Name { get; set; }
+#nullable restore
+#else
+ public string Name { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static Category CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new Category();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"id", n => { Id = n.GetLongValue(); } },
+ {"name", n => { Name = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteLongValue("id", Id);
+ writer.WriteStringValue("name", Name);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Order.cs b/petstore/dotnet/PetstoreClient/Models/Order.cs
new file mode 100644
index 0000000000..1c6ef8f92a
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Order.cs
@@ -0,0 +1,55 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class Order : IParsable {
+ /// The complete property
+ public bool? Complete { get; set; }
+ /// The id property
+ public long? Id { get; set; }
+ /// The petId property
+ public long? PetId { get; set; }
+ /// The quantity property
+ public int? Quantity { get; set; }
+ /// The shipDate property
+ public DateTimeOffset? ShipDate { get; set; }
+ /// Order Status
+ public Order_status? Status { get; set; }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static Order CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new Order();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"complete", n => { Complete = n.GetBoolValue(); } },
+ {"id", n => { Id = n.GetLongValue(); } },
+ {"petId", n => { PetId = n.GetLongValue(); } },
+ {"quantity", n => { Quantity = n.GetIntValue(); } },
+ {"shipDate", n => { ShipDate = n.GetDateTimeOffsetValue(); } },
+ {"status", n => { Status = n.GetEnumValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteBoolValue("complete", Complete);
+ writer.WriteLongValue("id", Id);
+ writer.WriteLongValue("petId", PetId);
+ writer.WriteIntValue("quantity", Quantity);
+ writer.WriteDateTimeOffsetValue("shipDate", ShipDate);
+ writer.WriteEnumValue("status", Status);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Order_status.cs b/petstore/dotnet/PetstoreClient/Models/Order_status.cs
new file mode 100644
index 0000000000..3da67749a2
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Order_status.cs
@@ -0,0 +1,8 @@
+namespace KiotaSamples.PetStoreSdk.Models {
+ /// Order Status
+ public enum Order_status {
+ Placed,
+ Approved,
+ Delivered,
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Pet.cs b/petstore/dotnet/PetstoreClient/Models/Pet.cs
new file mode 100644
index 0000000000..ae427410f8
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Pet.cs
@@ -0,0 +1,79 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class Pet : IParsable {
+ /// The category property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public KiotaSamples.PetStoreSdk.Models.Category? Category { get; set; }
+#nullable restore
+#else
+ public KiotaSamples.PetStoreSdk.Models.Category Category { get; set; }
+#endif
+ /// The id property
+ public long? Id { get; set; }
+ /// The name property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Name { get; set; }
+#nullable restore
+#else
+ public string Name { get; set; }
+#endif
+ /// The photoUrls property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public List? PhotoUrls { get; set; }
+#nullable restore
+#else
+ public List PhotoUrls { get; set; }
+#endif
+ /// pet status in the store
+ public Pet_status? Status { get; set; }
+ /// The tags property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public List? Tags { get; set; }
+#nullable restore
+#else
+ public List Tags { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static Pet CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new Pet();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"category", n => { Category = n.GetObjectValue(KiotaSamples.PetStoreSdk.Models.Category.CreateFromDiscriminatorValue); } },
+ {"id", n => { Id = n.GetLongValue(); } },
+ {"name", n => { Name = n.GetStringValue(); } },
+ {"photoUrls", n => { PhotoUrls = n.GetCollectionOfPrimitiveValues()?.ToList(); } },
+ {"status", n => { Status = n.GetEnumValue(); } },
+ {"tags", n => { Tags = n.GetCollectionOfObjectValues(Tag.CreateFromDiscriminatorValue)?.ToList(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteObjectValue("category", Category);
+ writer.WriteLongValue("id", Id);
+ writer.WriteStringValue("name", Name);
+ writer.WriteCollectionOfPrimitiveValues("photoUrls", PhotoUrls);
+ writer.WriteEnumValue("status", Status);
+ writer.WriteCollectionOfObjectValues("tags", Tags);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Pet_status.cs b/petstore/dotnet/PetstoreClient/Models/Pet_status.cs
new file mode 100644
index 0000000000..fd1fde63fa
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Pet_status.cs
@@ -0,0 +1,8 @@
+namespace KiotaSamples.PetStoreSdk.Models {
+ /// pet status in the store
+ public enum Pet_status {
+ Available,
+ Pending,
+ Sold,
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/Tag.cs b/petstore/dotnet/PetstoreClient/Models/Tag.cs
new file mode 100644
index 0000000000..bff7b640b2
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/Tag.cs
@@ -0,0 +1,45 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class Tag : IParsable {
+ /// The id property
+ public long? Id { get; set; }
+ /// The name property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Name { get; set; }
+#nullable restore
+#else
+ public string Name { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static Tag CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new Tag();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"id", n => { Id = n.GetLongValue(); } },
+ {"name", n => { Name = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteLongValue("id", Id);
+ writer.WriteStringValue("name", Name);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Models/User.cs b/petstore/dotnet/PetstoreClient/Models/User.cs
new file mode 100644
index 0000000000..06b5b972cc
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Models/User.cs
@@ -0,0 +1,99 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Models {
+ public class User : IParsable {
+ /// The email property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Email { get; set; }
+#nullable restore
+#else
+ public string Email { get; set; }
+#endif
+ /// The firstName property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? FirstName { get; set; }
+#nullable restore
+#else
+ public string FirstName { get; set; }
+#endif
+ /// The id property
+ public long? Id { get; set; }
+ /// The lastName property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? LastName { get; set; }
+#nullable restore
+#else
+ public string LastName { get; set; }
+#endif
+ /// The password property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Password { get; set; }
+#nullable restore
+#else
+ public string Password { get; set; }
+#endif
+ /// The phone property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Phone { get; set; }
+#nullable restore
+#else
+ public string Phone { get; set; }
+#endif
+ /// The username property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Username { get; set; }
+#nullable restore
+#else
+ public string Username { get; set; }
+#endif
+ /// User Status
+ public int? UserStatus { get; set; }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static User CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new User();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"email", n => { Email = n.GetStringValue(); } },
+ {"firstName", n => { FirstName = n.GetStringValue(); } },
+ {"id", n => { Id = n.GetLongValue(); } },
+ {"lastName", n => { LastName = n.GetStringValue(); } },
+ {"password", n => { Password = n.GetStringValue(); } },
+ {"phone", n => { Phone = n.GetStringValue(); } },
+ {"username", n => { Username = n.GetStringValue(); } },
+ {"userStatus", n => { UserStatus = n.GetIntValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("email", Email);
+ writer.WriteStringValue("firstName", FirstName);
+ writer.WriteLongValue("id", Id);
+ writer.WriteStringValue("lastName", LastName);
+ writer.WriteStringValue("password", Password);
+ writer.WriteStringValue("phone", Phone);
+ writer.WriteStringValue("username", Username);
+ writer.WriteIntValue("userStatus", UserStatus);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/FindByStatus/FindByStatusRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Pet/FindByStatus/FindByStatusRequestBuilder.cs
new file mode 100644
index 0000000000..ef948e11fc
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/FindByStatus/FindByStatusRequestBuilder.cs
@@ -0,0 +1,122 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Pet.FindByStatus {
+ ///
+ /// Builds and executes requests for operations under \pet\findByStatus
+ ///
+ public class FindByStatusRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new FindByStatusRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FindByStatusRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/findByStatus{?status*}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new FindByStatusRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FindByStatusRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/findByStatus{?status*}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Multiple status values can be provided with comma separated strings
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task?> GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task> GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken);
+ return collectionResult?.ToList();
+ }
+ ///
+ /// Multiple status values can be provided with comma separated strings
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new FindByStatusRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddQueryParameters(requestConfig.QueryParameters);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Multiple status values can be provided with comma separated strings
+ ///
+ public class FindByStatusRequestBuilderGetQueryParameters {
+ /// Status values that need to be considered for filter
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string[]? Status { get; set; }
+#nullable restore
+#else
+ public string[] Status { get; set; }
+#endif
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class FindByStatusRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ /// Request query parameters
+ public FindByStatusRequestBuilderGetQueryParameters QueryParameters { get; set; } = new FindByStatusRequestBuilderGetQueryParameters();
+ ///
+ /// Instantiates a new findByStatusRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public FindByStatusRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/FindByTags/FindByTagsRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Pet/FindByTags/FindByTagsRequestBuilder.cs
new file mode 100644
index 0000000000..4d12b25ab6
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/FindByTags/FindByTagsRequestBuilder.cs
@@ -0,0 +1,122 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Pet.FindByTags {
+ ///
+ /// Builds and executes requests for operations under \pet\findByTags
+ ///
+ public class FindByTagsRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new FindByTagsRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FindByTagsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/findByTags{?tags*}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new FindByTagsRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FindByTagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/findByTags{?tags*}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task?> GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task> GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken);
+ return collectionResult?.ToList();
+ }
+ ///
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new FindByTagsRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddQueryParameters(requestConfig.QueryParameters);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ public class FindByTagsRequestBuilderGetQueryParameters {
+ /// Tags to filter by
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string[]? Tags { get; set; }
+#nullable restore
+#else
+ public string[] Tags { get; set; }
+#endif
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class FindByTagsRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ /// Request query parameters
+ public FindByTagsRequestBuilderGetQueryParameters QueryParameters { get; set; } = new FindByTagsRequestBuilderGetQueryParameters();
+ ///
+ /// Instantiates a new findByTagsRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public FindByTagsRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/Item/UploadImage/UploadImageRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Pet/Item/UploadImage/UploadImageRequestBuilder.cs
new file mode 100644
index 0000000000..f8fc56b7a8
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/Item/UploadImage/UploadImageRequestBuilder.cs
@@ -0,0 +1,107 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Pet.Item.UploadImage {
+ ///
+ /// Builds and executes requests for operations under \pet\{petId}\uploadImage
+ ///
+ public class UploadImageRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new UploadImageRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public UploadImageRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/{petId}/uploadImage";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new UploadImageRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public UploadImageRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/{petId}/uploadImage";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// uploads an image
+ ///
+ /// Binary request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(Stream body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(Stream body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, ApiResponse.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ /// Binary request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(Stream body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(Stream body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ requestInfo.SetStreamContent(body);
+ if (requestConfiguration != null) {
+ var requestConfig = new UploadImageRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class UploadImageRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new uploadImageRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public UploadImageRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/Item/WithPetItemRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Pet/Item/WithPetItemRequestBuilder.cs
new file mode 100644
index 0000000000..9226838789
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/Item/WithPetItemRequestBuilder.cs
@@ -0,0 +1,219 @@
+using KiotaSamples.PetStoreSdk.Models;
+using KiotaSamples.PetStoreSdk.Pet.Item.UploadImage;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Pet.Item {
+ ///
+ /// Builds and executes requests for operations under \pet\{petId}
+ ///
+ public class WithPetItemRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// The uploadImage property
+ public UploadImageRequestBuilder UploadImage { get =>
+ new UploadImageRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new WithPetItemRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public WithPetItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/{petId}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new WithPetItemRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public WithPetItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet/{petId}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Deletes a pet
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToDeleteRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ ///
+ /// Returns a single pet
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.Pet.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(WithPetPostRequestBody body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(WithPetPostRequestBody body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.DELETE,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ if (requestConfiguration != null) {
+ var requestConfig = new WithPetItemRequestBuilderDeleteRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Returns a single pet
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new WithPetItemRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(WithPetPostRequestBody body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(WithPetPostRequestBody body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/x-www-form-urlencoded", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new WithPetItemRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithPetItemRequestBuilderDeleteRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithPetItemRequestBuilderDeleteRequestConfiguration and sets the default values.
+ ///
+ public WithPetItemRequestBuilderDeleteRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithPetItemRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithPetItemRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public WithPetItemRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithPetItemRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithPetItemRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public WithPetItemRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/Item/WithPetPostRequestBody.cs b/petstore/dotnet/PetstoreClient/Pet/Item/WithPetPostRequestBody.cs
new file mode 100644
index 0000000000..9485d69faf
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/Item/WithPetPostRequestBody.cs
@@ -0,0 +1,51 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Pet.Item {
+ public class WithPetPostRequestBody : IParsable {
+ /// Updated name of the pet
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Name { get; set; }
+#nullable restore
+#else
+ public string Name { get; set; }
+#endif
+ /// Updated status of the pet
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Status { get; set; }
+#nullable restore
+#else
+ public string Status { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static WithPetPostRequestBody CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new WithPetPostRequestBody();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ {"name", n => { Name = n.GetStringValue(); } },
+ {"status", n => { Status = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("name", Name);
+ writer.WriteStringValue("status", Status);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Pet/PetRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Pet/PetRequestBuilder.cs
new file mode 100644
index 0000000000..c33e8a7309
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Pet/PetRequestBuilder.cs
@@ -0,0 +1,180 @@
+using KiotaSamples.PetStoreSdk.Models;
+using KiotaSamples.PetStoreSdk.Pet.FindByStatus;
+using KiotaSamples.PetStoreSdk.Pet.FindByTags;
+using KiotaSamples.PetStoreSdk.Pet.Item;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Pet {
+ ///
+ /// Builds and executes requests for operations under \pet
+ ///
+ public class PetRequestBuilder {
+ /// The findByStatus property
+ public FindByStatusRequestBuilder FindByStatus { get =>
+ new FindByStatusRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The findByTags property
+ public FindByTagsRequestBuilder FindByTags { get =>
+ new FindByTagsRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ /// Gets an item from the KiotaSamples.PetStoreSdk.pet.item collection
+ public WithPetItemRequestBuilder this[string position] { get {
+ var urlTplParams = new Dictionary(PathParameters);
+ if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("petId", position);
+ return new WithPetItemRequestBuilder(urlTplParams, RequestAdapter);
+ } }
+ ///
+ /// Instantiates a new PetRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public PetRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new PetRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public PetRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/pet";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Add a new pet to the store
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(KiotaSamples.PetStoreSdk.Models.Pet body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(KiotaSamples.PetStoreSdk.Models.Pet body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ ///
+ /// Update an existing pet
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PutAsync(KiotaSamples.PetStoreSdk.Models.Pet body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PutAsync(KiotaSamples.PetStoreSdk.Models.Pet body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPutRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(KiotaSamples.PetStoreSdk.Models.Pet body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(KiotaSamples.PetStoreSdk.Models.Pet body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new PetRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPutRequestInformation(KiotaSamples.PetStoreSdk.Models.Pet body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPutRequestInformation(KiotaSamples.PetStoreSdk.Models.Pet body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.PUT,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new PetRequestBuilderPutRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class PetRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new petRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public PetRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class PetRequestBuilderPutRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new petRequestBuilderPutRequestConfiguration and sets the default values.
+ ///
+ public PetRequestBuilderPutRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/PetstoreApiClient.cs b/petstore/dotnet/PetstoreClient/PetstoreApiClient.cs
new file mode 100644
index 0000000000..5ca3de0b67
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/PetstoreApiClient.cs
@@ -0,0 +1,58 @@
+using KiotaSamples.PetStoreSdk.Pet;
+using KiotaSamples.PetStoreSdk.Store;
+using KiotaSamples.PetStoreSdk.User;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Serialization.Form;
+using Microsoft.Kiota.Serialization.Json;
+using Microsoft.Kiota.Serialization.Text;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk {
+ ///
+ /// The main entry point of the SDK, exposes the configuration and the fluent API.
+ ///
+ public class PetstoreApiClient {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The pet property
+ public PetRequestBuilder Pet { get =>
+ new PetRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// The store property
+ public StoreRequestBuilder Store { get =>
+ new StoreRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ /// The user property
+ public UserRequestBuilder User { get =>
+ new UserRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new PetstoreApiClient and sets the default values.
+ ///
+ /// The request adapter to use to execute the requests.
+ public PetstoreApiClient(IRequestAdapter requestAdapter) {
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ PathParameters = new Dictionary();
+ UrlTemplate = "{+baseurl}";
+ RequestAdapter = requestAdapter;
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) {
+ RequestAdapter.BaseUrl = "https://petstore.swagger.io/v2";
+ }
+ PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryRequestBuilder.cs
new file mode 100644
index 0000000000..bc0ca05143
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryRequestBuilder.cs
@@ -0,0 +1,104 @@
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Store.Inventory {
+ ///
+ /// Builds and executes requests for operations under \store\inventory
+ ///
+ public class InventoryRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new InventoryRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public InventoryRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/inventory";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new InventoryRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public InventoryRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/inventory";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Returns a map of status codes to quantities
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, InventoryResponse.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ ///
+ /// Returns a map of status codes to quantities
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new InventoryRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class InventoryRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new inventoryRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public InventoryRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryResponse.cs b/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryResponse.cs
new file mode 100644
index 0000000000..b19d75690f
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Store/Inventory/InventoryResponse.cs
@@ -0,0 +1,31 @@
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+namespace KiotaSamples.PetStoreSdk.Store.Inventory {
+ public class InventoryResponse : IParsable {
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// The parse node to use to read the discriminator value and create the object
+ public static InventoryResponse CreateFromDiscriminatorValue(IParseNode parseNode) {
+ _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
+ return new InventoryResponse();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ public IDictionary> GetFieldDeserializers() {
+ return new Dictionary> {
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public void Serialize(ISerializationWriter writer) {
+ _ = writer ?? throw new ArgumentNullException(nameof(writer));
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Store/Order/Item/WithOrderItemRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Store/Order/Item/WithOrderItemRequestBuilder.cs
new file mode 100644
index 0000000000..c71712a04a
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Store/Order/Item/WithOrderItemRequestBuilder.cs
@@ -0,0 +1,160 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Store.Order.Item {
+ ///
+ /// Builds and executes requests for operations under \store\order\{orderId}
+ ///
+ public class WithOrderItemRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new WithOrderItemRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public WithOrderItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/order/{orderId}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new WithOrderItemRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public WithOrderItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/order/{orderId}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToDeleteRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ ///
+ /// For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.Order.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ ///
+ /// For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.DELETE,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ if (requestConfiguration != null) {
+ var requestConfig = new WithOrderItemRequestBuilderDeleteRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new WithOrderItemRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithOrderItemRequestBuilderDeleteRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithOrderItemRequestBuilderDeleteRequestConfiguration and sets the default values.
+ ///
+ public WithOrderItemRequestBuilderDeleteRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithOrderItemRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithOrderItemRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public WithOrderItemRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Store/Order/OrderRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Store/Order/OrderRequestBuilder.cs
new file mode 100644
index 0000000000..d3e1259aef
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Store/Order/OrderRequestBuilder.cs
@@ -0,0 +1,114 @@
+using KiotaSamples.PetStoreSdk.Models;
+using KiotaSamples.PetStoreSdk.Store.Order.Item;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Store.Order {
+ ///
+ /// Builds and executes requests for operations under \store\order
+ ///
+ public class OrderRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ /// Gets an item from the KiotaSamples.PetStoreSdk.store.order.item collection
+ public WithOrderItemRequestBuilder this[string position] { get {
+ var urlTplParams = new Dictionary(PathParameters);
+ if (!string.IsNullOrWhiteSpace(position)) urlTplParams.Add("orderId", position);
+ return new WithOrderItemRequestBuilder(urlTplParams, RequestAdapter);
+ } }
+ ///
+ /// Instantiates a new OrderRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public OrderRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/order";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new OrderRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public OrderRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store/order";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Place an order for a pet
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(KiotaSamples.PetStoreSdk.Models.Order body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(KiotaSamples.PetStoreSdk.Models.Order body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.Order.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(KiotaSamples.PetStoreSdk.Models.Order body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(KiotaSamples.PetStoreSdk.Models.Order body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new OrderRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class OrderRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new orderRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public OrderRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/Store/StoreRequestBuilder.cs b/petstore/dotnet/PetstoreClient/Store/StoreRequestBuilder.cs
new file mode 100644
index 0000000000..eb5426462a
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/Store/StoreRequestBuilder.cs
@@ -0,0 +1,56 @@
+using KiotaSamples.PetStoreSdk.Store.Inventory;
+using KiotaSamples.PetStoreSdk.Store.Order;
+using Microsoft.Kiota.Abstractions;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.Store {
+ ///
+ /// Builds and executes requests for operations under \store
+ ///
+ public class StoreRequestBuilder {
+ /// The inventory property
+ public InventoryRequestBuilder Inventory { get =>
+ new InventoryRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The order property
+ public OrderRequestBuilder Order { get =>
+ new OrderRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new StoreRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public StoreRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new StoreRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public StoreRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/store";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/User/CreateWithArray/CreateWithArrayRequestBuilder.cs b/petstore/dotnet/PetstoreClient/User/CreateWithArray/CreateWithArrayRequestBuilder.cs
new file mode 100644
index 0000000000..4e4daf582d
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/User/CreateWithArray/CreateWithArrayRequestBuilder.cs
@@ -0,0 +1,106 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.User.CreateWithArray {
+ ///
+ /// Builds and executes requests for operations under \user\createWithArray
+ ///
+ public class CreateWithArrayRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new CreateWithArrayRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public CreateWithArrayRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/createWithArray";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new CreateWithArrayRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public CreateWithArrayRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/createWithArray";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(List body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(List body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(List body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(List body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new CreateWithArrayRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class CreateWithArrayRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new createWithArrayRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public CreateWithArrayRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/User/CreateWithList/CreateWithListRequestBuilder.cs b/petstore/dotnet/PetstoreClient/User/CreateWithList/CreateWithListRequestBuilder.cs
new file mode 100644
index 0000000000..60c47f53c1
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/User/CreateWithList/CreateWithListRequestBuilder.cs
@@ -0,0 +1,106 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.User.CreateWithList {
+ ///
+ /// Builds and executes requests for operations under \user\createWithList
+ ///
+ public class CreateWithListRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new CreateWithListRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public CreateWithListRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/createWithList";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new CreateWithListRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public CreateWithListRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/createWithList";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(List body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PostAsync(List body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(List body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(List body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.POST,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new CreateWithListRequestBuilderPostRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class CreateWithListRequestBuilderPostRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new createWithListRequestBuilderPostRequestConfiguration and sets the default values.
+ ///
+ public CreateWithListRequestBuilderPostRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/User/Item/WithUsernameItemRequestBuilder.cs b/petstore/dotnet/PetstoreClient/User/Item/WithUsernameItemRequestBuilder.cs
new file mode 100644
index 0000000000..fb3d6832ef
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/User/Item/WithUsernameItemRequestBuilder.cs
@@ -0,0 +1,217 @@
+using KiotaSamples.PetStoreSdk.Models;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.User.Item {
+ ///
+ /// Builds and executes requests for operations under \user\{username}
+ ///
+ public class WithUsernameItemRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new WithUsernameItemRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public WithUsernameItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/{username}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new WithUsernameItemRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public WithUsernameItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/{username}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// This can only be done by the logged in user.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task DeleteAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task DeleteAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToDeleteRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ ///
+ /// Get user by user name
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task GetAsync(Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, KiotaSamples.PetStoreSdk.Models.User.CreateFromDiscriminatorValue, default, cancellationToken);
+ }
+ ///
+ /// This can only be done by the logged in user.
+ ///
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PutAsync(KiotaSamples.PetStoreSdk.Models.User body, Action? requestConfiguration = default, CancellationToken cancellationToken = default) {
+#nullable restore
+#else
+ public async Task PutAsync(KiotaSamples.PetStoreSdk.Models.User body, Action requestConfiguration = default, CancellationToken cancellationToken = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPutRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken);
+ }
+ ///
+ /// This can only be done by the logged in user.
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToDeleteRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToDeleteRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.DELETE,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ if (requestConfiguration != null) {
+ var requestConfig = new WithUsernameItemRequestBuilderDeleteRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action requestConfiguration = default) {
+#endif
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.GET,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.Headers.Add("Accept", "application/json");
+ if (requestConfiguration != null) {
+ var requestConfig = new WithUsernameItemRequestBuilderGetRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// This can only be done by the logged in user.
+ ///
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPutRequestInformation(KiotaSamples.PetStoreSdk.Models.User body, Action? requestConfiguration = default) {
+#nullable restore
+#else
+ public RequestInformation ToPutRequestInformation(KiotaSamples.PetStoreSdk.Models.User body, Action requestConfiguration = default) {
+#endif
+ _ = body ?? throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation {
+ HttpMethod = Method.PUT,
+ UrlTemplate = UrlTemplate,
+ PathParameters = PathParameters,
+ };
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ if (requestConfiguration != null) {
+ var requestConfig = new WithUsernameItemRequestBuilderPutRequestConfiguration();
+ requestConfiguration.Invoke(requestConfig);
+ requestInfo.AddRequestOptions(requestConfig.Options);
+ requestInfo.AddHeaders(requestConfig.Headers);
+ }
+ return requestInfo;
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithUsernameItemRequestBuilderDeleteRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithUsernameItemRequestBuilderDeleteRequestConfiguration and sets the default values.
+ ///
+ public WithUsernameItemRequestBuilderDeleteRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithUsernameItemRequestBuilderGetRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithUsernameItemRequestBuilderGetRequestConfiguration and sets the default values.
+ ///
+ public WithUsernameItemRequestBuilderGetRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ public class WithUsernameItemRequestBuilderPutRequestConfiguration {
+ /// Request headers
+ public RequestHeaders Headers { get; set; }
+ /// Request options
+ public IList Options { get; set; }
+ ///
+ /// Instantiates a new WithUsernameItemRequestBuilderPutRequestConfiguration and sets the default values.
+ ///
+ public WithUsernameItemRequestBuilderPutRequestConfiguration() {
+ Options = new List();
+ Headers = new RequestHeaders();
+ }
+ }
+ }
+}
diff --git a/petstore/dotnet/PetstoreClient/User/Login/LoginRequestBuilder.cs b/petstore/dotnet/PetstoreClient/User/Login/LoginRequestBuilder.cs
new file mode 100644
index 0000000000..81f8e32c9e
--- /dev/null
+++ b/petstore/dotnet/PetstoreClient/User/Login/LoginRequestBuilder.cs
@@ -0,0 +1,125 @@
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+namespace KiotaSamples.PetStoreSdk.User.Login {
+ ///
+ /// Builds and executes requests for operations under \user\login
+ ///
+ public class LoginRequestBuilder {
+ /// Path parameters for the request
+ private Dictionary PathParameters { get; set; }
+ /// The request adapter to use to execute the requests.
+ private IRequestAdapter RequestAdapter { get; set; }
+ /// Url template to use to build the URL for the current request builder
+ private string UrlTemplate { get; set; }
+ ///
+ /// Instantiates a new LoginRequestBuilder and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public LoginRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) {
+ _ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/login{?username*,password*}";
+ var urlTplParams = new Dictionary(pathParameters);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Instantiates a new LoginRequestBuilder and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public LoginRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
+ if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
+ _ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
+ UrlTemplate = "{+baseurl}/user/login{?username*,password*}";
+ var urlTplParams = new Dictionary();
+ if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
+ PathParameters = urlTplParams;
+ RequestAdapter = requestAdapter;
+ }
+ ///
+ /// Logs user into the system
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action