diff --git a/.gitignore b/.gitignore index 5e57f180..11014f2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,484 +1,484 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from `dotnet new gitignore` - -# dotenv files -.env - -# 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/ -[Ww][Ii][Nn]32/ -[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 -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# 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 -*.tlog -*.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 -coverage*.xml -coverage*.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 6 auto-generated project file (contains which files were open etc.) -*.vbp - -# Visual Studio 6 workspace and project file (working project files containing files to include in project) -*.dsw -*.dsp - -# Visual Studio 6 technical files -*.ncb -*.aps - -# 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/ - -# Visual Studio History (VSHistory) files -.vshistory/ - -# 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/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -*.sln.iml -.idea - -## -## 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 - -# Vim temporary swap files -*.swp +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# 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/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# 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 +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# 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 +*.tlog +*.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 +coverage*.xml +coverage*.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 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# 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/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# 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/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## 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 + +# Vim temporary swap files +*.swp diff --git a/reference.md b/reference.md index d0c9749e..2bd76856 100644 --- a/reference.md +++ b/reference.md @@ -3370,4 +3370,8169 @@ await client.Ats.Offices.RetrieveAsync("id", new OfficesRetrieveRequest()); - \ No newline at end of file + + + +## Ats Passthrough +
client.Ats.Passthrough.CreateAsync(Ats.DataPassthroughRequest { ... }) -> Ats.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Passthrough.CreateAsync( + new Merge.Client.Ats.DataPassthroughRequest + { + Method = Merge.Client.Ats.MethodEnum.Get, + Path = "/scooters", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Ats.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Ats RegenerateKey +
client.Ats.RegenerateKey.CreateAsync(RemoteKeyForRegenerationRequest { ... }) -> Ats.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.RegenerateKey.CreateAsync( + new RemoteKeyForRegenerationRequest { Name = "Remote Deployment Key 1" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoteKeyForRegenerationRequest` + +
+
+
+
+ + +
+
+
+ +## Ats RejectReasons +
client.Ats.RejectReasons.ListAsync(RejectReasonsListRequest { ... }) -> PaginatedRejectReasonList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RejectReason` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.RejectReasons.ListAsync(new RejectReasonsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RejectReasonsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ats.RejectReasons.RetrieveAsync(id, RejectReasonsRetrieveRequest { ... }) -> RejectReason +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `RejectReason` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.RejectReasons.RetrieveAsync("id", new RejectReasonsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `RejectReasonsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Ats Scorecards +
client.Ats.Scorecards.ListAsync(ScorecardsListRequest { ... }) -> PaginatedScorecardList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Scorecard` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Scorecards.ListAsync(new ScorecardsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ScorecardsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Scorecards.RetrieveAsync(id, ScorecardsRetrieveRequest { ... }) -> Scorecard +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Scorecard` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Scorecards.RetrieveAsync("id", new ScorecardsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `ScorecardsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Ats SyncStatus +
client.Ats.SyncStatus.ListAsync(SyncStatusListRequest { ... }) -> Ats.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get syncing status. Possible values: `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.SyncStatus.ListAsync(new SyncStatusListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SyncStatusListRequest` + +
+
+
+
+ + +
+
+
+ +## Ats ForceResync +
client.Ats.ForceResync.SyncStatusResyncCreateAsync() -> IEnumerable +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.ForceResync.SyncStatusResyncCreateAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Ats Tags +
client.Ats.Tags.ListAsync(TagsListRequest { ... }) -> Ats.PaginatedTagList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Tag` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Tags.ListAsync(new TagsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TagsListRequest` + +
+
+
+
+ + +
+
+
+ +## Ats Users +
client.Ats.Users.ListAsync(UsersListRequest { ... }) -> PaginatedRemoteUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteUser` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Users.ListAsync(new UsersListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UsersListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Ats.Users.RetrieveAsync(id, UsersRetrieveRequest { ... }) -> RemoteUser +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `RemoteUser` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.Users.RetrieveAsync("id", new UsersRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `UsersRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Ats WebhookReceivers +
client.Ats.WebhookReceivers.ListAsync() -> IEnumerable +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.WebhookReceivers.ListAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Ats.WebhookReceivers.CreateAsync(WebhookReceiverRequest { ... }) -> Ats.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Ats.WebhookReceivers.CreateAsync( + new WebhookReceiverRequest { Event = "event", IsActive = true } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `WebhookReceiverRequest` + +
+
+
+
+ + +
+
+
+ +## Crm AccountDetails +
client.Crm.AccountDetails.RetrieveAsync() -> Crm.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AccountDetails.RetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Crm AccountToken +
client.Crm.AccountToken.RetrieveAsync(publicToken) -> Crm.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AccountToken.RetrieveAsync("public_token"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm Accounts +
client.Crm.Accounts.ListAsync(AccountsListRequest { ... }) -> Crm.PaginatedAccountList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Account` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.ListAsync(new AccountsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AccountsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.CreateAsync(CrmAccountEndpointRequest { ... }) -> CrmAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Account` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.CreateAsync( + new CrmAccountEndpointRequest { Model = new Merge.Client.Crm.AccountRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CrmAccountEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.RetrieveAsync(id, AccountsRetrieveRequest { ... }) -> Crm.Account +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.RetrieveAsync("id", new AccountsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `AccountsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.PartialUpdateAsync(id, PatchedCrmAccountEndpointRequest { ... }) -> CrmAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Account` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.PartialUpdateAsync( + "id", + new PatchedCrmAccountEndpointRequest { Model = new PatchedAccountRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `PatchedCrmAccountEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.MetaPatchRetrieveAsync(id) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAccount` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.MetaPatchRetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAccount` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Accounts.RemoteFieldClassesListAsync(AccountsRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Accounts.RemoteFieldClassesListAsync(new AccountsRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AccountsRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm AsyncPassthrough +
client.Crm.AsyncPassthrough.CreateAsync(Crm.DataPassthroughRequest { ... }) -> Crm.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AsyncPassthrough.CreateAsync( + new Merge.Client.Crm.DataPassthroughRequest + { + Method = Merge.Client.Crm.MethodEnum.Get, + Path = "/scooters", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Crm.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AsyncPassthrough.RetrieveAsync(asyncPassthroughReceiptId) -> OneOf +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm AuditTrail +
client.Crm.AuditTrail.ListAsync(AuditTrailListRequest { ... }) -> Crm.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AuditTrail.ListAsync(new AuditTrailListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AuditTrailListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm AvailableActions +
client.Crm.AvailableActions.RetrieveAsync() -> Crm.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AvailableActions.RetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Crm Contacts +
client.Crm.Contacts.ListAsync(ContactsListRequest { ... }) -> Crm.PaginatedContactList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Contact` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.ListAsync(new ContactsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ContactsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.CreateAsync(CrmContactEndpointRequest { ... }) -> CrmContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Contact` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.CreateAsync( + new CrmContactEndpointRequest { Model = new Merge.Client.Crm.ContactRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CrmContactEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.RetrieveAsync(id, ContactsRetrieveRequest { ... }) -> Crm.Contact +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.RetrieveAsync("id", new ContactsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `ContactsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.PartialUpdateAsync(id, PatchedCrmContactEndpointRequest { ... }) -> CrmContactResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.PartialUpdateAsync( + "id", + new PatchedCrmContactEndpointRequest { Model = new PatchedContactRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `PatchedCrmContactEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.IgnoreCreateAsync(modelId, IgnoreCommonModelRequest { ... }) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.IgnoreCreateAsync( + "model_id", + new IgnoreCommonModelRequest { Reason = Merge.Client.Crm.ReasonEnum.GeneralCustomerRequest } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.MetaPatchRetrieveAsync(id) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMContact` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.MetaPatchRetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMContact` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Contacts.RemoteFieldClassesListAsync(ContactsRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Contacts.RemoteFieldClassesListAsync(new ContactsRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ContactsRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm CustomObjectClasses +
client.Crm.CustomObjectClasses.ListAsync(CustomObjectClassesListRequest { ... }) -> PaginatedCustomObjectClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CustomObjectClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjectClasses.ListAsync(new CustomObjectClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CustomObjectClassesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjectClasses.RetrieveAsync(id, CustomObjectClassesRetrieveRequest { ... }) -> CustomObjectClass +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CustomObjectClass` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjectClasses.RetrieveAsync("id", new CustomObjectClassesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Crm AssociationTypes +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesListAsync(customObjectClassId, CustomObjectClassesAssociationTypesListRequest { ... }) -> PaginatedAssociationTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `AssociationType` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesListAsync( + "custom_object_class_id", + new CustomObjectClassesAssociationTypesListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesAssociationTypesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesCreateAsync(customObjectClassId, CrmAssociationTypeEndpointRequest { ... }) -> CrmAssociationTypeResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `AssociationType` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesCreateAsync( + "custom_object_class_id", + new CrmAssociationTypeEndpointRequest + { + Model = new AssociationTypeRequestRequest + { + SourceObjectClass = new ObjectClassDescriptionRequest + { + Id = "id", + OriginType = OriginTypeEnum.CustomObject, + }, + TargetObjectClasses = new List() + { + new ObjectClassDescriptionRequest + { + Id = "id", + OriginType = OriginTypeEnum.CustomObject, + }, + }, + RemoteKeyName = "remote_key_name", + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**request:** `CrmAssociationTypeEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesRetrieveAsync(customObjectClassId, id, CustomObjectClassesAssociationTypesRetrieveRequest { ... }) -> AssociationType +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `AssociationType` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesRetrieveAsync( + "custom_object_class_id", + "id", + new CustomObjectClassesAssociationTypesRetrieveRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesAssociationTypesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesMetaPostRetrieveAsync(customObjectClassId) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMAssociationType` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.AssociationTypes.CustomObjectClassesAssociationTypesMetaPostRetrieveAsync( + "custom_object_class_id" +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm CustomObjects +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsListAsync(customObjectClassId, CustomObjectClassesCustomObjectsListRequest { ... }) -> PaginatedCustomObjectList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `CustomObject` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjects.CustomObjectClassesCustomObjectsListAsync( + "custom_object_class_id", + new CustomObjectClassesCustomObjectsListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesCustomObjectsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsCreateAsync(customObjectClassId, CrmCustomObjectEndpointRequest { ... }) -> CrmCustomObjectResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `CustomObject` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjects.CustomObjectClassesCustomObjectsCreateAsync( + "custom_object_class_id", + new CrmCustomObjectEndpointRequest + { + Model = new CustomObjectRequest + { + Fields = new Dictionary() { { "test_field", "hello" } }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**request:** `CrmCustomObjectEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRetrieveAsync(customObjectClassId, id, CustomObjectClassesCustomObjectsRetrieveRequest { ... }) -> CustomObject +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `CustomObject` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRetrieveAsync( + "custom_object_class_id", + "id", + new CustomObjectClassesCustomObjectsRetrieveRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesCustomObjectsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsMetaPostRetrieveAsync(customObjectClassId) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `CRMCustomObject` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjects.CustomObjectClassesCustomObjectsMetaPostRetrieveAsync( + "custom_object_class_id" +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRemoteFieldClassesListAsync(CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.CustomObjects.CustomObjectClassesCustomObjectsRemoteFieldClassesListAsync( + new CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Associations +
client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsListAsync(customObjectClassId, objectId, CustomObjectClassesCustomObjectsAssociationsListRequest { ... }) -> PaginatedAssociationList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Association` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsListAsync( + "custom_object_class_id", + "object_id", + new CustomObjectClassesCustomObjectsAssociationsListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**customObjectClassId:** `string` + +
+
+ +
+
+ +**objectId:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesCustomObjectsAssociationsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsUpdateAsync(associationTypeId, sourceClassId, sourceObjectId, targetClassId, targetObjectId, CustomObjectClassesCustomObjectsAssociationsUpdateRequest { ... }) -> Association +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Associations.CustomObjectClassesCustomObjectsAssociationsUpdateAsync( + "association_type_id", + "source_class_id", + "source_object_id", + "target_class_id", + "target_object_id", + new CustomObjectClassesCustomObjectsAssociationsUpdateRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**associationTypeId:** `string` + +
+
+ +
+
+ +**sourceClassId:** `string` + +
+
+ +
+
+ +**sourceObjectId:** `string` + +
+
+ +
+
+ +**targetClassId:** `string` + +
+
+ +
+
+ +**targetObjectId:** `string` + +
+
+ +
+
+ +**request:** `CustomObjectClassesCustomObjectsAssociationsUpdateRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Scopes +
client.Crm.Scopes.DefaultScopesRetrieveAsync() -> Crm.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Scopes.DefaultScopesRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Scopes.LinkedAccountScopesRetrieveAsync() -> Crm.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Scopes.LinkedAccountScopesRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Scopes.LinkedAccountScopesCreateAsync(LinkedAccountCommonModelScopeDeserializerRequest { ... }) -> Crm.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Scopes.LinkedAccountScopesCreateAsync( + new LinkedAccountCommonModelScopeDeserializerRequest + { + CommonModels = new List() + { + new Merge.Client.Crm.IndividualCommonModelScopeDeserializerRequest + { + ModelName = "Employee", + ModelPermissions = new Dictionary< + string, + Merge.Client.Crm.ModelPermissionDeserializerRequest + >() + { + { + "READ", + new Merge.Client.Crm.ModelPermissionDeserializerRequest { IsEnabled = true } + }, + { + "WRITE", + new Merge.Client.Crm.ModelPermissionDeserializerRequest + { + IsEnabled = false, + } + }, + }, + FieldPermissions = new Merge.Client.Crm.FieldPermissionDeserializerRequest + { + EnabledFields = new List() { "avatar", "home_location" }, + DisabledFields = new List() { "work_location" }, + }, + }, + new Merge.Client.Crm.IndividualCommonModelScopeDeserializerRequest + { + ModelName = "Benefit", + ModelPermissions = new Dictionary< + string, + Merge.Client.Crm.ModelPermissionDeserializerRequest + >() + { + { + "WRITE", + new Merge.Client.Crm.ModelPermissionDeserializerRequest + { + IsEnabled = false, + } + }, + }, + }, + }, + } +); +``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LinkedAccountCommonModelScopeDeserializerRequest` + +
+
+
+
+ + + + + + +## Crm DeleteAccount +
client.Crm.DeleteAccount.DeleteAsync() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.DeleteAccount.DeleteAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Crm EngagementTypes +
client.Crm.EngagementTypes.ListAsync(EngagementTypesListRequest { ... }) -> PaginatedEngagementTypeList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `EngagementType` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.EngagementTypes.ListAsync(new EngagementTypesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EngagementTypesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.EngagementTypes.RetrieveAsync(id, EngagementTypesRetrieveRequest { ... }) -> EngagementType +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `EngagementType` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.EngagementTypes.RetrieveAsync("id", new EngagementTypesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `EngagementTypesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.EngagementTypes.RemoteFieldClassesListAsync(EngagementTypesRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.EngagementTypes.RemoteFieldClassesListAsync( + new EngagementTypesRemoteFieldClassesListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EngagementTypesRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Engagements +
client.Crm.Engagements.ListAsync(EngagementsListRequest { ... }) -> PaginatedEngagementList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Engagement` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.ListAsync(new EngagementsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EngagementsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.CreateAsync(EngagementEndpointRequest { ... }) -> EngagementResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Engagement` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.CreateAsync( + new EngagementEndpointRequest { Model = new EngagementRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EngagementEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.RetrieveAsync(id, EngagementsRetrieveRequest { ... }) -> Engagement +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Engagement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.RetrieveAsync("id", new EngagementsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `EngagementsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.PartialUpdateAsync(id, PatchedEngagementEndpointRequest { ... }) -> EngagementResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Engagement` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.PartialUpdateAsync( + "id", + new PatchedEngagementEndpointRequest { Model = new PatchedEngagementRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `PatchedEngagementEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.MetaPatchRetrieveAsync(id) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Engagement` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.MetaPatchRetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Engagement` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Engagements.RemoteFieldClassesListAsync(EngagementsRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Engagements.RemoteFieldClassesListAsync( + new EngagementsRemoteFieldClassesListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EngagementsRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm FieldMapping +
client.Crm.FieldMapping.FieldMappingsRetrieveAsync(FieldMappingsRetrieveRequest { ... }) -> Crm.FieldMappingApiInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FieldMappingsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.FieldMappingsCreateAsync(CreateFieldMappingRequest { ... }) -> Crm.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.FieldMappingsCreateAsync( + new CreateFieldMappingRequest + { + TargetFieldName = "example_target_field_name", + TargetFieldDescription = "this is a example description of the target field", + RemoteFieldTraversalPath = new List() { "example_remote_field" }, + RemoteMethod = "GET", + RemoteUrlPath = "/example-url-path", + CommonModelName = "ExampleCommonModel", + } +); +``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateFieldMappingRequest` + +
+
+
+
+ + + + + + +
client.Crm.FieldMapping.FieldMappingsDestroyAsync(fieldMappingId) -> Crm.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.FieldMappingsPartialUpdateAsync(fieldMappingId, PatchedEditFieldMappingRequest { ... }) -> Crm.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.FieldMappingsPartialUpdateAsync( + "field_mapping_id", + new PatchedEditFieldMappingRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**request:** `PatchedEditFieldMappingRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.RemoteFieldsRetrieveAsync(RemoteFieldsRetrieveRequest { ... }) -> Crm.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoteFieldsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.FieldMapping.TargetFieldsRetrieveAsync() -> Crm.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.FieldMapping.TargetFieldsRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Crm GenerateKey +
client.Crm.GenerateKey.CreateAsync(GenerateRemoteKeyRequest { ... }) -> Crm.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.GenerateKey.CreateAsync( + new GenerateRemoteKeyRequest { Name = "Remote Deployment Key 1" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GenerateRemoteKeyRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Issues +
client.Crm.Issues.ListAsync(IssuesListRequest { ... }) -> Crm.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Issues.ListAsync(new IssuesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `IssuesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Issues.RetrieveAsync(id) -> Crm.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Issues.RetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Crm Leads +
client.Crm.Leads.ListAsync(LeadsListRequest { ... }) -> PaginatedLeadList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Lead` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Leads.ListAsync(new LeadsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LeadsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.CreateAsync(LeadEndpointRequest { ... }) -> LeadResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Lead` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Leads.CreateAsync(new LeadEndpointRequest { Model = new LeadRequest() }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LeadEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.RetrieveAsync(id, LeadsRetrieveRequest { ... }) -> Lead +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Lead` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Leads.RetrieveAsync("id", new LeadsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `LeadsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Lead` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Leads.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Leads.RemoteFieldClassesListAsync(LeadsRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Leads.RemoteFieldClassesListAsync(new LeadsRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LeadsRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm LinkToken +
client.Crm.LinkToken.CreateAsync(EndUserDetailsRequest { ... }) -> Crm.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.LinkToken.CreateAsync( + new EndUserDetailsRequest + { + EndUserEmailAddress = "example@gmail.com", + EndUserOrganizationName = "Test Organization", + EndUserOriginId = "12345", + Categories = new List() + { + Merge.Client.Crm.CategoriesEnum.Hris, + Merge.Client.Crm.CategoriesEnum.Ats, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EndUserDetailsRequest` + +
+
+
+
+ + +
+
+
+ +## Crm LinkedAccounts +
client.Crm.LinkedAccounts.ListAsync(LinkedAccountsListRequest { ... }) -> Crm.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LinkedAccountsListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Notes +
client.Crm.Notes.ListAsync(NotesListRequest { ... }) -> PaginatedNoteList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Note` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Notes.ListAsync(new NotesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `NotesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.CreateAsync(NoteEndpointRequest { ... }) -> NoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Note` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Notes.CreateAsync(new NoteEndpointRequest { Model = new NoteRequest() }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `NoteEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.RetrieveAsync(id, NotesRetrieveRequest { ... }) -> Note +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Note` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Notes.RetrieveAsync("id", new NotesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `NotesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Note` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Notes.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Notes.RemoteFieldClassesListAsync(NotesRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Notes.RemoteFieldClassesListAsync(new NotesRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `NotesRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Opportunities +
client.Crm.Opportunities.ListAsync(OpportunitiesListRequest { ... }) -> PaginatedOpportunityList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Opportunity` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.ListAsync(new OpportunitiesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `OpportunitiesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.CreateAsync(OpportunityEndpointRequest { ... }) -> OpportunityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Opportunity` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.CreateAsync( + new OpportunityEndpointRequest { Model = new OpportunityRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `OpportunityEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.RetrieveAsync(id, OpportunitiesRetrieveRequest { ... }) -> Opportunity +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.RetrieveAsync("id", new OpportunitiesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `OpportunitiesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.PartialUpdateAsync(id, PatchedOpportunityEndpointRequest { ... }) -> OpportunityResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.PartialUpdateAsync( + "id", + new PatchedOpportunityEndpointRequest { Model = new PatchedOpportunityRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `PatchedOpportunityEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.MetaPatchRetrieveAsync(id) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.MetaPatchRetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Opportunities.RemoteFieldClassesListAsync(OpportunitiesRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Opportunities.RemoteFieldClassesListAsync( + new OpportunitiesRemoteFieldClassesListRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `OpportunitiesRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Passthrough +
client.Crm.Passthrough.CreateAsync(Crm.DataPassthroughRequest { ... }) -> Crm.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Passthrough.CreateAsync( + new Merge.Client.Crm.DataPassthroughRequest + { + Method = Merge.Client.Crm.MethodEnum.Get, + Path = "/scooters", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Crm.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Crm RegenerateKey +
client.Crm.RegenerateKey.CreateAsync(RemoteKeyForRegenerationRequest { ... }) -> Crm.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.RegenerateKey.CreateAsync( + new RemoteKeyForRegenerationRequest { Name = "Remote Deployment Key 1" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoteKeyForRegenerationRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Stages +
client.Crm.Stages.ListAsync(StagesListRequest { ... }) -> PaginatedStageList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Stage` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Stages.ListAsync(new StagesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `StagesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Stages.RetrieveAsync(id, StagesRetrieveRequest { ... }) -> Stage +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Stage` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Stages.RetrieveAsync("id", new StagesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `StagesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Stages.RemoteFieldClassesListAsync(StagesRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Stages.RemoteFieldClassesListAsync(new StagesRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `StagesRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm SyncStatus +
client.Crm.SyncStatus.ListAsync(SyncStatusListRequest { ... }) -> Crm.PaginatedSyncStatusList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get syncing status. Possible values: `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.SyncStatus.ListAsync(new SyncStatusListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SyncStatusListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm ForceResync +
client.Crm.ForceResync.SyncStatusResyncCreateAsync() -> IEnumerable +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.ForceResync.SyncStatusResyncCreateAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Crm Tasks +
client.Crm.Tasks.ListAsync(TasksListRequest { ... }) -> PaginatedTaskList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Task` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.ListAsync(new TasksListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TasksListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.CreateAsync(TaskEndpointRequest { ... }) -> TaskResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Task` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.CreateAsync(new TaskEndpointRequest { Model = new TaskRequest() }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TaskEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.RetrieveAsync(id, TasksRetrieveRequest { ... }) -> Task +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.RetrieveAsync("id", new TasksRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `TasksRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.PartialUpdateAsync(id, PatchedTaskEndpointRequest { ... }) -> TaskResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.PartialUpdateAsync( + "id", + new PatchedTaskEndpointRequest { Model = new PatchedTaskRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `PatchedTaskEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.MetaPatchRetrieveAsync(id) -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.MetaPatchRetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.MetaPostRetrieveAsync() -> Crm.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.Tasks.RemoteFieldClassesListAsync(TasksRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Tasks.RemoteFieldClassesListAsync(new TasksRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TasksRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm Users +
client.Crm.Users.ListAsync(UsersListRequest { ... }) -> Crm.PaginatedUserList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Users.ListAsync(new UsersListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UsersListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.RetrieveAsync(id, UsersRetrieveRequest { ... }) -> Crm.User +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `User` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Users.RetrieveAsync("id", new UsersRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `UsersRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.IgnoreCreateAsync(modelId, IgnoreCommonModelRequest { ... }) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Users.IgnoreCreateAsync( + "model_id", + new IgnoreCommonModelRequest { Reason = Merge.Client.Crm.ReasonEnum.GeneralCustomerRequest } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**modelId:** `string` + +
+
+ +
+
+ +**request:** `IgnoreCommonModelRequest` + +
+
+
+
+ + +
+
+
+ +
client.Crm.Users.RemoteFieldClassesListAsync(UsersRemoteFieldClassesListRequest { ... }) -> Crm.PaginatedRemoteFieldClassList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.Users.RemoteFieldClassesListAsync(new UsersRemoteFieldClassesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UsersRemoteFieldClassesListRequest` + +
+
+
+
+ + +
+
+
+ +## Crm WebhookReceivers +
client.Crm.WebhookReceivers.ListAsync() -> IEnumerable +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.WebhookReceivers.ListAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Crm.WebhookReceivers.CreateAsync(WebhookReceiverRequest { ... }) -> Crm.WebhookReceiver +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `WebhookReceiver` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Crm.WebhookReceivers.CreateAsync( + new WebhookReceiverRequest { Event = "event", IsActive = true } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `WebhookReceiverRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage AccountDetails +
client.Filestorage.AccountDetails.RetrieveAsync() -> Filestorage.AccountDetails +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get details for a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AccountDetails.RetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage AccountToken +
client.Filestorage.AccountToken.RetrieveAsync(publicToken) -> Filestorage.AccountToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the account token for the end user with the provided public token. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AccountToken.RetrieveAsync("public_token"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**publicToken:** `string` + +
+
+
+
+ + +
+
+
+ +## Filestorage AsyncPassthrough +
client.Filestorage.AsyncPassthrough.CreateAsync(Filestorage.DataPassthroughRequest { ... }) -> Filestorage.AsyncPassthroughReciept +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Asynchronously pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AsyncPassthrough.CreateAsync( + new Merge.Client.Filestorage.DataPassthroughRequest + { + Method = Merge.Client.Filestorage.MethodEnum.Get, + Path = "/scooters", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Filestorage.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.AsyncPassthrough.RetrieveAsync(asyncPassthroughReceiptId) -> OneOf +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves data from earlier async-passthrough POST request +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**asyncPassthroughReceiptId:** `string` + +
+
+
+
+ + +
+
+
+ +## Filestorage AuditTrail +
client.Filestorage.AuditTrail.ListAsync(AuditTrailListRequest { ... }) -> Filestorage.PaginatedAuditLogEventList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AuditTrail.ListAsync(new AuditTrailListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AuditTrailListRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage AvailableActions +
client.Filestorage.AvailableActions.RetrieveAsync() -> Filestorage.AvailableActions +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of models and actions available for an account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.AvailableActions.RetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage Scopes +
client.Filestorage.Scopes.DefaultScopesRetrieveAsync() -> Filestorage.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Scopes.DefaultScopesRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Scopes.LinkedAccountScopesRetrieveAsync() -> Filestorage.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Scopes.LinkedAccountScopesRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Scopes.LinkedAccountScopesCreateAsync(LinkedAccountCommonModelScopeDeserializerRequest { ... }) -> Filestorage.CommonModelScopeApi +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Scopes.LinkedAccountScopesCreateAsync( + new LinkedAccountCommonModelScopeDeserializerRequest + { + CommonModels = + new List() + { + new Merge.Client.Filestorage.IndividualCommonModelScopeDeserializerRequest + { + ModelName = "Employee", + ModelPermissions = new Dictionary< + string, + Merge.Client.Filestorage.ModelPermissionDeserializerRequest + >() + { + { + "READ", + new Merge.Client.Filestorage.ModelPermissionDeserializerRequest + { + IsEnabled = true, + } + }, + { + "WRITE", + new Merge.Client.Filestorage.ModelPermissionDeserializerRequest + { + IsEnabled = false, + } + }, + }, + FieldPermissions = + new Merge.Client.Filestorage.FieldPermissionDeserializerRequest + { + EnabledFields = new List() { "avatar", "home_location" }, + DisabledFields = new List() { "work_location" }, + }, + }, + new Merge.Client.Filestorage.IndividualCommonModelScopeDeserializerRequest + { + ModelName = "Benefit", + ModelPermissions = new Dictionary< + string, + Merge.Client.Filestorage.ModelPermissionDeserializerRequest + >() + { + { + "WRITE", + new Merge.Client.Filestorage.ModelPermissionDeserializerRequest + { + IsEnabled = false, + } + }, + }, + }, + }, + } +); +``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LinkedAccountCommonModelScopeDeserializerRequest` + +
+
+
+
+ + + + + + +## Filestorage DeleteAccount +
client.Filestorage.DeleteAccount.DeleteAsync() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a linked account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.DeleteAccount.DeleteAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage Drives +
client.Filestorage.Drives.ListAsync(DrivesListRequest { ... }) -> PaginatedDriveList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Drive` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Drives.ListAsync(new DrivesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DrivesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Drives.RetrieveAsync(id, DrivesRetrieveRequest { ... }) -> Drive +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Drive` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Drives.RetrieveAsync("id", new DrivesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `DrivesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage FieldMapping +
client.Filestorage.FieldMapping.FieldMappingsRetrieveAsync(FieldMappingsRetrieveRequest { ... }) -> Filestorage.FieldMappingApiInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.FieldMappingsRetrieveAsync( + new FieldMappingsRetrieveRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FieldMappingsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.FieldMapping.FieldMappingsCreateAsync(CreateFieldMappingRequest { ... }) -> Filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.FieldMappingsCreateAsync( + new CreateFieldMappingRequest + { + TargetFieldName = "example_target_field_name", + TargetFieldDescription = "this is a example description of the target field", + RemoteFieldTraversalPath = new List() { "example_remote_field" }, + RemoteMethod = "GET", + RemoteUrlPath = "/example-url-path", + CommonModelName = "ExampleCommonModel", + } +); +``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `CreateFieldMappingRequest` + +
+
+
+
+ + + + + + +
client.Filestorage.FieldMapping.FieldMappingsDestroyAsync(fieldMappingId) -> Filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.FieldMapping.FieldMappingsPartialUpdateAsync(fieldMappingId, PatchedEditFieldMappingRequest { ... }) -> Filestorage.FieldMappingInstanceResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.FieldMappingsPartialUpdateAsync( + "field_mapping_id", + new PatchedEditFieldMappingRequest() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**fieldMappingId:** `string` + +
+
+ +
+
+ +**request:** `PatchedEditFieldMappingRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.FieldMapping.RemoteFieldsRetrieveAsync(RemoteFieldsRetrieveRequest { ... }) -> Filestorage.RemoteFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoteFieldsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.FieldMapping.TargetFieldsRetrieveAsync() -> Filestorage.ExternalTargetFieldApiResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.FieldMapping.TargetFieldsRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage Files +
client.Filestorage.Files.ListAsync(FilesListRequest { ... }) -> PaginatedFileList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `File` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Files.ListAsync(new FilesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FilesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Files.CreateAsync(FileStorageFileEndpointRequest { ... }) -> FileStorageFileResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `File` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Files.CreateAsync( + new FileStorageFileEndpointRequest { Model = new FileRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FileStorageFileEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Files.RetrieveAsync(id, FilesRetrieveRequest { ... }) -> File +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `File` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Files.RetrieveAsync("id", new FilesRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `FilesRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Files.DownloadRetrieveAsync(id, FilesDownloadRetrieveRequest { ... }) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the `File` content with the given `id` as a stream of bytes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Files.DownloadRetrieveAsync( + "string", + new FilesDownloadRetrieveRequest { MimeType = "string" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `FilesDownloadRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Files.MetaPostRetrieveAsync() -> Filestorage.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `FileStorageFile` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Files.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage Folders +
client.Filestorage.Folders.ListAsync(FoldersListRequest { ... }) -> PaginatedFolderList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Folder` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Folders.ListAsync(new FoldersListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FoldersListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Folders.CreateAsync(FileStorageFolderEndpointRequest { ... }) -> FileStorageFolderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Folder` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Folders.CreateAsync( + new FileStorageFolderEndpointRequest { Model = new FolderRequest() } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `FileStorageFolderEndpointRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Folders.RetrieveAsync(id, FoldersRetrieveRequest { ... }) -> Folder +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Folder` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Folders.RetrieveAsync("id", new FoldersRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `FoldersRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Folders.MetaPostRetrieveAsync() -> Filestorage.MetaResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `FileStorageFolder` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Folders.MetaPostRetrieveAsync(); +``` +
+
+
+
+ + +
+
+
+ +## Filestorage GenerateKey +
client.Filestorage.GenerateKey.CreateAsync(GenerateRemoteKeyRequest { ... }) -> Filestorage.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.GenerateKey.CreateAsync( + new GenerateRemoteKeyRequest { Name = "Remote Deployment Key 1" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GenerateRemoteKeyRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage Groups +
client.Filestorage.Groups.ListAsync(GroupsListRequest { ... }) -> Filestorage.PaginatedGroupList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Group` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Groups.ListAsync(new GroupsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GroupsListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Groups.RetrieveAsync(id, GroupsRetrieveRequest { ... }) -> Filestorage.Group +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Group` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Groups.RetrieveAsync("id", new GroupsRetrieveRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+ +
+
+ +**request:** `GroupsRetrieveRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage Issues +
client.Filestorage.Issues.ListAsync(IssuesListRequest { ... }) -> Filestorage.PaginatedIssueList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Gets all issues for Organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Issues.ListAsync(new IssuesListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `IssuesListRequest` + +
+
+
+
+ + +
+
+
+ +
client.Filestorage.Issues.RetrieveAsync(id) -> Filestorage.Issue +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a specific issue. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Issues.RetrieveAsync("id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` + +
+
+
+
+ + +
+
+
+ +## Filestorage LinkToken +
client.Filestorage.LinkToken.CreateAsync(EndUserDetailsRequest { ... }) -> Filestorage.LinkToken +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a link token to be used when linking a new end user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.LinkToken.CreateAsync( + new EndUserDetailsRequest + { + EndUserEmailAddress = "example@gmail.com", + EndUserOrganizationName = "Test Organization", + EndUserOriginId = "12345", + Categories = new List() + { + Merge.Client.Filestorage.CategoriesEnum.Hris, + Merge.Client.Filestorage.CategoriesEnum.Ats, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `EndUserDetailsRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage LinkedAccounts +
client.Filestorage.LinkedAccounts.ListAsync(LinkedAccountsListRequest { ... }) -> Filestorage.PaginatedAccountDetailsAndActionsList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `LinkedAccountsListRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage Passthrough +
client.Filestorage.Passthrough.CreateAsync(Filestorage.DataPassthroughRequest { ... }) -> Filestorage.RemoteResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.Passthrough.CreateAsync( + new Merge.Client.Filestorage.DataPassthroughRequest + { + Method = Merge.Client.Filestorage.MethodEnum.Get, + Path = "/scooters", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Filestorage.DataPassthroughRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage RegenerateKey +
client.Filestorage.RegenerateKey.CreateAsync(RemoteKeyForRegenerationRequest { ... }) -> Filestorage.RemoteKey +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Filestorage.RegenerateKey.CreateAsync( + new RemoteKeyForRegenerationRequest { Name = "Remote Deployment Key 1" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RemoteKeyForRegenerationRequest` + +
+
+
+
+ + +
+
+
+ +## Filestorage SyncStatus \ No newline at end of file diff --git a/src/Merge.Client.Test/Core/EnumSerializerTests.cs b/src/Merge.Client.Test/Core/EnumSerializerTests.cs new file mode 100644 index 00000000..71066fe3 --- /dev/null +++ b/src/Merge.Client.Test/Core/EnumSerializerTests.cs @@ -0,0 +1,59 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using Merge.Client.Core; +using NUnit.Framework; + +namespace Merge.Client.Test.Core; + +[TestFixture] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/src/Merge.Client.Test/Core/OneOfSerializerTests.cs b/src/Merge.Client.Test/Core/OneOfSerializerTests.cs new file mode 100644 index 00000000..7bff6992 --- /dev/null +++ b/src/Merge.Client.Test/Core/OneOfSerializerTests.cs @@ -0,0 +1,310 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Merge.Client.Core; +using NUnit.Framework; +using OneOf; + +namespace Merge.Client.Test.Core; + +[TestFixture] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value))); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString)); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That(JsonUtils.Serialize(result.Value), Is.EqualTo(oneOfWithObjectLastString)); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString)); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString) + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/src/Merge.Client.Test/Core/RawClientTests.cs b/src/Merge.Client.Test/Core/RawClientTests.cs index cf369f18..f65ae64f 100644 --- a/src/Merge.Client.Test/Core/RawClientTests.cs +++ b/src/Merge.Client.Test/Core/RawClientTests.cs @@ -1,6 +1,3 @@ -using System; -using System.Net.Http; -using FluentAssertions; using Merge.Client.Core; using NUnit.Framework; using WireMock.Server; @@ -8,106 +5,101 @@ using WireMockRequest = WireMock.RequestBuilders.Request; using WireMockResponse = WireMock.ResponseBuilders.Response; -namespace Merge.Client.Test.Core +namespace Merge.Client.Test.Core; + +[TestFixture] +public class RawClientTests { - [TestFixture] - public class RawClientTests + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() { - private WireMockServer _server; - private HttpClient _httpClient; - private RawClient _rawClient; - private string _baseUrl; - private const int _maxRetries = 3; - - [SetUp] - public void SetUp() - { - _server = WireMockServer.Start(); - _baseUrl = _server.Url ?? ""; - _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; - _rawClient = new RawClient( - new ClientOptions() { HttpClient = _httpClient, MaxRetries = _maxRetries } - ); - } - - [Test] - [TestCase(408)] - [TestCase(429)] - [TestCase(500)] - [TestCase(504)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) - { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Server Error") - .WillSetStateTo("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); - - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WhenStateIs("Success") - .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(200)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Success")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(_maxRetries)); - } - - [Test] - [TestCase(400)] - [TestCase(409)] - public async SystemTask MakeRequestAsync_ShouldRetry_OnNonRetryableStatusCodes( - int statusCode - ) + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } + ); + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask MakeRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new RawClient.BaseApiRequest { - _server - .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) - .InScenario("Retry") - .WillSetStateTo("Server Error") - .RespondWith( - WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure") - ); - - var request = new RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(statusCode)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Failure")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); - } - - [TearDown] - public void TearDown() + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.MakeRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(MaxRetries)); + } + + [Test] + [TestCase(400)] + [TestCase(409)] + public async SystemTask MakeRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); + + var request = new RawClient.BaseApiRequest { - _server.Dispose(); - _httpClient.Dispose(); - } + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.MakeRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(statusCode)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Failure")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); } } diff --git a/src/Merge.Client.Test/Merge.Client.Test.Custom.props b/src/Merge.Client.Test/Merge.Client.Test.Custom.props new file mode 100644 index 00000000..55e683b0 --- /dev/null +++ b/src/Merge.Client.Test/Merge.Client.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/Merge.Client.Test/Merge.Client.Test.csproj b/src/Merge.Client.Test/Merge.Client.Test.csproj index b4bab06c..a0308daa 100644 --- a/src/Merge.Client.Test/Merge.Client.Test.csproj +++ b/src/Merge.Client.Test/Merge.Client.Test.csproj @@ -2,25 +2,37 @@ net8.0 + 12 enable enable - false true + true - - - - - - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - + + \ No newline at end of file diff --git a/src/Merge.Client.Test/TestClient.cs b/src/Merge.Client.Test/TestClient.cs index 80f1e36c..cbaa0525 100644 --- a/src/Merge.Client.Test/TestClient.cs +++ b/src/Merge.Client.Test/TestClient.cs @@ -1,8 +1,6 @@ using NUnit.Framework; -#nullable enable - namespace Merge.Client.Test; [TestFixture] -public class TestClient { } +public class TestClient; diff --git a/src/Merge.Client.sln b/src/Merge.Client.sln index 8cd1a822..c8535a67 100644 --- a/src/Merge.Client.sln +++ b/src/Merge.Client.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client", "Merge.Client\Merge.Client.csproj", "{C1E0DE18-D918-424C-B042-91116EB0FDC3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client", "Merge.Client\Merge.Client.csproj", "{B4C8E526-3750-4397-987D-39CB13E87572}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client.Test", "Merge.Client.Test\Merge.Client.Test.csproj", "{71C77395-C6E2-4283-A545-1EC194300EE7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge.Client.Test", "Merge.Client.Test\Merge.Client.Test.csproj", "{05522DC0-DBF4-4703-984E-24331AAF6D41}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -16,13 +16,13 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C1E0DE18-D918-424C-B042-91116EB0FDC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1E0DE18-D918-424C-B042-91116EB0FDC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1E0DE18-D918-424C-B042-91116EB0FDC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1E0DE18-D918-424C-B042-91116EB0FDC3}.Release|Any CPU.Build.0 = Release|Any CPU - {71C77395-C6E2-4283-A545-1EC194300EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71C77395-C6E2-4283-A545-1EC194300EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71C77395-C6E2-4283-A545-1EC194300EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71C77395-C6E2-4283-A545-1EC194300EE7}.Release|Any CPU.Build.0 = Release|Any CPU + {B4C8E526-3750-4397-987D-39CB13E87572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4C8E526-3750-4397-987D-39CB13E87572}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4C8E526-3750-4397-987D-39CB13E87572}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4C8E526-3750-4397-987D-39CB13E87572}.Release|Any CPU.Build.0 = Release|Any CPU + {05522DC0-DBF4-4703-984E-24331AAF6D41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05522DC0-DBF4-4703-984E-24331AAF6D41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05522DC0-DBF4-4703-984E-24331AAF6D41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05522DC0-DBF4-4703-984E-24331AAF6D41}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs index ba5c5520..c6cd5c39 100644 --- a/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Accounting/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Accounting.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs index 66436c18..e1cd1f61 100644 --- a/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Accounting/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Accounting.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/AccountingClient.cs b/src/Merge.Client/Accounting/AccountingClient.cs index c0d3d33a..d8ad1aa2 100644 --- a/src/Merge.Client/Accounting/AccountingClient.cs +++ b/src/Merge.Client/Accounting/AccountingClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AccountingClient diff --git a/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs b/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs index e0743443..3beb3516 100644 --- a/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs +++ b/src/Merge.Client/Accounting/AccountingPeriods/AccountingPeriodsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AccountingPeriodsClient @@ -24,7 +22,7 @@ internal AccountingPeriodsClient(RawClient client) /// await client.Accounting.AccountingPeriods.ListAsync(new AccountingPeriodsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AccountingPeriodsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,31 +35,33 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/accounting-periods", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/accounting-periods", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -93,7 +93,7 @@ public async Task ListAsync( /// ); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AccountingPeriodsRetrieveRequest request, RequestOptions? options = null, @@ -103,19 +103,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/accounting-periods/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/accounting-periods/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsListRequest.cs b/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsListRequest.cs index 39ab79cf..d982218f 100644 --- a/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsListRequest.cs +++ b/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingPeriodsListRequest diff --git a/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsRetrieveRequest.cs b/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsRetrieveRequest.cs index e1bfa5d9..c597e5a0 100644 --- a/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/AccountingPeriods/Requests/AccountingPeriodsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingPeriodsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Accounts/AccountsClient.cs b/src/Merge.Client/Accounting/Accounts/AccountsClient.cs index 0e5ddd60..58db9b77 100644 --- a/src/Merge.Client/Accounting/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Accounting/Accounts/AccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AccountsClient @@ -24,7 +22,7 @@ internal AccountsClient(RawClient client) /// await client.Accounting.Accounts.ListAsync(new AccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,15 +57,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +81,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( AccountEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,25 +147,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/accounts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/accounts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +197,7 @@ public async Task CreateAsync( /// await client.Accounting.Accounts.RetrieveAsync("id", new AccountsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AccountsRetrieveRequest request, RequestOptions? options = null, @@ -208,7 +211,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -218,17 +221,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/accounts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/accounts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -257,21 +262,23 @@ public async Task RetrieveAsync( /// await client.Accounting.Accounts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/accounts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/accounts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Accounts/Requests/AccountEndpointRequest.cs b/src/Merge.Client/Accounting/Accounts/Requests/AccountEndpointRequest.cs index 86305fd6..27290725 100644 --- a/src/Merge.Client/Accounting/Accounts/Requests/AccountEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Accounts/Requests/AccountEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountEndpointRequest diff --git a/src/Merge.Client/Accounting/Accounts/Requests/AccountsListRequest.cs b/src/Merge.Client/Accounting/Accounts/Requests/AccountsListRequest.cs index f22e79a3..55f250af 100644 --- a/src/Merge.Client/Accounting/Accounts/Requests/AccountsListRequest.cs +++ b/src/Merge.Client/Accounting/Accounts/Requests/AccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountsListRequest diff --git a/src/Merge.Client/Accounting/Accounts/Requests/AccountsRetrieveRequest.cs b/src/Merge.Client/Accounting/Accounts/Requests/AccountsRetrieveRequest.cs index 5d3a3e31..f044a15f 100644 --- a/src/Merge.Client/Accounting/Accounts/Requests/AccountsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Accounts/Requests/AccountsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestRemoteFields.cs b/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestRemoteFields.cs index d98e8b45..f986be8d 100644 --- a/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestRemoteFields.cs +++ b/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountsListRequestRemoteFields { [EnumMember(Value = "classification")] diff --git a/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestShowEnumOrigins.cs b/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestShowEnumOrigins.cs index cc2ec19e..48e101e3 100644 --- a/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Accounting/Accounts/Types/AccountsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountsListRequestShowEnumOrigins { [EnumMember(Value = "classification")] diff --git a/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestRemoteFields.cs index e7324b91..2d60de93 100644 --- a/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountsRetrieveRequestRemoteFields { [EnumMember(Value = "classification")] diff --git a/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestShowEnumOrigins.cs index b9e7202f..904c610f 100644 --- a/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Accounting/Accounts/Types/AccountsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "classification")] diff --git a/src/Merge.Client/Accounting/Addresses/AddressesClient.cs b/src/Merge.Client/Accounting/Addresses/AddressesClient.cs index 1c2bf0fa..c9cfb8ac 100644 --- a/src/Merge.Client/Accounting/Addresses/AddressesClient.cs +++ b/src/Merge.Client/Accounting/Addresses/AddressesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AddressesClient @@ -24,7 +22,7 @@ internal AddressesClient(RawClient client) /// await client.Accounting.Addresses.RetrieveAsync("id", new AddressesRetrieveRequest()); /// /// - public async Task
RetrieveAsync( + public async System.Threading.Tasks.Task
RetrieveAsync( string id, AddressesRetrieveRequest request, RequestOptions? options = null, @@ -34,7 +32,7 @@ public async Task
RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -44,17 +42,19 @@ public async Task
RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/addresses/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/addresses/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Addresses/Requests/AddressesRetrieveRequest.cs b/src/Merge.Client/Accounting/Addresses/Requests/AddressesRetrieveRequest.cs index 17dcf907..38a47b27 100644 --- a/src/Merge.Client/Accounting/Addresses/Requests/AddressesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Addresses/Requests/AddressesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AddressesRetrieveRequest diff --git a/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs index 446db1f5..a2cde885 100644 --- a/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Accounting/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Accounting.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/AsyncTasks/AsyncTasksClient.cs b/src/Merge.Client/Accounting/AsyncTasks/AsyncTasksClient.cs index 257927f9..367f6774 100644 --- a/src/Merge.Client/Accounting/AsyncTasks/AsyncTasksClient.cs +++ b/src/Merge.Client/Accounting/AsyncTasks/AsyncTasksClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AsyncTasksClient @@ -24,22 +22,24 @@ internal AsyncTasksClient(RawClient client) /// await client.Accounting.AsyncTasks.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/async-tasks/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/async-tasks/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs b/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs index 5298ec50..5701feb2 100644 --- a/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Accounting/Attachments/AttachmentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AttachmentsClient @@ -24,7 +22,7 @@ internal AttachmentsClient(RawClient client) /// await client.Accounting.Attachments.ListAsync(new AttachmentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AttachmentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/attachments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/attachments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -122,7 +122,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( AccountingAttachmentEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -131,25 +131,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/attachments", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/attachments", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -178,7 +181,7 @@ public async Task CreateAsync( /// await client.Accounting.Attachments.RetrieveAsync("id", new AttachmentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AttachmentsRetrieveRequest request, RequestOptions? options = null, @@ -188,19 +191,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/attachments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/attachments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -229,21 +234,23 @@ public async Task RetrieveAsync( /// await client.Accounting.Attachments.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/attachments/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/attachments/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Attachments/Requests/AccountingAttachmentEndpointRequest.cs b/src/Merge.Client/Accounting/Attachments/Requests/AccountingAttachmentEndpointRequest.cs index 6daa8e7a..2535c457 100644 --- a/src/Merge.Client/Accounting/Attachments/Requests/AccountingAttachmentEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Attachments/Requests/AccountingAttachmentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingAttachmentEndpointRequest diff --git a/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsListRequest.cs b/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsListRequest.cs index afc4fff7..5f88a575 100644 --- a/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsListRequest.cs +++ b/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AttachmentsListRequest diff --git a/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsRetrieveRequest.cs b/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsRetrieveRequest.cs index 5b4d0c74..11c9307e 100644 --- a/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Attachments/Requests/AttachmentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AttachmentsRetrieveRequest diff --git a/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs index e5fb7388..0f947620 100644 --- a/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Accounting/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Accounting.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Accounting/AuditTrail/Requests/AuditTrailListRequest.cs index abd216e0..39cae663 100644 --- a/src/Merge.Client/Accounting/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Accounting/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AuditTrailListRequest diff --git a/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs index 37a4c6b9..95322274 100644 --- a/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Accounting/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Accounting.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs b/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs index 4e68986e..25316188 100644 --- a/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs +++ b/src/Merge.Client/Accounting/BalanceSheets/BalanceSheetsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class BalanceSheetsClient @@ -24,7 +22,7 @@ internal BalanceSheetsClient(RawClient client) /// await client.Accounting.BalanceSheets.ListAsync(new BalanceSheetsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( BalanceSheetsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/balance-sheets", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/balance-sheets", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Accounting.BalanceSheets.RetrieveAsync("id", new BalanceSheetsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, BalanceSheetsRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/balance-sheets/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/balance-sheets/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsListRequest.cs b/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsListRequest.cs index 412f095d..c52a8ed5 100644 --- a/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsListRequest.cs +++ b/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BalanceSheetsListRequest diff --git a/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsRetrieveRequest.cs b/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsRetrieveRequest.cs index 333a7774..e014f9a2 100644 --- a/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/BalanceSheets/Requests/BalanceSheetsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BalanceSheetsRetrieveRequest diff --git a/src/Merge.Client/Accounting/BankFeedAccounts/BankFeedAccountsClient.cs b/src/Merge.Client/Accounting/BankFeedAccounts/BankFeedAccountsClient.cs index 9ba163df..cf2876c0 100644 --- a/src/Merge.Client/Accounting/BankFeedAccounts/BankFeedAccountsClient.cs +++ b/src/Merge.Client/Accounting/BankFeedAccounts/BankFeedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class BankFeedAccountsClient @@ -24,7 +22,7 @@ internal BankFeedAccountsClient(RawClient client) /// await client.Accounting.BankFeedAccounts.ListAsync(new BankFeedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( BankFeedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,31 +35,33 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/bank-feed-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/bank-feed-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -92,7 +92,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( BankFeedAccountEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -101,25 +101,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/bank-feed-accounts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/bank-feed-accounts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -148,7 +151,7 @@ public async Task CreateAsync( /// await client.Accounting.BankFeedAccounts.RetrieveAsync("id", new BankFeedAccountsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, BankFeedAccountsRetrieveRequest request, RequestOptions? options = null, @@ -158,19 +161,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/bank-feed-accounts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/bank-feed-accounts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -199,21 +204,23 @@ public async Task RetrieveAsync( /// await client.Accounting.BankFeedAccounts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/bank-feed-accounts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/bank-feed-accounts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountEndpointRequest.cs b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountEndpointRequest.cs index 538cccc9..00be1aa7 100644 --- a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountEndpointRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccountEndpointRequest diff --git a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsListRequest.cs b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsListRequest.cs index 5e189270..a1e4323f 100644 --- a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsListRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccountsListRequest diff --git a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsRetrieveRequest.cs b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsRetrieveRequest.cs index db056409..95cabd74 100644 --- a/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedAccounts/Requests/BankFeedAccountsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccountsRetrieveRequest diff --git a/src/Merge.Client/Accounting/BankFeedTransactions/BankFeedTransactionsClient.cs b/src/Merge.Client/Accounting/BankFeedTransactions/BankFeedTransactionsClient.cs index be424b8f..a9a54d3d 100644 --- a/src/Merge.Client/Accounting/BankFeedTransactions/BankFeedTransactionsClient.cs +++ b/src/Merge.Client/Accounting/BankFeedTransactions/BankFeedTransactionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class BankFeedTransactionsClient @@ -24,7 +22,7 @@ internal BankFeedTransactionsClient(RawClient client) /// await client.Accounting.BankFeedTransactions.ListAsync(new BankFeedTransactionsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( BankFeedTransactionsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,19 +49,19 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsProcessed != null) { - _query["is_processed"] = request.IsProcessed.ToString(); + _query["is_processed"] = JsonUtils.Serialize(request.IsProcessed.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/bank-feed-transactions", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/bank-feed-transactions", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -126,7 +126,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( BankFeedTransactionEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -135,25 +135,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/bank-feed-transactions", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/bank-feed-transactions", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -185,7 +188,7 @@ public async Task CreateAsync( /// ); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, BankFeedTransactionsRetrieveRequest request, RequestOptions? options = null, @@ -199,19 +202,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/bank-feed-transactions/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/bank-feed-transactions/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -240,21 +245,23 @@ public async Task RetrieveAsync( /// await client.Accounting.BankFeedTransactions.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/bank-feed-transactions/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/bank-feed-transactions/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionEndpointRequest.cs b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionEndpointRequest.cs index 9ef75861..732d5f54 100644 --- a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionEndpointRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransactionEndpointRequest diff --git a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsListRequest.cs b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsListRequest.cs index 6b92a907..64015df1 100644 --- a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsListRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransactionsListRequest diff --git a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsRetrieveRequest.cs b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsRetrieveRequest.cs index 2f36d716..ab912749 100644 --- a/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/BankFeedTransactions/Requests/BankFeedTransactionsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransactionsRetrieveRequest diff --git a/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs b/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs index 7407d97b..90c74589 100644 --- a/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs +++ b/src/Merge.Client/Accounting/CashFlowStatements/CashFlowStatementsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class CashFlowStatementsClient @@ -24,7 +22,7 @@ internal CashFlowStatementsClient(RawClient client) /// await client.Accounting.CashFlowStatements.ListAsync(new CashFlowStatementsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CashFlowStatementsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/cash-flow-statements", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/cash-flow-statements", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -127,7 +127,7 @@ public async Task ListAsync( /// ); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CashFlowStatementsRetrieveRequest request, RequestOptions? options = null, @@ -141,19 +141,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/cash-flow-statements/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/cash-flow-statements/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsListRequest.cs b/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsListRequest.cs index 76163c73..1e352e45 100644 --- a/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsListRequest.cs +++ b/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CashFlowStatementsListRequest diff --git a/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsRetrieveRequest.cs b/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsRetrieveRequest.cs index 94e2f6f2..520101d1 100644 --- a/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/CashFlowStatements/Requests/CashFlowStatementsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CashFlowStatementsRetrieveRequest diff --git a/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs b/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs index b127fa16..fc271dbf 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/CompanyInfoClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class CompanyInfoClient @@ -24,7 +22,7 @@ internal CompanyInfoClient(RawClient client) /// await client.Accounting.CompanyInfo.ListAsync(new CompanyInfoListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CompanyInfoListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/company-info", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/company-info", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +120,7 @@ public async Task ListAsync( /// await client.Accounting.CompanyInfo.RetrieveAsync("id", new CompanyInfoRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CompanyInfoRetrieveRequest request, RequestOptions? options = null, @@ -134,19 +134,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/company-info/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/company-info/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoListRequest.cs b/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoListRequest.cs index 65736585..0e2117f6 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoListRequest.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CompanyInfoListRequest diff --git a/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoRetrieveRequest.cs b/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoRetrieveRequest.cs index d81879c1..5737aa39 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/Requests/CompanyInfoRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CompanyInfoRetrieveRequest diff --git a/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoListRequestExpand.cs b/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoListRequestExpand.cs index 80bcf510..4932bc2b 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoListRequestExpand.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CompanyInfoListRequestExpand { [EnumMember(Value = "addresses")] diff --git a/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoRetrieveRequestExpand.cs index 35f6bb4a..c27d30e5 100644 --- a/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/CompanyInfo/Types/CompanyInfoRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CompanyInfoRetrieveRequestExpand { [EnumMember(Value = "addresses")] diff --git a/src/Merge.Client/Accounting/Contacts/ContactsClient.cs b/src/Merge.Client/Accounting/Contacts/ContactsClient.cs index 1e77d9e9..d2668875 100644 --- a/src/Merge.Client/Accounting/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Accounting/Contacts/ContactsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class ContactsClient @@ -24,7 +22,7 @@ internal ContactsClient(RawClient client) /// await client.Accounting.Contacts.ListAsync(new ContactsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ContactsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,19 +57,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCustomer != null) { @@ -99,7 +99,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -113,17 +113,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/contacts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/contacts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -154,7 +156,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( ContactEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -163,25 +165,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/contacts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/contacts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -210,7 +215,7 @@ public async Task CreateAsync( /// await client.Accounting.Contacts.RetrieveAsync("id", new ContactsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ContactsRetrieveRequest request, RequestOptions? options = null, @@ -224,11 +229,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.RemoteFields != null) { @@ -238,17 +245,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/contacts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/contacts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -277,21 +286,23 @@ public async Task RetrieveAsync( /// await client.Accounting.Contacts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/contacts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/contacts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -322,7 +333,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( ContactsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -335,35 +346,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/contacts/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/contacts/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Contacts/Requests/ContactEndpointRequest.cs b/src/Merge.Client/Accounting/Contacts/Requests/ContactEndpointRequest.cs index 2777fc18..d0a4c987 100644 --- a/src/Merge.Client/Accounting/Contacts/Requests/ContactEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Contacts/Requests/ContactEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ContactEndpointRequest diff --git a/src/Merge.Client/Accounting/Contacts/Requests/ContactsListRequest.cs b/src/Merge.Client/Accounting/Contacts/Requests/ContactsListRequest.cs index c7ac58b2..2dea66a1 100644 --- a/src/Merge.Client/Accounting/Contacts/Requests/ContactsListRequest.cs +++ b/src/Merge.Client/Accounting/Contacts/Requests/ContactsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ContactsListRequest diff --git a/src/Merge.Client/Accounting/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs index 18536cf4..09f023f4 100644 --- a/src/Merge.Client/Accounting/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ContactsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Contacts/Requests/ContactsRetrieveRequest.cs b/src/Merge.Client/Accounting/Contacts/Requests/ContactsRetrieveRequest.cs index eba46ca3..b1bd8bcf 100644 --- a/src/Merge.Client/Accounting/Contacts/Requests/ContactsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Contacts/Requests/ContactsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ContactsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Contacts/Types/ContactsListRequestExpand.cs b/src/Merge.Client/Accounting/Contacts/Types/ContactsListRequestExpand.cs index caecf6a4..fae4e3cf 100644 --- a/src/Merge.Client/Accounting/Contacts/Types/ContactsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Contacts/Types/ContactsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ContactsListRequestExpand { [EnumMember(Value = "addresses")] diff --git a/src/Merge.Client/Accounting/Contacts/Types/ContactsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Contacts/Types/ContactsRetrieveRequestExpand.cs index 205e70b6..cb2cf93c 100644 --- a/src/Merge.Client/Accounting/Contacts/Types/ContactsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Contacts/Types/ContactsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ContactsRetrieveRequestExpand { [EnumMember(Value = "addresses")] diff --git a/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs b/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs index c82b950a..d6675301 100644 --- a/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs +++ b/src/Merge.Client/Accounting/CreditNotes/CreditNotesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class CreditNotesClient @@ -24,7 +22,7 @@ internal CreditNotesClient(RawClient client) /// await client.Accounting.CreditNotes.ListAsync(new CreditNotesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CreditNotesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -105,17 +103,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/credit-notes", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/credit-notes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -146,7 +146,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( CreditNoteEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -155,25 +155,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/credit-notes", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/credit-notes", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -202,7 +205,7 @@ public async Task CreateAsync( /// await client.Accounting.CreditNotes.RetrieveAsync("id", new CreditNotesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CreditNotesRetrieveRequest request, RequestOptions? options = null, @@ -216,7 +219,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -226,17 +229,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/credit-notes/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/credit-notes/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -265,21 +270,23 @@ public async Task RetrieveAsync( /// await client.Accounting.CreditNotes.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/credit-notes/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/credit-notes/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNoteEndpointRequest.cs b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNoteEndpointRequest.cs index 3619f74e..ad1fd8c2 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNoteEndpointRequest.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNoteEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteEndpointRequest diff --git a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesListRequest.cs b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesListRequest.cs index 6604653d..99492fde 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesListRequest.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNotesListRequest diff --git a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesRetrieveRequest.cs b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesRetrieveRequest.cs index 32598b57..6a3bb6c6 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Requests/CreditNotesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNotesRetrieveRequest diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestExpand.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestExpand.cs index ea61052c..cf7c40fb 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestExpand.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestRemoteFields.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestRemoteFields.cs index 5fa69b23..989ad8c0 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestRemoteFields.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesListRequestRemoteFields { [EnumMember(Value = "status")] diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestShowEnumOrigins.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestShowEnumOrigins.cs index 2c3daf33..79a0d000 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesListRequestShowEnumOrigins { [EnumMember(Value = "status")] diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestExpand.cs index a1418629..19397fe6 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestRemoteFields.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestRemoteFields.cs index 85856759..7602451d 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesRetrieveRequestRemoteFields { [EnumMember(Value = "status")] diff --git a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestShowEnumOrigins.cs index 35a4d72d..4875d246 100644 --- a/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Accounting/CreditNotes/Types/CreditNotesRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNotesRetrieveRequestShowEnumOrigins { [EnumMember(Value = "status")] diff --git a/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs index 75559a6d..76483b9f 100644 --- a/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Accounting/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Accounting/Employees/EmployeesClient.cs b/src/Merge.Client/Accounting/Employees/EmployeesClient.cs index a85700a8..e0602e70 100644 --- a/src/Merge.Client/Accounting/Employees/EmployeesClient.cs +++ b/src/Merge.Client/Accounting/Employees/EmployeesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class EmployeesClient @@ -24,7 +22,7 @@ internal EmployeesClient(RawClient client) /// await client.Accounting.Employees.ListAsync(new EmployeesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EmployeesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -41,31 +39,33 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/employees", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/employees", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -94,7 +94,7 @@ public async Task ListAsync( /// await client.Accounting.Employees.RetrieveAsync("id", new EmployeesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EmployeesRetrieveRequest request, RequestOptions? options = null, @@ -108,19 +108,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/employees/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/employees/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Employees/Requests/EmployeesListRequest.cs b/src/Merge.Client/Accounting/Employees/Requests/EmployeesListRequest.cs index 1cfdb05b..27824461 100644 --- a/src/Merge.Client/Accounting/Employees/Requests/EmployeesListRequest.cs +++ b/src/Merge.Client/Accounting/Employees/Requests/EmployeesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record EmployeesListRequest diff --git a/src/Merge.Client/Accounting/Employees/Requests/EmployeesRetrieveRequest.cs b/src/Merge.Client/Accounting/Employees/Requests/EmployeesRetrieveRequest.cs index bd329f7a..4c865932 100644 --- a/src/Merge.Client/Accounting/Employees/Requests/EmployeesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Employees/Requests/EmployeesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record EmployeesRetrieveRequest diff --git a/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs b/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs index ded8711c..9990b86a 100644 --- a/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs +++ b/src/Merge.Client/Accounting/Expenses/ExpensesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class ExpensesClient @@ -24,7 +22,7 @@ internal ExpensesClient(RawClient client) /// await client.Accounting.Expenses.ListAsync(new ExpensesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ExpensesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,19 +53,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -101,17 +101,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/expenses", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/expenses", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -142,7 +144,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( ExpenseEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -151,25 +153,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/expenses", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/expenses", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -198,7 +203,7 @@ public async Task CreateAsync( /// await client.Accounting.Expenses.RetrieveAsync("id", new ExpensesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ExpensesRetrieveRequest request, RequestOptions? options = null, @@ -212,23 +217,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/expenses/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/expenses/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -259,7 +268,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task LinesRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task LinesRemoteFieldClassesListAsync( ExpensesLinesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -272,35 +281,37 @@ public async Task LinesRemoteFieldClassesListAsyn } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/expenses/lines/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/expenses/lines/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -329,21 +340,23 @@ public async Task LinesRemoteFieldClassesListAsyn /// await client.Accounting.Expenses.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/expenses/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/expenses/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -374,7 +387,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( ExpensesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -387,35 +400,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/expenses/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/expenses/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Expenses/Requests/ExpenseEndpointRequest.cs b/src/Merge.Client/Accounting/Expenses/Requests/ExpenseEndpointRequest.cs index 559ce15f..55d5e0ac 100644 --- a/src/Merge.Client/Accounting/Expenses/Requests/ExpenseEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Expenses/Requests/ExpenseEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpenseEndpointRequest diff --git a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesLinesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesLinesRemoteFieldClassesListRequest.cs index 92e213cf..0cb48243 100644 --- a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesLinesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesLinesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpensesLinesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesListRequest.cs b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesListRequest.cs index e080e086..430354f0 100644 --- a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesListRequest.cs +++ b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpensesListRequest diff --git a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRemoteFieldClassesListRequest.cs index 6e169749..51ce424e 100644 --- a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpensesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRetrieveRequest.cs b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRetrieveRequest.cs index e67e3a64..fd65a785 100644 --- a/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Expenses/Requests/ExpensesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpensesRetrieveRequest diff --git a/src/Merge.Client/Accounting/Expenses/Types/ExpensesListRequestExpand.cs b/src/Merge.Client/Accounting/Expenses/Types/ExpensesListRequestExpand.cs index ff0ad367..e99ddaa9 100644 --- a/src/Merge.Client/Accounting/Expenses/Types/ExpensesListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Expenses/Types/ExpensesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ExpensesListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/Expenses/Types/ExpensesRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Expenses/Types/ExpensesRetrieveRequestExpand.cs index 5b3467b8..a9d72bb2 100644 --- a/src/Merge.Client/Accounting/Expenses/Types/ExpensesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Expenses/Types/ExpensesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ExpensesRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs index 06a323a5..2b83cf55 100644 --- a/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Accounting/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class FieldMappingClient @@ -24,7 +22,7 @@ internal FieldMappingClient(RawClient client) /// await client.Accounting.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -33,19 +31,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,7 +78,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -84,7 +86,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -93,7 +95,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -104,18 +108,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,22 +151,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Accounting.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"accounting/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"accounting/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,24 +200,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"accounting/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"accounting/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -237,7 +249,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Accounting.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -252,17 +264,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -291,21 +305,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Accounting.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Accounting/FieldMapping/Requests/CreateFieldMappingRequest.cs index c089c4b8..7f41be9e 100644 --- a/src/Merge.Client/Accounting/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Accounting/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Accounting/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Accounting/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index a27fc3a9..d46c88f0 100644 --- a/src/Merge.Client/Accounting/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Accounting/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Accounting/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index b5fe7d48..e54a7ad6 100644 --- a/src/Merge.Client/Accounting/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Accounting/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Accounting/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Accounting/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index 471c0bf4..13b7504f 100644 --- a/src/Merge.Client/Accounting/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs index 3021652c..9590d641 100644 --- a/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Accounting/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Accounting.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/GeneralLedgerTransactions/GeneralLedgerTransactionsClient.cs b/src/Merge.Client/Accounting/GeneralLedgerTransactions/GeneralLedgerTransactionsClient.cs index 170848f3..9e0170de 100644 --- a/src/Merge.Client/Accounting/GeneralLedgerTransactions/GeneralLedgerTransactionsClient.cs +++ b/src/Merge.Client/Accounting/GeneralLedgerTransactions/GeneralLedgerTransactionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class GeneralLedgerTransactionsClient @@ -26,7 +24,7 @@ internal GeneralLedgerTransactionsClient(RawClient client) /// ); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( GeneralLedgerTransactionsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -57,15 +55,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -81,7 +79,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PostedDateAfter != null) { @@ -99,17 +97,19 @@ public async Task ListAsync( { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/general-ledger-transactions", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/general-ledger-transactions", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -141,7 +141,7 @@ public async Task ListAsync( /// ); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, GeneralLedgerTransactionsRetrieveRequest request, RequestOptions? options = null, @@ -155,19 +155,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/general-ledger-transactions/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/general-ledger-transactions/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsListRequest.cs b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsListRequest.cs index 9224d16a..27e3e8e7 100644 --- a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsListRequest.cs +++ b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record GeneralLedgerTransactionsListRequest diff --git a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsRetrieveRequest.cs b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsRetrieveRequest.cs index 6cc045b5..20c7665e 100644 --- a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Requests/GeneralLedgerTransactionsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record GeneralLedgerTransactionsRetrieveRequest diff --git a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsListRequestExpand.cs b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsListRequestExpand.cs index 0bd70d54..a0aca289 100644 --- a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum GeneralLedgerTransactionsListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsRetrieveRequestExpand.cs index 0a3a58d6..fcb3a8a3 100644 --- a/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/GeneralLedgerTransactions/Types/GeneralLedgerTransactionsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum GeneralLedgerTransactionsRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs index 208dda35..e725776a 100644 --- a/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Accounting/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Accounting/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index 43884731..ebddafb9 100644 --- a/src/Merge.Client/Accounting/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Accounting/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs b/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs index 3acb91da..fa53deaa 100644 --- a/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs +++ b/src/Merge.Client/Accounting/IncomeStatements/IncomeStatementsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class IncomeStatementsClient @@ -24,7 +22,7 @@ internal IncomeStatementsClient(RawClient client) /// await client.Accounting.IncomeStatements.ListAsync(new IncomeStatementsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IncomeStatementsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/income-statements", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/income-statements", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Accounting.IncomeStatements.RetrieveAsync("id", new IncomeStatementsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, IncomeStatementsRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/income-statements/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/income-statements/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsListRequest.cs b/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsListRequest.cs index 5151cfff..d1c9f327 100644 --- a/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsListRequest.cs +++ b/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record IncomeStatementsListRequest diff --git a/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsRetrieveRequest.cs b/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsRetrieveRequest.cs index 878f5e8e..2bae25f9 100644 --- a/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/IncomeStatements/Requests/IncomeStatementsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record IncomeStatementsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs b/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs index b2e62a6d..d098e29f 100644 --- a/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs +++ b/src/Merge.Client/Accounting/Invoices/InvoicesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class InvoicesClient @@ -24,7 +22,7 @@ internal InvoicesClient(RawClient client) /// await client.Accounting.Invoices.ListAsync(new InvoicesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( InvoicesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,19 +57,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IssueDateAfter != null) { @@ -103,7 +103,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -125,17 +125,19 @@ public async Task ListAsync( { _query["type"] = request.Type.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/invoices", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/invoices", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -167,7 +169,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( InvoiceEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -176,25 +178,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/invoices", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/invoices", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -223,7 +228,7 @@ public async Task CreateAsync( /// await client.Accounting.Invoices.RetrieveAsync("id", new InvoicesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, InvoicesRetrieveRequest request, RequestOptions? options = null, @@ -237,11 +242,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.RemoteFields != null) { @@ -251,17 +258,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/invoices/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/invoices/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -293,7 +302,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedInvoiceEndpointRequest request, RequestOptions? options = null, @@ -303,25 +312,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"accounting/v1/invoices/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"accounting/v1/invoices/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -352,7 +364,7 @@ public async Task PartialUpdateAsync( /// ); /// /// - public async Task LineItemsRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task LineItemsRemoteFieldClassesListAsync( InvoicesLineItemsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -365,35 +377,37 @@ public async Task LineItemsRemoteFieldClassesList } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/invoices/line-items/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/invoices/line-items/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -422,22 +436,24 @@ public async Task LineItemsRemoteFieldClassesList /// await client.Accounting.Invoices.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/invoices/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/invoices/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -466,21 +482,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Accounting.Invoices.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/invoices/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/invoices/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -511,7 +529,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( InvoicesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -524,35 +542,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/invoices/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/invoices/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Invoices/Requests/InvoiceEndpointRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/InvoiceEndpointRequest.cs index fa6b13cf..b99589c7 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/InvoiceEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/InvoiceEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoiceEndpointRequest diff --git a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesLineItemsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesLineItemsRemoteFieldClassesListRequest.cs index 03de77f0..a12b83c9 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesLineItemsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesLineItemsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoicesLineItemsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesListRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesListRequest.cs index 0af6ce03..d6679e0a 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesListRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoicesListRequest diff --git a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRemoteFieldClassesListRequest.cs index 472b4468..a7df6910 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoicesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRetrieveRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRetrieveRequest.cs index 97c071ed..23739b6a 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/InvoicesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoicesRetrieveRequest diff --git a/src/Merge.Client/Accounting/Invoices/Requests/PatchedInvoiceEndpointRequest.cs b/src/Merge.Client/Accounting/Invoices/Requests/PatchedInvoiceEndpointRequest.cs index ce6ee212..3f4ff040 100644 --- a/src/Merge.Client/Accounting/Invoices/Requests/PatchedInvoiceEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Invoices/Requests/PatchedInvoiceEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PatchedInvoiceEndpointRequest diff --git a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestExpand.cs b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestExpand.cs index 59d60dc6..47a596b3 100644 --- a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoicesListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestStatus.cs b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestStatus.cs index d97251a0..ec10bbf3 100644 --- a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestStatus.cs +++ b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoicesListRequestStatus { [EnumMember(Value = "DRAFT")] diff --git a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestType.cs b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestType.cs index 12fd2368..5da4a4ce 100644 --- a/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestType.cs +++ b/src/Merge.Client/Accounting/Invoices/Types/InvoicesListRequestType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoicesListRequestType { [EnumMember(Value = "ACCOUNTS_PAYABLE")] diff --git a/src/Merge.Client/Accounting/Invoices/Types/InvoicesRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Invoices/Types/InvoicesRetrieveRequestExpand.cs index 5bba1c60..af3cba0a 100644 --- a/src/Merge.Client/Accounting/Invoices/Types/InvoicesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Invoices/Types/InvoicesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoicesRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/Issues/IssuesClient.cs b/src/Merge.Client/Accounting/Issues/IssuesClient.cs index d38eb4cc..3d5dccf9 100644 --- a/src/Merge.Client/Accounting/Issues/IssuesClient.cs +++ b/src/Merge.Client/Accounting/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Accounting.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Accounting.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Accounting/Issues/Requests/IssuesListRequest.cs index de01753d..ec9c076e 100644 --- a/src/Merge.Client/Accounting/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Accounting/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record IssuesListRequest diff --git a/src/Merge.Client/Accounting/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Accounting/Issues/Types/IssuesListRequestStatus.cs index 83ed28d5..76970b96 100644 --- a/src/Merge.Client/Accounting/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Accounting/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Accounting/Items/ItemsClient.cs b/src/Merge.Client/Accounting/Items/ItemsClient.cs index 024febfe..6b473a3c 100644 --- a/src/Merge.Client/Accounting/Items/ItemsClient.cs +++ b/src/Merge.Client/Accounting/Items/ItemsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class ItemsClient @@ -24,7 +22,7 @@ internal ItemsClient(RawClient client) /// await client.Accounting.Items.ListAsync(new ItemsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ItemsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/items", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/items", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -132,7 +132,7 @@ public async Task ListAsync( /// await client.Accounting.Items.RetrieveAsync("id", new ItemsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ItemsRetrieveRequest request, RequestOptions? options = null, @@ -146,7 +146,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -156,17 +156,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/items/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/items/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Items/Requests/ItemsListRequest.cs b/src/Merge.Client/Accounting/Items/Requests/ItemsListRequest.cs index 2f607361..e4036baa 100644 --- a/src/Merge.Client/Accounting/Items/Requests/ItemsListRequest.cs +++ b/src/Merge.Client/Accounting/Items/Requests/ItemsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ItemsListRequest diff --git a/src/Merge.Client/Accounting/Items/Requests/ItemsRetrieveRequest.cs b/src/Merge.Client/Accounting/Items/Requests/ItemsRetrieveRequest.cs index b97b466e..24d60e7b 100644 --- a/src/Merge.Client/Accounting/Items/Requests/ItemsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Items/Requests/ItemsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ItemsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Items/Types/ItemsListRequestExpand.cs b/src/Merge.Client/Accounting/Items/Types/ItemsListRequestExpand.cs index 5287dcef..e3873223 100644 --- a/src/Merge.Client/Accounting/Items/Types/ItemsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Items/Types/ItemsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemsListRequestExpand { [EnumMember(Value = "company")] diff --git a/src/Merge.Client/Accounting/Items/Types/ItemsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Items/Types/ItemsRetrieveRequestExpand.cs index 685492b8..1a480573 100644 --- a/src/Merge.Client/Accounting/Items/Types/ItemsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Items/Types/ItemsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemsRetrieveRequestExpand { [EnumMember(Value = "company")] diff --git a/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs b/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs index c8ed0daf..1ceb2615 100644 --- a/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs +++ b/src/Merge.Client/Accounting/JournalEntries/JournalEntriesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class JournalEntriesClient @@ -24,7 +22,7 @@ internal JournalEntriesClient(RawClient client) /// await client.Accounting.JournalEntries.ListAsync(new JournalEntriesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( JournalEntriesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,19 +53,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -101,17 +101,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/journal-entries", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/journal-entries", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -142,7 +144,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( JournalEntryEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -151,25 +153,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/journal-entries", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/journal-entries", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -198,7 +203,7 @@ public async Task CreateAsync( /// await client.Accounting.JournalEntries.RetrieveAsync("id", new JournalEntriesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, JournalEntriesRetrieveRequest request, RequestOptions? options = null, @@ -212,23 +217,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/journal-entries/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/journal-entries/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -259,7 +268,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task LinesRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task LinesRemoteFieldClassesListAsync( JournalEntriesLinesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -272,35 +281,37 @@ public async Task LinesRemoteFieldClassesListAsyn } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/journal-entries/lines/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/journal-entries/lines/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -329,21 +340,23 @@ public async Task LinesRemoteFieldClassesListAsyn /// await client.Accounting.JournalEntries.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/journal-entries/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/journal-entries/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -374,7 +387,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( JournalEntriesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -387,35 +400,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/journal-entries/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/journal-entries/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesLinesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesLinesRemoteFieldClassesListRequest.cs index 7f5a7e22..4317ddde 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesLinesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesLinesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntriesLinesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesListRequest.cs b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesListRequest.cs index 067269c9..700a5b8d 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesListRequest.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntriesListRequest diff --git a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRemoteFieldClassesListRequest.cs index 5a12016c..0d1b1b13 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntriesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRetrieveRequest.cs b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRetrieveRequest.cs index c504ed4a..4a950ea5 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntriesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntriesRetrieveRequest diff --git a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntryEndpointRequest.cs b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntryEndpointRequest.cs index 8d1eba14..0c60ffcf 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntryEndpointRequest.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Requests/JournalEntryEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntryEndpointRequest diff --git a/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesListRequestExpand.cs b/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesListRequestExpand.cs index e25e8436..fbc7af78 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesListRequestExpand.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JournalEntriesListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesRetrieveRequestExpand.cs index 8f3bfd0d..0c45cf59 100644 --- a/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/JournalEntries/Types/JournalEntriesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JournalEntriesRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs index 14c07418..dd511c4e 100644 --- a/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Accounting/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Accounting.CategoriesEnum>() /// { /// Merge.Client.Accounting.CategoriesEnum.Hris, /// Merge.Client.Accounting.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Accounting/LinkToken/Requests/EndUserDetailsRequest.cs index c36533b2..afe6b30a 100644 --- a/src/Merge.Client/Accounting/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Accounting/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs index 8df56c36..6b889602 100644 --- a/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Accounting/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Accounting.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Accounting/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index 9e00569b..fe08ddeb 100644 --- a/src/Merge.Client/Accounting/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Accounting/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Accounting/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Accounting/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index d061d6db..648c2935 100644 --- a/src/Merge.Client/Accounting/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Accounting/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs b/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs index 5657ad37..5af47b7a 100644 --- a/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Accounting/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Payments/PaymentsClient.cs b/src/Merge.Client/Accounting/Payments/PaymentsClient.cs index 4b92b382..9b5070b7 100644 --- a/src/Merge.Client/Accounting/Payments/PaymentsClient.cs +++ b/src/Merge.Client/Accounting/Payments/PaymentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class PaymentsClient @@ -24,7 +22,7 @@ internal PaymentsClient(RawClient client) /// await client.Accounting.Payments.ListAsync(new PaymentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( PaymentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,19 +61,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -91,7 +91,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -109,17 +109,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/payments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/payments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -150,7 +152,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( PaymentEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -159,25 +161,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/payments", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/payments", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -206,7 +211,7 @@ public async Task CreateAsync( /// await client.Accounting.Payments.RetrieveAsync("id", new PaymentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, PaymentsRetrieveRequest request, RequestOptions? options = null, @@ -220,23 +225,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/payments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/payments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -268,7 +277,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedPaymentEndpointRequest request, RequestOptions? options = null, @@ -278,25 +287,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"accounting/v1/payments/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"accounting/v1/payments/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -327,7 +339,7 @@ public async Task PartialUpdateAsync( /// ); /// /// - public async Task LineItemsRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task LineItemsRemoteFieldClassesListAsync( PaymentsLineItemsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -340,35 +352,37 @@ public async Task LineItemsRemoteFieldClassesList } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/payments/line-items/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/payments/line-items/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -397,22 +411,24 @@ public async Task LineItemsRemoteFieldClassesList /// await client.Accounting.Payments.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/payments/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/payments/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -441,21 +457,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Accounting.Payments.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/payments/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/payments/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -486,7 +504,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( PaymentsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -499,35 +517,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/payments/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/payments/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Payments/Requests/PatchedPaymentEndpointRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PatchedPaymentEndpointRequest.cs index e5f986c4..6d93ec28 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PatchedPaymentEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PatchedPaymentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PatchedPaymentEndpointRequest diff --git a/src/Merge.Client/Accounting/Payments/Requests/PaymentEndpointRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PaymentEndpointRequest.cs index 9d0dacf0..e93a4299 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PaymentEndpointRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PaymentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentEndpointRequest diff --git a/src/Merge.Client/Accounting/Payments/Requests/PaymentsLineItemsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PaymentsLineItemsRemoteFieldClassesListRequest.cs index 80956343..86b189f7 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PaymentsLineItemsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PaymentsLineItemsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentsLineItemsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Payments/Requests/PaymentsListRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PaymentsListRequest.cs index 0a74f341..eeae3a67 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PaymentsListRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PaymentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentsListRequest diff --git a/src/Merge.Client/Accounting/Payments/Requests/PaymentsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PaymentsRemoteFieldClassesListRequest.cs index efa9df19..6a5d42cc 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PaymentsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PaymentsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/Payments/Requests/PaymentsRetrieveRequest.cs b/src/Merge.Client/Accounting/Payments/Requests/PaymentsRetrieveRequest.cs index 0831ab37..c254e824 100644 --- a/src/Merge.Client/Accounting/Payments/Requests/PaymentsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Payments/Requests/PaymentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Payments/Types/PaymentsListRequestExpand.cs b/src/Merge.Client/Accounting/Payments/Types/PaymentsListRequestExpand.cs index 78212e40..cba5ae63 100644 --- a/src/Merge.Client/Accounting/Payments/Types/PaymentsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Payments/Types/PaymentsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PaymentsListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/Payments/Types/PaymentsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Payments/Types/PaymentsRetrieveRequestExpand.cs index 89c78944..c650b0bd 100644 --- a/src/Merge.Client/Accounting/Payments/Types/PaymentsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Payments/Types/PaymentsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PaymentsRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs b/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs index 24f17328..4b8f8247 100644 --- a/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs +++ b/src/Merge.Client/Accounting/PhoneNumbers/PhoneNumbersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class PhoneNumbersClient @@ -24,7 +22,7 @@ internal PhoneNumbersClient(RawClient client) /// await client.Accounting.PhoneNumbers.RetrieveAsync("id", new PhoneNumbersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, PhoneNumbersRetrieveRequest request, RequestOptions? options = null, @@ -34,19 +32,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/phone-numbers/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/phone-numbers/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/PhoneNumbers/Requests/PhoneNumbersRetrieveRequest.cs b/src/Merge.Client/Accounting/PhoneNumbers/Requests/PhoneNumbersRetrieveRequest.cs index 9640a453..bd7ac339 100644 --- a/src/Merge.Client/Accounting/PhoneNumbers/Requests/PhoneNumbersRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/PhoneNumbers/Requests/PhoneNumbersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PhoneNumbersRetrieveRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs b/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs index c2ca3b1d..e56378a6 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/PurchaseOrdersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class PurchaseOrdersClient @@ -24,7 +22,7 @@ internal PurchaseOrdersClient(RawClient client) /// await client.Accounting.PurchaseOrders.ListAsync(new PurchaseOrdersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( PurchaseOrdersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,19 +53,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IssueDateAfter != null) { @@ -95,7 +95,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -109,17 +109,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/purchase-orders", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/purchase-orders", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -150,7 +152,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( PurchaseOrderEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -159,25 +161,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/purchase-orders", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/purchase-orders", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -206,7 +211,7 @@ public async Task CreateAsync( /// await client.Accounting.PurchaseOrders.RetrieveAsync("id", new PurchaseOrdersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, PurchaseOrdersRetrieveRequest request, RequestOptions? options = null, @@ -220,11 +225,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.RemoteFields != null) { @@ -234,17 +241,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/purchase-orders/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/purchase-orders/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -275,7 +284,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task LineItemsRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task LineItemsRemoteFieldClassesListAsync( PurchaseOrdersLineItemsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -288,35 +297,37 @@ public async Task LineItemsRemoteFieldClassesList } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/purchase-orders/line-items/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/purchase-orders/line-items/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -345,21 +356,23 @@ public async Task LineItemsRemoteFieldClassesList /// await client.Accounting.PurchaseOrders.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/purchase-orders/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/purchase-orders/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -390,7 +403,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( PurchaseOrdersRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -403,35 +416,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/purchase-orders/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/purchase-orders/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrderEndpointRequest.cs b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrderEndpointRequest.cs index ce3c5371..3d1291c1 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrderEndpointRequest.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrderEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrderEndpointRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.cs index a169039e..74ac27cc 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrdersLineItemsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersListRequest.cs b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersListRequest.cs index 48988896..f7de18c3 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersListRequest.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrdersListRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRemoteFieldClassesListRequest.cs b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRemoteFieldClassesListRequest.cs index 428feb2b..2f2f1bc1 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrdersRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRetrieveRequest.cs b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRetrieveRequest.cs index 22f50f0b..26c96be2 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Requests/PurchaseOrdersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrdersRetrieveRequest diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersListRequestExpand.cs b/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersListRequestExpand.cs index 26b5b55f..5d7cb3f4 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersListRequestExpand.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PurchaseOrdersListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersRetrieveRequestExpand.cs index 7b65f3de..5fcf8efd 100644 --- a/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/PurchaseOrders/Types/PurchaseOrdersRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PurchaseOrdersRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs index aa842c40..cae141d4 100644 --- a/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Accounting/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Accounting/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index baf80808..87801d9e 100644 --- a/src/Merge.Client/Accounting/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Accounting/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Accounting/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Accounting/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index 9d688ae9..637d361e 100644 --- a/src/Merge.Client/Accounting/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Accounting/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Accounting/Scopes/ScopesClient.cs b/src/Merge.Client/Accounting/Scopes/ScopesClient.cs index 2b21fbd8..357937f2 100644 --- a/src/Merge.Client/Accounting/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Accounting/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Accounting.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Accounting.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -111,15 +113,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { /// CommonModels = - /// new List() + /// new List<Merge.Client.Accounting.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Accounting.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Accounting.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -139,17 +141,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// FieldPermissions = /// new Merge.Client.Accounting.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Accounting.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Accounting.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -165,23 +167,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Accounting/SyncStatus/Requests/SyncStatusListRequest.cs index 4f797c69..31428e6b 100644 --- a/src/Merge.Client/Accounting/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Accounting/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record SyncStatusListRequest diff --git a/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs index fe6dd439..296bf46e 100644 --- a/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Accounting/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Accounting.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesListRequest.cs b/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesListRequest.cs index 89b1363f..b4870244 100644 --- a/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesListRequest.cs +++ b/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TaxRatesListRequest diff --git a/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesRetrieveRequest.cs b/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesRetrieveRequest.cs index 42911051..c8b31357 100644 --- a/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/TaxRates/Requests/TaxRatesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TaxRatesRetrieveRequest diff --git a/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs b/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs index 63c0961c..e2c59e50 100644 --- a/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs +++ b/src/Merge.Client/Accounting/TaxRates/TaxRatesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class TaxRatesClient @@ -24,7 +22,7 @@ internal TaxRatesClient(RawClient client) /// await client.Accounting.TaxRates.ListAsync(new TaxRatesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TaxRatesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/tax-rates", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/tax-rates", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Accounting.TaxRates.RetrieveAsync("id", new TaxRatesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TaxRatesRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/tax-rates/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/tax-rates/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesListRequest.cs b/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesListRequest.cs index 620af718..e844ce43 100644 --- a/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesListRequest.cs +++ b/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TrackingCategoriesListRequest diff --git a/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesRetrieveRequest.cs b/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesRetrieveRequest.cs index e7662096..937e6a00 100644 --- a/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/TrackingCategories/Requests/TrackingCategoriesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TrackingCategoriesRetrieveRequest diff --git a/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs b/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs index 390eac0e..203183fc 100644 --- a/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs +++ b/src/Merge.Client/Accounting/TrackingCategories/TrackingCategoriesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class TrackingCategoriesClient @@ -24,7 +22,7 @@ internal TrackingCategoriesClient(RawClient client) /// await client.Accounting.TrackingCategories.ListAsync(new TrackingCategoriesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TrackingCategoriesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/tracking-categories", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/tracking-categories", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -135,7 +135,7 @@ public async Task ListAsync( /// ); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TrackingCategoriesRetrieveRequest request, RequestOptions? options = null, @@ -149,7 +149,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -159,17 +159,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/tracking-categories/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/tracking-categories/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Transactions/Requests/TransactionsListRequest.cs b/src/Merge.Client/Accounting/Transactions/Requests/TransactionsListRequest.cs index cc4e3ff8..075b6273 100644 --- a/src/Merge.Client/Accounting/Transactions/Requests/TransactionsListRequest.cs +++ b/src/Merge.Client/Accounting/Transactions/Requests/TransactionsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TransactionsListRequest diff --git a/src/Merge.Client/Accounting/Transactions/Requests/TransactionsRetrieveRequest.cs b/src/Merge.Client/Accounting/Transactions/Requests/TransactionsRetrieveRequest.cs index d0ccca10..1a6bf579 100644 --- a/src/Merge.Client/Accounting/Transactions/Requests/TransactionsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/Transactions/Requests/TransactionsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TransactionsRetrieveRequest diff --git a/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs b/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs index d2567d7e..1887a262 100644 --- a/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs +++ b/src/Merge.Client/Accounting/Transactions/TransactionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class TransactionsClient @@ -24,7 +22,7 @@ internal TransactionsClient(RawClient client) /// await client.Accounting.Transactions.ListAsync(new TransactionsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TransactionsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/transactions", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/transactions", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Accounting.Transactions.RetrieveAsync("id", new TransactionsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TransactionsRetrieveRequest request, RequestOptions? options = null, @@ -150,19 +150,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/transactions/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/transactions/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/Transactions/Types/TransactionsListRequestExpand.cs b/src/Merge.Client/Accounting/Transactions/Types/TransactionsListRequestExpand.cs index 286e20ce..ff2ed18d 100644 --- a/src/Merge.Client/Accounting/Transactions/Types/TransactionsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/Transactions/Types/TransactionsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TransactionsListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/Transactions/Types/TransactionsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/Transactions/Types/TransactionsRetrieveRequestExpand.cs index 25dce5df..a6488e7c 100644 --- a/src/Merge.Client/Accounting/Transactions/Types/TransactionsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/Transactions/Types/TransactionsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TransactionsRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Accounting/Types/Account.cs b/src/Merge.Client/Accounting/Types/Account.cs index 29d3901c..cfef94c8 100644 --- a/src/Merge.Client/Accounting/Types/Account.cs +++ b/src/Merge.Client/Accounting/Types/Account.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record Account diff --git a/src/Merge.Client/Accounting/Types/AccountAccountTypeEnum.cs b/src/Merge.Client/Accounting/Types/AccountAccountTypeEnum.cs index 0a7cc32b..f9736709 100644 --- a/src/Merge.Client/Accounting/Types/AccountAccountTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/AccountAccountTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountAccountTypeEnum { [EnumMember(Value = "BANK")] diff --git a/src/Merge.Client/Accounting/Types/AccountDetails.cs b/src/Merge.Client/Accounting/Types/AccountDetails.cs index 83fddc24..fd063456 100644 --- a/src/Merge.Client/Accounting/Types/AccountDetails.cs +++ b/src/Merge.Client/Accounting/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountDetails diff --git a/src/Merge.Client/Accounting/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Accounting/Types/AccountDetailsAndActions.cs index 363e4755..af1b7fd1 100644 --- a/src/Merge.Client/Accounting/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Accounting/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsIntegration.cs index 62b9acd8..6607a7d8 100644 --- a/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsStatusEnum.cs index 872963ad..4f5c8509 100644 --- a/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Accounting/Types/AccountIntegration.cs b/src/Merge.Client/Accounting/Types/AccountIntegration.cs index a8695882..2f638298 100644 --- a/src/Merge.Client/Accounting/Types/AccountIntegration.cs +++ b/src/Merge.Client/Accounting/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Accounting/Types/AccountRequest.cs b/src/Merge.Client/Accounting/Types/AccountRequest.cs index d827b57b..6c8591d4 100644 --- a/src/Merge.Client/Accounting/Types/AccountRequest.cs +++ b/src/Merge.Client/Accounting/Types/AccountRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountRequest diff --git a/src/Merge.Client/Accounting/Types/AccountResponse.cs b/src/Merge.Client/Accounting/Types/AccountResponse.cs index fe938bf3..edbbed3e 100644 --- a/src/Merge.Client/Accounting/Types/AccountResponse.cs +++ b/src/Merge.Client/Accounting/Types/AccountResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountResponse diff --git a/src/Merge.Client/Accounting/Types/AccountStatusEnum.cs b/src/Merge.Client/Accounting/Types/AccountStatusEnum.cs index afb829a9..7bf96f25 100644 --- a/src/Merge.Client/Accounting/Types/AccountStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/AccountStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountStatusEnum { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Accounting/Types/AccountToken.cs b/src/Merge.Client/Accounting/Types/AccountToken.cs index b4c626e1..9ab5a20f 100644 --- a/src/Merge.Client/Accounting/Types/AccountToken.cs +++ b/src/Merge.Client/Accounting/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountToken diff --git a/src/Merge.Client/Accounting/Types/AccountingAttachment.cs b/src/Merge.Client/Accounting/Types/AccountingAttachment.cs index 306f063f..2fb8a4f9 100644 --- a/src/Merge.Client/Accounting/Types/AccountingAttachment.cs +++ b/src/Merge.Client/Accounting/Types/AccountingAttachment.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingAttachment diff --git a/src/Merge.Client/Accounting/Types/AccountingAttachmentRequest.cs b/src/Merge.Client/Accounting/Types/AccountingAttachmentRequest.cs index 313bb47a..c976a2a8 100644 --- a/src/Merge.Client/Accounting/Types/AccountingAttachmentRequest.cs +++ b/src/Merge.Client/Accounting/Types/AccountingAttachmentRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingAttachmentRequest diff --git a/src/Merge.Client/Accounting/Types/AccountingAttachmentResponse.cs b/src/Merge.Client/Accounting/Types/AccountingAttachmentResponse.cs index 1c86cd16..301441cf 100644 --- a/src/Merge.Client/Accounting/Types/AccountingAttachmentResponse.cs +++ b/src/Merge.Client/Accounting/Types/AccountingAttachmentResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingAttachmentResponse diff --git a/src/Merge.Client/Accounting/Types/AccountingPeriod.cs b/src/Merge.Client/Accounting/Types/AccountingPeriod.cs index f63fd5a6..e7c059ab 100644 --- a/src/Merge.Client/Accounting/Types/AccountingPeriod.cs +++ b/src/Merge.Client/Accounting/Types/AccountingPeriod.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingPeriod diff --git a/src/Merge.Client/Accounting/Types/AccountingPhoneNumber.cs b/src/Merge.Client/Accounting/Types/AccountingPhoneNumber.cs index a18030d8..19a315d5 100644 --- a/src/Merge.Client/Accounting/Types/AccountingPhoneNumber.cs +++ b/src/Merge.Client/Accounting/Types/AccountingPhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingPhoneNumber diff --git a/src/Merge.Client/Accounting/Types/AccountingPhoneNumberRequest.cs b/src/Merge.Client/Accounting/Types/AccountingPhoneNumberRequest.cs index 950f2284..cb151b31 100644 --- a/src/Merge.Client/Accounting/Types/AccountingPhoneNumberRequest.cs +++ b/src/Merge.Client/Accounting/Types/AccountingPhoneNumberRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AccountingPhoneNumberRequest diff --git a/src/Merge.Client/Accounting/Types/Address.cs b/src/Merge.Client/Accounting/Types/Address.cs index 6eaaa546..79d172b3 100644 --- a/src/Merge.Client/Accounting/Types/Address.cs +++ b/src/Merge.Client/Accounting/Types/Address.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record Address diff --git a/src/Merge.Client/Accounting/Types/AddressRequest.cs b/src/Merge.Client/Accounting/Types/AddressRequest.cs index 9f41a51e..b919a657 100644 --- a/src/Merge.Client/Accounting/Types/AddressRequest.cs +++ b/src/Merge.Client/Accounting/Types/AddressRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AddressRequest diff --git a/src/Merge.Client/Accounting/Types/AddressTypeEnum.cs b/src/Merge.Client/Accounting/Types/AddressTypeEnum.cs index 75b8a1a0..7dc3f1d3 100644 --- a/src/Merge.Client/Accounting/Types/AddressTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/AddressTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AddressTypeEnum { [EnumMember(Value = "BILLING")] diff --git a/src/Merge.Client/Accounting/Types/AdvancedMetadata.cs b/src/Merge.Client/Accounting/Types/AdvancedMetadata.cs index 53403d6c..e2bcf1ec 100644 --- a/src/Merge.Client/Accounting/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Accounting/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AdvancedMetadata diff --git a/src/Merge.Client/Accounting/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Accounting/Types/AsyncPassthroughReciept.cs index a94c5a26..e8ffc4fc 100644 --- a/src/Merge.Client/Accounting/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Accounting/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Accounting/Types/AsyncPostTask.cs b/src/Merge.Client/Accounting/Types/AsyncPostTask.cs index a1636db7..45a205d2 100644 --- a/src/Merge.Client/Accounting/Types/AsyncPostTask.cs +++ b/src/Merge.Client/Accounting/Types/AsyncPostTask.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AsyncPostTask diff --git a/src/Merge.Client/Accounting/Types/AsyncPostTaskResult.cs b/src/Merge.Client/Accounting/Types/AsyncPostTaskResult.cs index d772b189..91eacc2f 100644 --- a/src/Merge.Client/Accounting/Types/AsyncPostTaskResult.cs +++ b/src/Merge.Client/Accounting/Types/AsyncPostTaskResult.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AsyncPostTaskResult diff --git a/src/Merge.Client/Accounting/Types/AsyncPostTaskStatusEnum.cs b/src/Merge.Client/Accounting/Types/AsyncPostTaskStatusEnum.cs index b82ce58e..44b3780e 100644 --- a/src/Merge.Client/Accounting/Types/AsyncPostTaskStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/AsyncPostTaskStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AsyncPostTaskStatusEnum { [EnumMember(Value = "QUEUED")] diff --git a/src/Merge.Client/Accounting/Types/AuditLogEvent.cs b/src/Merge.Client/Accounting/Types/AuditLogEvent.cs index a53a49d3..ace59b7c 100644 --- a/src/Merge.Client/Accounting/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Accounting/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AuditLogEvent diff --git a/src/Merge.Client/Accounting/Types/AvailableActions.cs b/src/Merge.Client/Accounting/Types/AvailableActions.cs index 7fabbcba..910860e7 100644 --- a/src/Merge.Client/Accounting/Types/AvailableActions.cs +++ b/src/Merge.Client/Accounting/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record AvailableActions diff --git a/src/Merge.Client/Accounting/Types/BalanceSheet.cs b/src/Merge.Client/Accounting/Types/BalanceSheet.cs index b5f13cbe..83f30b79 100644 --- a/src/Merge.Client/Accounting/Types/BalanceSheet.cs +++ b/src/Merge.Client/Accounting/Types/BalanceSheet.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record BalanceSheet diff --git a/src/Merge.Client/Accounting/Types/BankFeedAccount.cs b/src/Merge.Client/Accounting/Types/BankFeedAccount.cs index 749b312a..dcb243f3 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedAccount.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedAccount.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccount diff --git a/src/Merge.Client/Accounting/Types/BankFeedAccountAccountTypeEnum.cs b/src/Merge.Client/Accounting/Types/BankFeedAccountAccountTypeEnum.cs index 932f4544..cf2a79a6 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedAccountAccountTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedAccountAccountTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum BankFeedAccountAccountTypeEnum { [EnumMember(Value = "BANK")] diff --git a/src/Merge.Client/Accounting/Types/BankFeedAccountRequest.cs b/src/Merge.Client/Accounting/Types/BankFeedAccountRequest.cs index a6019704..85702191 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedAccountRequest.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedAccountRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccountRequest diff --git a/src/Merge.Client/Accounting/Types/BankFeedAccountResponse.cs b/src/Merge.Client/Accounting/Types/BankFeedAccountResponse.cs index c785d96a..f7d84cc3 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedAccountResponse.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedAccountResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedAccountResponse diff --git a/src/Merge.Client/Accounting/Types/BankFeedTransaction.cs b/src/Merge.Client/Accounting/Types/BankFeedTransaction.cs index 61faaa6b..68c54e71 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedTransaction.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedTransaction.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransaction diff --git a/src/Merge.Client/Accounting/Types/BankFeedTransactionRequestRequest.cs b/src/Merge.Client/Accounting/Types/BankFeedTransactionRequestRequest.cs index 242f95bd..44d0f0eb 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedTransactionRequestRequest.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedTransactionRequestRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransactionRequestRequest diff --git a/src/Merge.Client/Accounting/Types/BankFeedTransactionResponse.cs b/src/Merge.Client/Accounting/Types/BankFeedTransactionResponse.cs index b17ca369..d4aa96c1 100644 --- a/src/Merge.Client/Accounting/Types/BankFeedTransactionResponse.cs +++ b/src/Merge.Client/Accounting/Types/BankFeedTransactionResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record BankFeedTransactionResponse diff --git a/src/Merge.Client/Accounting/Types/CashFlowStatement.cs b/src/Merge.Client/Accounting/Types/CashFlowStatement.cs index 5191726e..c19ae725 100644 --- a/src/Merge.Client/Accounting/Types/CashFlowStatement.cs +++ b/src/Merge.Client/Accounting/Types/CashFlowStatement.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CashFlowStatement diff --git a/src/Merge.Client/Accounting/Types/CategoriesEnum.cs b/src/Merge.Client/Accounting/Types/CategoriesEnum.cs index 3f2e04c3..4414fc85 100644 --- a/src/Merge.Client/Accounting/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Accounting/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Accounting/Types/CategoryEnum.cs b/src/Merge.Client/Accounting/Types/CategoryEnum.cs index 1437e1b2..76182edd 100644 --- a/src/Merge.Client/Accounting/Types/CategoryEnum.cs +++ b/src/Merge.Client/Accounting/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Accounting/Types/CategoryTypeEnum.cs b/src/Merge.Client/Accounting/Types/CategoryTypeEnum.cs index f588d2fe..3ea40f3e 100644 --- a/src/Merge.Client/Accounting/Types/CategoryTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/CategoryTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryTypeEnum { [EnumMember(Value = "CLASS")] diff --git a/src/Merge.Client/Accounting/Types/ClassificationEnum.cs b/src/Merge.Client/Accounting/Types/ClassificationEnum.cs index d998b247..50c54331 100644 --- a/src/Merge.Client/Accounting/Types/ClassificationEnum.cs +++ b/src/Merge.Client/Accounting/Types/ClassificationEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ClassificationEnum { [EnumMember(Value = "ASSET")] diff --git a/src/Merge.Client/Accounting/Types/CommonModelScopeApi.cs b/src/Merge.Client/Accounting/Types/CommonModelScopeApi.cs index 16faa706..90edd115 100644 --- a/src/Merge.Client/Accounting/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Accounting/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CommonModelScopeApi diff --git a/src/Merge.Client/Accounting/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Accounting/Types/CommonModelScopesBodyRequest.cs index d61df5a9..8945e09b 100644 --- a/src/Merge.Client/Accounting/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Accounting/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Accounting/Types/CompanyInfo.cs b/src/Merge.Client/Accounting/Types/CompanyInfo.cs index 9e31ded1..8adf1164 100644 --- a/src/Merge.Client/Accounting/Types/CompanyInfo.cs +++ b/src/Merge.Client/Accounting/Types/CompanyInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CompanyInfo diff --git a/src/Merge.Client/Accounting/Types/ComponentTypeEnum.cs b/src/Merge.Client/Accounting/Types/ComponentTypeEnum.cs index 67930d77..d6dc4f37 100644 --- a/src/Merge.Client/Accounting/Types/ComponentTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/ComponentTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ComponentTypeEnum { [EnumMember(Value = "SALES")] diff --git a/src/Merge.Client/Accounting/Types/Contact.cs b/src/Merge.Client/Accounting/Types/Contact.cs index 0a2d3881..f8067c39 100644 --- a/src/Merge.Client/Accounting/Types/Contact.cs +++ b/src/Merge.Client/Accounting/Types/Contact.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Contact diff --git a/src/Merge.Client/Accounting/Types/ContactRequest.cs b/src/Merge.Client/Accounting/Types/ContactRequest.cs index 4b6070e6..71695165 100644 --- a/src/Merge.Client/Accounting/Types/ContactRequest.cs +++ b/src/Merge.Client/Accounting/Types/ContactRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record ContactRequest diff --git a/src/Merge.Client/Accounting/Types/ContactResponse.cs b/src/Merge.Client/Accounting/Types/ContactResponse.cs index 2ebf46d7..00c83390 100644 --- a/src/Merge.Client/Accounting/Types/ContactResponse.cs +++ b/src/Merge.Client/Accounting/Types/ContactResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ContactResponse diff --git a/src/Merge.Client/Accounting/Types/CountryEnum.cs b/src/Merge.Client/Accounting/Types/CountryEnum.cs index 4f075ef2..ff64d907 100644 --- a/src/Merge.Client/Accounting/Types/CountryEnum.cs +++ b/src/Merge.Client/Accounting/Types/CountryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CountryEnum { [EnumMember(Value = "AF")] diff --git a/src/Merge.Client/Accounting/Types/CreditNote.cs b/src/Merge.Client/Accounting/Types/CreditNote.cs index e29b10fd..2849acfc 100644 --- a/src/Merge.Client/Accounting/Types/CreditNote.cs +++ b/src/Merge.Client/Accounting/Types/CreditNote.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNote diff --git a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNote.cs b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNote.cs index ca1c24d2..018f9382 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNote.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNote.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteApplyLineForCreditNote diff --git a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNoteRequest.cs b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNoteRequest.cs index 740941d4..52127052 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNoteRequest.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForCreditNoteRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteApplyLineForCreditNoteRequest diff --git a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForInvoice.cs b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForInvoice.cs index bf3ad1d8..f116aad3 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForInvoice.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteApplyLineForInvoice.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteApplyLineForInvoice diff --git a/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs b/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs index 5940c2dd..78d9ef36 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteLineItem.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteLineItem diff --git a/src/Merge.Client/Accounting/Types/CreditNoteLineItemRequest.cs b/src/Merge.Client/Accounting/Types/CreditNoteLineItemRequest.cs index 3f40496a..6d981824 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteLineItemRequest.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteLineItemRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteLineItemRequest diff --git a/src/Merge.Client/Accounting/Types/CreditNoteRequest.cs b/src/Merge.Client/Accounting/Types/CreditNoteRequest.cs index 329dba2f..fe2f6e43 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteRequest.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteRequest diff --git a/src/Merge.Client/Accounting/Types/CreditNoteResponse.cs b/src/Merge.Client/Accounting/Types/CreditNoteResponse.cs index feae843c..1ff44a97 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteResponse.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record CreditNoteResponse diff --git a/src/Merge.Client/Accounting/Types/CreditNoteStatusEnum.cs b/src/Merge.Client/Accounting/Types/CreditNoteStatusEnum.cs index 92c296bb..93c41d1b 100644 --- a/src/Merge.Client/Accounting/Types/CreditNoteStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/CreditNoteStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditNoteStatusEnum { [EnumMember(Value = "SUBMITTED")] diff --git a/src/Merge.Client/Accounting/Types/CreditOrDebitEnum.cs b/src/Merge.Client/Accounting/Types/CreditOrDebitEnum.cs index d84d1a11..8a55f3aa 100644 --- a/src/Merge.Client/Accounting/Types/CreditOrDebitEnum.cs +++ b/src/Merge.Client/Accounting/Types/CreditOrDebitEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CreditOrDebitEnum { [EnumMember(Value = "CREDIT")] diff --git a/src/Merge.Client/Accounting/Types/DataPassthroughRequest.cs b/src/Merge.Client/Accounting/Types/DataPassthroughRequest.cs index 7290d5e2..8a6b97ef 100644 --- a/src/Merge.Client/Accounting/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Accounting/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record DataPassthroughRequest diff --git a/src/Merge.Client/Accounting/Types/DebugModeLog.cs b/src/Merge.Client/Accounting/Types/DebugModeLog.cs index 8f7536ba..a1bbc2ce 100644 --- a/src/Merge.Client/Accounting/Types/DebugModeLog.cs +++ b/src/Merge.Client/Accounting/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record DebugModeLog diff --git a/src/Merge.Client/Accounting/Types/DebugModelLogSummary.cs b/src/Merge.Client/Accounting/Types/DebugModelLogSummary.cs index 09c3f936..2575ab4e 100644 --- a/src/Merge.Client/Accounting/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Accounting/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record DebugModelLogSummary diff --git a/src/Merge.Client/Accounting/Types/Employee.cs b/src/Merge.Client/Accounting/Types/Employee.cs index 892e86de..f81a026d 100644 --- a/src/Merge.Client/Accounting/Types/Employee.cs +++ b/src/Merge.Client/Accounting/Types/Employee.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Employee diff --git a/src/Merge.Client/Accounting/Types/EnabledActionsEnum.cs b/src/Merge.Client/Accounting/Types/EnabledActionsEnum.cs index 2f0aaa74..48fec50a 100644 --- a/src/Merge.Client/Accounting/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Accounting/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Accounting/Types/EncodingEnum.cs b/src/Merge.Client/Accounting/Types/EncodingEnum.cs index 8c2afd5c..f94d436b 100644 --- a/src/Merge.Client/Accounting/Types/EncodingEnum.cs +++ b/src/Merge.Client/Accounting/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Accounting/Types/ErrorValidationProblem.cs b/src/Merge.Client/Accounting/Types/ErrorValidationProblem.cs index 95ea0bdc..f1e1bc5e 100644 --- a/src/Merge.Client/Accounting/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Accounting/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ErrorValidationProblem diff --git a/src/Merge.Client/Accounting/Types/EventTypeEnum.cs b/src/Merge.Client/Accounting/Types/EventTypeEnum.cs index a40da7e7..5537f7fd 100644 --- a/src/Merge.Client/Accounting/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Accounting/Types/Expense.cs b/src/Merge.Client/Accounting/Types/Expense.cs index 1dfdc966..ad765441 100644 --- a/src/Merge.Client/Accounting/Types/Expense.cs +++ b/src/Merge.Client/Accounting/Types/Expense.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Expense diff --git a/src/Merge.Client/Accounting/Types/ExpenseLine.cs b/src/Merge.Client/Accounting/Types/ExpenseLine.cs index b3c282e7..f90b6061 100644 --- a/src/Merge.Client/Accounting/Types/ExpenseLine.cs +++ b/src/Merge.Client/Accounting/Types/ExpenseLine.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record ExpenseLine diff --git a/src/Merge.Client/Accounting/Types/ExpenseLineRequest.cs b/src/Merge.Client/Accounting/Types/ExpenseLineRequest.cs index 7e53f6d8..e6f27795 100644 --- a/src/Merge.Client/Accounting/Types/ExpenseLineRequest.cs +++ b/src/Merge.Client/Accounting/Types/ExpenseLineRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record ExpenseLineRequest diff --git a/src/Merge.Client/Accounting/Types/ExpenseRequest.cs b/src/Merge.Client/Accounting/Types/ExpenseRequest.cs index cdf677a1..1167c530 100644 --- a/src/Merge.Client/Accounting/Types/ExpenseRequest.cs +++ b/src/Merge.Client/Accounting/Types/ExpenseRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record ExpenseRequest diff --git a/src/Merge.Client/Accounting/Types/ExpenseResponse.cs b/src/Merge.Client/Accounting/Types/ExpenseResponse.cs index ca2fb897..5548113a 100644 --- a/src/Merge.Client/Accounting/Types/ExpenseResponse.cs +++ b/src/Merge.Client/Accounting/Types/ExpenseResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExpenseResponse diff --git a/src/Merge.Client/Accounting/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Accounting/Types/ExternalTargetFieldApi.cs index 0a5a4960..b3b6be97 100644 --- a/src/Merge.Client/Accounting/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Accounting/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Accounting/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Accounting/Types/ExternalTargetFieldApiResponse.cs index 4955e9e8..79c84b58 100644 --- a/src/Merge.Client/Accounting/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Accounting/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Accounting/Types/FeedStatusEnum.cs b/src/Merge.Client/Accounting/Types/FeedStatusEnum.cs index d3cff181..42b8ca19 100644 --- a/src/Merge.Client/Accounting/Types/FeedStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/FeedStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FeedStatusEnum { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Accounting/Types/FieldFormatEnum.cs b/src/Merge.Client/Accounting/Types/FieldFormatEnum.cs index ddf380ec..3dab8413 100644 --- a/src/Merge.Client/Accounting/Types/FieldFormatEnum.cs +++ b/src/Merge.Client/Accounting/Types/FieldFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Accounting/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Accounting/Types/FieldMappingApiInstance.cs index 2264e434..60b15d48 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteField.cs index 776f1a44..af545fff 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index 0cf5a836..9dbbbd56 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceResponse.cs index 24774592..7ced22db 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceTargetField.cs index 6fbc7c2f..6dc2e7c8 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Accounting/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Accounting/Types/FieldMappingInstanceResponse.cs index f3da9de9..cc22ce18 100644 --- a/src/Merge.Client/Accounting/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Accounting/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Accounting/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Accounting/Types/FieldPermissionDeserializer.cs index a3c393b8..88a5f5ce 100644 --- a/src/Merge.Client/Accounting/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Accounting/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Accounting/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Accounting/Types/FieldPermissionDeserializerRequest.cs index fbcb8d22..2a2d9e13 100644 --- a/src/Merge.Client/Accounting/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Accounting/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Accounting/Types/FieldTypeEnum.cs b/src/Merge.Client/Accounting/Types/FieldTypeEnum.cs index 9d793476..b2c7bf52 100644 --- a/src/Merge.Client/Accounting/Types/FieldTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/FieldTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Accounting/Types/GeneralLedgerTransaction.cs b/src/Merge.Client/Accounting/Types/GeneralLedgerTransaction.cs index f84c65e8..2a9057d0 100644 --- a/src/Merge.Client/Accounting/Types/GeneralLedgerTransaction.cs +++ b/src/Merge.Client/Accounting/Types/GeneralLedgerTransaction.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record GeneralLedgerTransaction diff --git a/src/Merge.Client/Accounting/Types/GeneralLedgerTransactionLine.cs b/src/Merge.Client/Accounting/Types/GeneralLedgerTransactionLine.cs index 11c8c292..ab9e1827 100644 --- a/src/Merge.Client/Accounting/Types/GeneralLedgerTransactionLine.cs +++ b/src/Merge.Client/Accounting/Types/GeneralLedgerTransactionLine.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record GeneralLedgerTransactionLine diff --git a/src/Merge.Client/Accounting/Types/IncomeStatement.cs b/src/Merge.Client/Accounting/Types/IncomeStatement.cs index 8a6f2c08..6f0ad554 100644 --- a/src/Merge.Client/Accounting/Types/IncomeStatement.cs +++ b/src/Merge.Client/Accounting/Types/IncomeStatement.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record IncomeStatement diff --git a/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializer.cs index 58b528fd..c5336074 100644 --- a/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializerRequest.cs index 2d352dea..266b18ca 100644 --- a/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Accounting/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Accounting/Types/Invoice.cs b/src/Merge.Client/Accounting/Types/Invoice.cs index 33679304..df56a13c 100644 --- a/src/Merge.Client/Accounting/Types/Invoice.cs +++ b/src/Merge.Client/Accounting/Types/Invoice.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Invoice diff --git a/src/Merge.Client/Accounting/Types/InvoiceLineItem.cs b/src/Merge.Client/Accounting/Types/InvoiceLineItem.cs index ed86581e..fdd9cf72 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceLineItem.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceLineItem.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record InvoiceLineItem diff --git a/src/Merge.Client/Accounting/Types/InvoiceLineItemRequest.cs b/src/Merge.Client/Accounting/Types/InvoiceLineItemRequest.cs index d7585f9d..d3475c89 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceLineItemRequest.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceLineItemRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record InvoiceLineItemRequest diff --git a/src/Merge.Client/Accounting/Types/InvoiceRequest.cs b/src/Merge.Client/Accounting/Types/InvoiceRequest.cs index 35089948..8c6ee8e2 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceRequest.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record InvoiceRequest diff --git a/src/Merge.Client/Accounting/Types/InvoiceResponse.cs b/src/Merge.Client/Accounting/Types/InvoiceResponse.cs index 544a0406..8c96946a 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceResponse.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record InvoiceResponse diff --git a/src/Merge.Client/Accounting/Types/InvoiceStatusEnum.cs b/src/Merge.Client/Accounting/Types/InvoiceStatusEnum.cs index 2b044af3..8a8ba304 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoiceStatusEnum { [EnumMember(Value = "PAID")] diff --git a/src/Merge.Client/Accounting/Types/InvoiceTypeEnum.cs b/src/Merge.Client/Accounting/Types/InvoiceTypeEnum.cs index 6ba24ccc..a38b8c9e 100644 --- a/src/Merge.Client/Accounting/Types/InvoiceTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/InvoiceTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InvoiceTypeEnum { [EnumMember(Value = "ACCOUNTS_RECEIVABLE")] diff --git a/src/Merge.Client/Accounting/Types/Issue.cs b/src/Merge.Client/Accounting/Types/Issue.cs index 34ae4d74..e0b1851f 100644 --- a/src/Merge.Client/Accounting/Types/Issue.cs +++ b/src/Merge.Client/Accounting/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record Issue diff --git a/src/Merge.Client/Accounting/Types/IssueStatusEnum.cs b/src/Merge.Client/Accounting/Types/IssueStatusEnum.cs index f4852d80..ae63fb5b 100644 --- a/src/Merge.Client/Accounting/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Accounting/Types/Item.cs b/src/Merge.Client/Accounting/Types/Item.cs index 659a21ea..1fdfd4f0 100644 --- a/src/Merge.Client/Accounting/Types/Item.cs +++ b/src/Merge.Client/Accounting/Types/Item.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Item diff --git a/src/Merge.Client/Accounting/Types/ItemFormatEnum.cs b/src/Merge.Client/Accounting/Types/ItemFormatEnum.cs index 773bb8f2..b0847567 100644 --- a/src/Merge.Client/Accounting/Types/ItemFormatEnum.cs +++ b/src/Merge.Client/Accounting/Types/ItemFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Accounting/Types/ItemSchema.cs b/src/Merge.Client/Accounting/Types/ItemSchema.cs index 67611cbc..f264582a 100644 --- a/src/Merge.Client/Accounting/Types/ItemSchema.cs +++ b/src/Merge.Client/Accounting/Types/ItemSchema.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ItemSchema diff --git a/src/Merge.Client/Accounting/Types/ItemTypeEnum.cs b/src/Merge.Client/Accounting/Types/ItemTypeEnum.cs index 591d1c59..5967c014 100644 --- a/src/Merge.Client/Accounting/Types/ItemTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/ItemTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Accounting/Types/JournalEntry.cs b/src/Merge.Client/Accounting/Types/JournalEntry.cs index c57665c8..50a11cc0 100644 --- a/src/Merge.Client/Accounting/Types/JournalEntry.cs +++ b/src/Merge.Client/Accounting/Types/JournalEntry.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntry diff --git a/src/Merge.Client/Accounting/Types/JournalEntryRequest.cs b/src/Merge.Client/Accounting/Types/JournalEntryRequest.cs index 4beb3477..01801fde 100644 --- a/src/Merge.Client/Accounting/Types/JournalEntryRequest.cs +++ b/src/Merge.Client/Accounting/Types/JournalEntryRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntryRequest diff --git a/src/Merge.Client/Accounting/Types/JournalEntryResponse.cs b/src/Merge.Client/Accounting/Types/JournalEntryResponse.cs index 668188e5..187ad583 100644 --- a/src/Merge.Client/Accounting/Types/JournalEntryResponse.cs +++ b/src/Merge.Client/Accounting/Types/JournalEntryResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record JournalEntryResponse diff --git a/src/Merge.Client/Accounting/Types/JournalLine.cs b/src/Merge.Client/Accounting/Types/JournalLine.cs index c578ab13..1348dabd 100644 --- a/src/Merge.Client/Accounting/Types/JournalLine.cs +++ b/src/Merge.Client/Accounting/Types/JournalLine.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record JournalLine diff --git a/src/Merge.Client/Accounting/Types/JournalLineRequest.cs b/src/Merge.Client/Accounting/Types/JournalLineRequest.cs index 851a71ee..e342d566 100644 --- a/src/Merge.Client/Accounting/Types/JournalLineRequest.cs +++ b/src/Merge.Client/Accounting/Types/JournalLineRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record JournalLineRequest diff --git a/src/Merge.Client/Accounting/Types/LanguageEnum.cs b/src/Merge.Client/Accounting/Types/LanguageEnum.cs index 4f32c7c1..5f81b369 100644 --- a/src/Merge.Client/Accounting/Types/LanguageEnum.cs +++ b/src/Merge.Client/Accounting/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Accounting/Types/LinkToken.cs b/src/Merge.Client/Accounting/Types/LinkToken.cs index 65ea53e6..87dff7eb 100644 --- a/src/Merge.Client/Accounting/Types/LinkToken.cs +++ b/src/Merge.Client/Accounting/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record LinkToken diff --git a/src/Merge.Client/Accounting/Types/LinkedAccountStatus.cs b/src/Merge.Client/Accounting/Types/LinkedAccountStatus.cs index 6afea9a1..ff5ed6c5 100644 --- a/src/Merge.Client/Accounting/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Accounting/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record LinkedAccountStatus diff --git a/src/Merge.Client/Accounting/Types/MetaResponse.cs b/src/Merge.Client/Accounting/Types/MetaResponse.cs index a6cbdf0e..f7c33497 100644 --- a/src/Merge.Client/Accounting/Types/MetaResponse.cs +++ b/src/Merge.Client/Accounting/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record MetaResponse diff --git a/src/Merge.Client/Accounting/Types/MethodEnum.cs b/src/Merge.Client/Accounting/Types/MethodEnum.cs index 0366b4eb..a750f559 100644 --- a/src/Merge.Client/Accounting/Types/MethodEnum.cs +++ b/src/Merge.Client/Accounting/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Accounting/Types/ModelOperation.cs b/src/Merge.Client/Accounting/Types/ModelOperation.cs index 95802215..1619a20f 100644 --- a/src/Merge.Client/Accounting/Types/ModelOperation.cs +++ b/src/Merge.Client/Accounting/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ModelOperation diff --git a/src/Merge.Client/Accounting/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Accounting/Types/ModelPermissionDeserializer.cs index bb98c77e..70023de0 100644 --- a/src/Merge.Client/Accounting/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Accounting/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Accounting/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Accounting/Types/ModelPermissionDeserializerRequest.cs index 8043c5e5..04924ac1 100644 --- a/src/Merge.Client/Accounting/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Accounting/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Accounting/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Accounting/Types/MultipartFormFieldRequest.cs index 944fb9ac..4e19d0c2 100644 --- a/src/Merge.Client/Accounting/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Accounting/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Accounting/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Accounting/Types/PaginatedAccountDetailsAndActionsList.cs index 10b82205..21806ad6 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Accounting/Types/PaginatedAccountList.cs b/src/Merge.Client/Accounting/Types/PaginatedAccountList.cs index 5723f91f..1122da62 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedAccountList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedAccountList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedAccountList diff --git a/src/Merge.Client/Accounting/Types/PaginatedAccountingAttachmentList.cs b/src/Merge.Client/Accounting/Types/PaginatedAccountingAttachmentList.cs index a9c8b5d7..7b93d591 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedAccountingAttachmentList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedAccountingAttachmentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedAccountingAttachmentList diff --git a/src/Merge.Client/Accounting/Types/PaginatedAccountingPeriodList.cs b/src/Merge.Client/Accounting/Types/PaginatedAccountingPeriodList.cs index 618d975f..19a27fe2 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedAccountingPeriodList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedAccountingPeriodList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedAccountingPeriodList diff --git a/src/Merge.Client/Accounting/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Accounting/Types/PaginatedAuditLogEventList.cs index f96c9d66..ca368cfc 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Accounting/Types/PaginatedBalanceSheetList.cs b/src/Merge.Client/Accounting/Types/PaginatedBalanceSheetList.cs index 775fb2d3..a2f10148 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedBalanceSheetList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedBalanceSheetList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedBalanceSheetList diff --git a/src/Merge.Client/Accounting/Types/PaginatedBankFeedAccountList.cs b/src/Merge.Client/Accounting/Types/PaginatedBankFeedAccountList.cs index afc3f27c..3648e1d4 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedBankFeedAccountList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedBankFeedAccountList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedBankFeedAccountList diff --git a/src/Merge.Client/Accounting/Types/PaginatedBankFeedTransactionList.cs b/src/Merge.Client/Accounting/Types/PaginatedBankFeedTransactionList.cs index cbda236f..f719f9ac 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedBankFeedTransactionList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedBankFeedTransactionList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedBankFeedTransactionList diff --git a/src/Merge.Client/Accounting/Types/PaginatedCashFlowStatementList.cs b/src/Merge.Client/Accounting/Types/PaginatedCashFlowStatementList.cs index 673d8190..2fe1d2a7 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedCashFlowStatementList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedCashFlowStatementList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedCashFlowStatementList diff --git a/src/Merge.Client/Accounting/Types/PaginatedCompanyInfoList.cs b/src/Merge.Client/Accounting/Types/PaginatedCompanyInfoList.cs index 1d651b21..9aa03991 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedCompanyInfoList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedCompanyInfoList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedCompanyInfoList diff --git a/src/Merge.Client/Accounting/Types/PaginatedContactList.cs b/src/Merge.Client/Accounting/Types/PaginatedContactList.cs index 392aa821..32ae2dc8 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedContactList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedContactList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedContactList diff --git a/src/Merge.Client/Accounting/Types/PaginatedCreditNoteList.cs b/src/Merge.Client/Accounting/Types/PaginatedCreditNoteList.cs index dbeddffc..42a5b493 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedCreditNoteList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedCreditNoteList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedCreditNoteList diff --git a/src/Merge.Client/Accounting/Types/PaginatedEmployeeList.cs b/src/Merge.Client/Accounting/Types/PaginatedEmployeeList.cs index 87433cf8..e5b86642 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedEmployeeList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedEmployeeList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedEmployeeList diff --git a/src/Merge.Client/Accounting/Types/PaginatedExpenseList.cs b/src/Merge.Client/Accounting/Types/PaginatedExpenseList.cs index a1ccee4e..d2c77661 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedExpenseList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedExpenseList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedExpenseList diff --git a/src/Merge.Client/Accounting/Types/PaginatedGeneralLedgerTransactionList.cs b/src/Merge.Client/Accounting/Types/PaginatedGeneralLedgerTransactionList.cs index 31b6dc85..160988f8 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedGeneralLedgerTransactionList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedGeneralLedgerTransactionList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedGeneralLedgerTransactionList diff --git a/src/Merge.Client/Accounting/Types/PaginatedIncomeStatementList.cs b/src/Merge.Client/Accounting/Types/PaginatedIncomeStatementList.cs index f388a67a..cf0bd473 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedIncomeStatementList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedIncomeStatementList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedIncomeStatementList diff --git a/src/Merge.Client/Accounting/Types/PaginatedInvoiceList.cs b/src/Merge.Client/Accounting/Types/PaginatedInvoiceList.cs index 2e44cbd8..8b9ca871 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedInvoiceList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedInvoiceList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedInvoiceList diff --git a/src/Merge.Client/Accounting/Types/PaginatedIssueList.cs b/src/Merge.Client/Accounting/Types/PaginatedIssueList.cs index f1862bc9..1c2a29fa 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedIssueList diff --git a/src/Merge.Client/Accounting/Types/PaginatedItemList.cs b/src/Merge.Client/Accounting/Types/PaginatedItemList.cs index 2f14e33b..3c5d7c98 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedItemList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedItemList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedItemList diff --git a/src/Merge.Client/Accounting/Types/PaginatedJournalEntryList.cs b/src/Merge.Client/Accounting/Types/PaginatedJournalEntryList.cs index 86ea4477..87f4f12a 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedJournalEntryList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedJournalEntryList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedJournalEntryList diff --git a/src/Merge.Client/Accounting/Types/PaginatedPaymentList.cs b/src/Merge.Client/Accounting/Types/PaginatedPaymentList.cs index 5303f1b6..951c6629 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedPaymentList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedPaymentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedPaymentList diff --git a/src/Merge.Client/Accounting/Types/PaginatedPurchaseOrderList.cs b/src/Merge.Client/Accounting/Types/PaginatedPurchaseOrderList.cs index abfe7d5f..27ea2c0c 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedPurchaseOrderList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedPurchaseOrderList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedPurchaseOrderList diff --git a/src/Merge.Client/Accounting/Types/PaginatedRemoteFieldClassList.cs b/src/Merge.Client/Accounting/Types/PaginatedRemoteFieldClassList.cs index b5d146f5..3052f03f 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedRemoteFieldClassList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedRemoteFieldClassList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedRemoteFieldClassList diff --git a/src/Merge.Client/Accounting/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Accounting/Types/PaginatedSyncStatusList.cs index 7d525364..e51f10bd 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Accounting/Types/PaginatedTaxRateList.cs b/src/Merge.Client/Accounting/Types/PaginatedTaxRateList.cs index a9e62970..c1d2b562 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedTaxRateList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedTaxRateList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedTaxRateList diff --git a/src/Merge.Client/Accounting/Types/PaginatedTrackingCategoryList.cs b/src/Merge.Client/Accounting/Types/PaginatedTrackingCategoryList.cs index adbb3d87..7e4efc81 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedTrackingCategoryList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedTrackingCategoryList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedTrackingCategoryList diff --git a/src/Merge.Client/Accounting/Types/PaginatedTransactionList.cs b/src/Merge.Client/Accounting/Types/PaginatedTransactionList.cs index 7ba9c708..78523ba0 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedTransactionList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedTransactionList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedTransactionList diff --git a/src/Merge.Client/Accounting/Types/PaginatedVendorCreditList.cs b/src/Merge.Client/Accounting/Types/PaginatedVendorCreditList.cs index 4adac13d..069a7110 100644 --- a/src/Merge.Client/Accounting/Types/PaginatedVendorCreditList.cs +++ b/src/Merge.Client/Accounting/Types/PaginatedVendorCreditList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaginatedVendorCreditList diff --git a/src/Merge.Client/Accounting/Types/PatchedPaymentRequest.cs b/src/Merge.Client/Accounting/Types/PatchedPaymentRequest.cs index 86dc529f..bd6e1fb1 100644 --- a/src/Merge.Client/Accounting/Types/PatchedPaymentRequest.cs +++ b/src/Merge.Client/Accounting/Types/PatchedPaymentRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PatchedPaymentRequest diff --git a/src/Merge.Client/Accounting/Types/Payment.cs b/src/Merge.Client/Accounting/Types/Payment.cs index 47178286..5732624c 100644 --- a/src/Merge.Client/Accounting/Types/Payment.cs +++ b/src/Merge.Client/Accounting/Types/Payment.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Payment diff --git a/src/Merge.Client/Accounting/Types/PaymentLineItem.cs b/src/Merge.Client/Accounting/Types/PaymentLineItem.cs index a5f39dcb..7527bfe2 100644 --- a/src/Merge.Client/Accounting/Types/PaymentLineItem.cs +++ b/src/Merge.Client/Accounting/Types/PaymentLineItem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentLineItem diff --git a/src/Merge.Client/Accounting/Types/PaymentLineItemRequest.cs b/src/Merge.Client/Accounting/Types/PaymentLineItemRequest.cs index 891ecb2f..978f3a4e 100644 --- a/src/Merge.Client/Accounting/Types/PaymentLineItemRequest.cs +++ b/src/Merge.Client/Accounting/Types/PaymentLineItemRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentLineItemRequest diff --git a/src/Merge.Client/Accounting/Types/PaymentRequest.cs b/src/Merge.Client/Accounting/Types/PaymentRequest.cs index 5f384cde..33a4e2fb 100644 --- a/src/Merge.Client/Accounting/Types/PaymentRequest.cs +++ b/src/Merge.Client/Accounting/Types/PaymentRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentRequest diff --git a/src/Merge.Client/Accounting/Types/PaymentResponse.cs b/src/Merge.Client/Accounting/Types/PaymentResponse.cs index 6ea66e58..b5342f16 100644 --- a/src/Merge.Client/Accounting/Types/PaymentResponse.cs +++ b/src/Merge.Client/Accounting/Types/PaymentResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PaymentResponse diff --git a/src/Merge.Client/Accounting/Types/PaymentTypeEnum.cs b/src/Merge.Client/Accounting/Types/PaymentTypeEnum.cs index cc0418d7..97afc6f4 100644 --- a/src/Merge.Client/Accounting/Types/PaymentTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/PaymentTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PaymentTypeEnum { [EnumMember(Value = "ACCOUNTS_PAYABLE")] diff --git a/src/Merge.Client/Accounting/Types/PostingStatusEnum.cs b/src/Merge.Client/Accounting/Types/PostingStatusEnum.cs index 7c3eeec7..591a3585 100644 --- a/src/Merge.Client/Accounting/Types/PostingStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/PostingStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PostingStatusEnum { [EnumMember(Value = "UNPOSTED")] diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrder.cs b/src/Merge.Client/Accounting/Types/PurchaseOrder.cs index 592f249c..ac0f6108 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrder.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrder.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrder diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs index 0b43cd87..12c1241c 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItem.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrderLineItem diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs index fb0296dc..97d6df3a 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderLineItemRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrderLineItemRequest diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderRequest.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderRequest.cs index f79010a8..91c96bb1 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderRequest.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrderRequest diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderResponse.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderResponse.cs index c388483f..2ca90373 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderResponse.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record PurchaseOrderResponse diff --git a/src/Merge.Client/Accounting/Types/PurchaseOrderStatusEnum.cs b/src/Merge.Client/Accounting/Types/PurchaseOrderStatusEnum.cs index b765566b..01788f59 100644 --- a/src/Merge.Client/Accounting/Types/PurchaseOrderStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/PurchaseOrderStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PurchaseOrderStatusEnum { [EnumMember(Value = "DRAFT")] diff --git a/src/Merge.Client/Accounting/Types/RemoteData.cs b/src/Merge.Client/Accounting/Types/RemoteData.cs index d4dbf1cf..0823a7bc 100644 --- a/src/Merge.Client/Accounting/Types/RemoteData.cs +++ b/src/Merge.Client/Accounting/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteData diff --git a/src/Merge.Client/Accounting/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Accounting/Types/RemoteEndpointInfo.cs index db4e1a37..71c96802 100644 --- a/src/Merge.Client/Accounting/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Accounting/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Accounting/Types/RemoteField.cs b/src/Merge.Client/Accounting/Types/RemoteField.cs index e76f7376..815c72c9 100644 --- a/src/Merge.Client/Accounting/Types/RemoteField.cs +++ b/src/Merge.Client/Accounting/Types/RemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteField diff --git a/src/Merge.Client/Accounting/Types/RemoteFieldApi.cs b/src/Merge.Client/Accounting/Types/RemoteFieldApi.cs index 7f0c4251..4211d84f 100644 --- a/src/Merge.Client/Accounting/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Accounting/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteFieldApi diff --git a/src/Merge.Client/Accounting/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Accounting/Types/RemoteFieldApiResponse.cs index c0d8e302..0bab36d3 100644 --- a/src/Merge.Client/Accounting/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Accounting/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Accounting/Types/RemoteFieldClass.cs b/src/Merge.Client/Accounting/Types/RemoteFieldClass.cs index 2e69cd7a..07812373 100644 --- a/src/Merge.Client/Accounting/Types/RemoteFieldClass.cs +++ b/src/Merge.Client/Accounting/Types/RemoteFieldClass.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteFieldClass diff --git a/src/Merge.Client/Accounting/Types/RemoteFieldRequest.cs b/src/Merge.Client/Accounting/Types/RemoteFieldRequest.cs index dc672ad9..8c6b665b 100644 --- a/src/Merge.Client/Accounting/Types/RemoteFieldRequest.cs +++ b/src/Merge.Client/Accounting/Types/RemoteFieldRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteFieldRequest diff --git a/src/Merge.Client/Accounting/Types/RemoteKey.cs b/src/Merge.Client/Accounting/Types/RemoteKey.cs index 3c70c454..050cea65 100644 --- a/src/Merge.Client/Accounting/Types/RemoteKey.cs +++ b/src/Merge.Client/Accounting/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteKey diff --git a/src/Merge.Client/Accounting/Types/RemoteResponse.cs b/src/Merge.Client/Accounting/Types/RemoteResponse.cs index 6f6e0316..7dea8780 100644 --- a/src/Merge.Client/Accounting/Types/RemoteResponse.cs +++ b/src/Merge.Client/Accounting/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record RemoteResponse diff --git a/src/Merge.Client/Accounting/Types/ReportItem.cs b/src/Merge.Client/Accounting/Types/ReportItem.cs index 54a23f93..3534fca1 100644 --- a/src/Merge.Client/Accounting/Types/ReportItem.cs +++ b/src/Merge.Client/Accounting/Types/ReportItem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ReportItem diff --git a/src/Merge.Client/Accounting/Types/RequestFormatEnum.cs b/src/Merge.Client/Accounting/Types/RequestFormatEnum.cs index 8222a7bf..26436ae8 100644 --- a/src/Merge.Client/Accounting/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Accounting/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Accounting/Types/ResponseTypeEnum.cs b/src/Merge.Client/Accounting/Types/ResponseTypeEnum.cs index 5b087e47..4652ab24 100644 --- a/src/Merge.Client/Accounting/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Accounting/Types/RoleEnum.cs b/src/Merge.Client/Accounting/Types/RoleEnum.cs index bea2145a..9a4a393a 100644 --- a/src/Merge.Client/Accounting/Types/RoleEnum.cs +++ b/src/Merge.Client/Accounting/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Accounting/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Accounting/Types/SelectiveSyncConfigurationsUsageEnum.cs index b1b9897d..1f4b83d2 100644 --- a/src/Merge.Client/Accounting/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Accounting/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Accounting/Types/Status7D1Enum.cs b/src/Merge.Client/Accounting/Types/Status7D1Enum.cs index 8b99b95a..0198da36 100644 --- a/src/Merge.Client/Accounting/Types/Status7D1Enum.cs +++ b/src/Merge.Client/Accounting/Types/Status7D1Enum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum Status7D1Enum { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Accounting/Types/Status895Enum.cs b/src/Merge.Client/Accounting/Types/Status895Enum.cs index 815048c5..167fb54f 100644 --- a/src/Merge.Client/Accounting/Types/Status895Enum.cs +++ b/src/Merge.Client/Accounting/Types/Status895Enum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum Status895Enum { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Accounting/Types/SyncStatus.cs b/src/Merge.Client/Accounting/Types/SyncStatus.cs index 42fea340..6c8cd346 100644 --- a/src/Merge.Client/Accounting/Types/SyncStatus.cs +++ b/src/Merge.Client/Accounting/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record SyncStatus diff --git a/src/Merge.Client/Accounting/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Accounting/Types/SyncStatusStatusEnum.cs index ec334fd8..9ce38698 100644 --- a/src/Merge.Client/Accounting/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Accounting/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Accounting/Types/TaxComponent.cs b/src/Merge.Client/Accounting/Types/TaxComponent.cs index 3b0cf305..029ecb6a 100644 --- a/src/Merge.Client/Accounting/Types/TaxComponent.cs +++ b/src/Merge.Client/Accounting/Types/TaxComponent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record TaxComponent diff --git a/src/Merge.Client/Accounting/Types/TaxRate.cs b/src/Merge.Client/Accounting/Types/TaxRate.cs index 62703060..0fa57401 100644 --- a/src/Merge.Client/Accounting/Types/TaxRate.cs +++ b/src/Merge.Client/Accounting/Types/TaxRate.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record TaxRate diff --git a/src/Merge.Client/Accounting/Types/TrackingCategory.cs b/src/Merge.Client/Accounting/Types/TrackingCategory.cs index d36447dd..9a597ce8 100644 --- a/src/Merge.Client/Accounting/Types/TrackingCategory.cs +++ b/src/Merge.Client/Accounting/Types/TrackingCategory.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record TrackingCategory diff --git a/src/Merge.Client/Accounting/Types/Transaction.cs b/src/Merge.Client/Accounting/Types/Transaction.cs index 937e0c77..328eff8f 100644 --- a/src/Merge.Client/Accounting/Types/Transaction.cs +++ b/src/Merge.Client/Accounting/Types/Transaction.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record Transaction diff --git a/src/Merge.Client/Accounting/Types/TransactionCurrencyEnum.cs b/src/Merge.Client/Accounting/Types/TransactionCurrencyEnum.cs index 07dca194..a44e8cec 100644 --- a/src/Merge.Client/Accounting/Types/TransactionCurrencyEnum.cs +++ b/src/Merge.Client/Accounting/Types/TransactionCurrencyEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TransactionCurrencyEnum { [EnumMember(Value = "XUA")] diff --git a/src/Merge.Client/Accounting/Types/TransactionLineItem.cs b/src/Merge.Client/Accounting/Types/TransactionLineItem.cs index e2b2d241..6d56d23e 100644 --- a/src/Merge.Client/Accounting/Types/TransactionLineItem.cs +++ b/src/Merge.Client/Accounting/Types/TransactionLineItem.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record TransactionLineItem diff --git a/src/Merge.Client/Accounting/Types/UnderlyingTransactionTypeEnum.cs b/src/Merge.Client/Accounting/Types/UnderlyingTransactionTypeEnum.cs index 6dd09432..be4c16f0 100644 --- a/src/Merge.Client/Accounting/Types/UnderlyingTransactionTypeEnum.cs +++ b/src/Merge.Client/Accounting/Types/UnderlyingTransactionTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum UnderlyingTransactionTypeEnum { [EnumMember(Value = "INVOICE")] diff --git a/src/Merge.Client/Accounting/Types/ValidationProblemSource.cs b/src/Merge.Client/Accounting/Types/ValidationProblemSource.cs index 72c6d6b4..cecd4757 100644 --- a/src/Merge.Client/Accounting/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Accounting/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record ValidationProblemSource diff --git a/src/Merge.Client/Accounting/Types/VendorCredit.cs b/src/Merge.Client/Accounting/Types/VendorCredit.cs index b60fc1ae..4ee5c81d 100644 --- a/src/Merge.Client/Accounting/Types/VendorCredit.cs +++ b/src/Merge.Client/Accounting/Types/VendorCredit.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCredit diff --git a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForInvoice.cs b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForInvoice.cs index 3cf28b15..a609c55a 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForInvoice.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForInvoice.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditApplyLineForInvoice diff --git a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCredit.cs b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCredit.cs index ec863c54..0d410f71 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCredit.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCredit.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditApplyLineForVendorCredit diff --git a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCreditRequest.cs b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCreditRequest.cs index 24a982df..60474828 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCreditRequest.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditApplyLineForVendorCreditRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditApplyLineForVendorCreditRequest diff --git a/src/Merge.Client/Accounting/Types/VendorCreditLine.cs b/src/Merge.Client/Accounting/Types/VendorCreditLine.cs index 3a3ddf17..850b3a81 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditLine.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditLine.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditLine diff --git a/src/Merge.Client/Accounting/Types/VendorCreditLineRequest.cs b/src/Merge.Client/Accounting/Types/VendorCreditLineRequest.cs index b193bb65..50783f69 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditLineRequest.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditLineRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditLineRequest diff --git a/src/Merge.Client/Accounting/Types/VendorCreditRequest.cs b/src/Merge.Client/Accounting/Types/VendorCreditRequest.cs index b0ced813..ff2e602e 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditRequest.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditRequest diff --git a/src/Merge.Client/Accounting/Types/VendorCreditResponse.cs b/src/Merge.Client/Accounting/Types/VendorCreditResponse.cs index 838c9e2d..d5132731 100644 --- a/src/Merge.Client/Accounting/Types/VendorCreditResponse.cs +++ b/src/Merge.Client/Accounting/Types/VendorCreditResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditResponse diff --git a/src/Merge.Client/Accounting/Types/WarningValidationProblem.cs b/src/Merge.Client/Accounting/Types/WarningValidationProblem.cs index a7577d11..9a3778ff 100644 --- a/src/Merge.Client/Accounting/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Accounting/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record WarningValidationProblem diff --git a/src/Merge.Client/Accounting/Types/WebhookReceiver.cs b/src/Merge.Client/Accounting/Types/WebhookReceiver.cs index cecaace2..b73d75f2 100644 --- a/src/Merge.Client/Accounting/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Accounting/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record WebhookReceiver diff --git a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditEndpointRequest.cs b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditEndpointRequest.cs index cd0a3b3e..8ad811cd 100644 --- a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditEndpointRequest.cs +++ b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditEndpointRequest diff --git a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsListRequest.cs b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsListRequest.cs index 2b5c0768..14019b9a 100644 --- a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsListRequest.cs +++ b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditsListRequest diff --git a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsRetrieveRequest.cs b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsRetrieveRequest.cs index 3692467f..e073251a 100644 --- a/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsRetrieveRequest.cs +++ b/src/Merge.Client/Accounting/VendorCredits/Requests/VendorCreditsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record VendorCreditsRetrieveRequest diff --git a/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsListRequestExpand.cs b/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsListRequestExpand.cs index 44bc6776..f39a4e86 100644 --- a/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsListRequestExpand.cs +++ b/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum VendorCreditsListRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsRetrieveRequestExpand.cs b/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsRetrieveRequestExpand.cs index 1c1fbff6..5f350787 100644 --- a/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Accounting/VendorCredits/Types/VendorCreditsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum VendorCreditsRetrieveRequestExpand { [EnumMember(Value = "accounting_period")] diff --git a/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs b/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs index 39afada7..19921866 100644 --- a/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs +++ b/src/Merge.Client/Accounting/VendorCredits/VendorCreditsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class VendorCreditsClient @@ -24,7 +22,7 @@ internal VendorCreditsClient(RawClient client) /// await client.Accounting.VendorCredits.ListAsync(new VendorCreditsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( VendorCreditsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/vendor-credits", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/vendor-credits", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( VendorCreditEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,25 +147,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/vendor-credits", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/vendor-credits", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +197,7 @@ public async Task CreateAsync( /// await client.Accounting.VendorCredits.RetrieveAsync("id", new VendorCreditsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, VendorCreditsRetrieveRequest request, RequestOptions? options = null, @@ -208,19 +211,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"accounting/v1/vendor-credits/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"accounting/v1/vendor-credits/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -249,21 +254,23 @@ public async Task RetrieveAsync( /// await client.Accounting.VendorCredits.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/vendor-credits/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/vendor-credits/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Accounting/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Accounting/WebhookReceivers/Requests/WebhookReceiverRequest.cs index e6887292..97712036 100644 --- a/src/Merge.Client/Accounting/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Accounting/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs index 16d1a5c8..75bfed4c 100644 --- a/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Accounting/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Accounting; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Accounting.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "accounting/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "accounting/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "accounting/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "accounting/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs index b82d95c9..5e2e8d42 100644 --- a/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Ats/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Ats.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs index d87399b9..2a11225f 100644 --- a/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Ats/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Ats.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Activities/ActivitiesClient.cs b/src/Merge.Client/Ats/Activities/ActivitiesClient.cs index e558b134..fec218c1 100644 --- a/src/Merge.Client/Ats/Activities/ActivitiesClient.cs +++ b/src/Merge.Client/Ats/Activities/ActivitiesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class ActivitiesClient @@ -24,7 +22,7 @@ internal ActivitiesClient(RawClient client) /// await client.Ats.Activities.ListAsync(new ActivitiesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ActivitiesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["user_id"] = request.UserId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/activities", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/activities", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,7 +134,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( ActivityEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -143,29 +143,32 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/activities", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/activities", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +197,7 @@ public async Task CreateAsync( /// await client.Ats.Activities.RetrieveAsync("id", new ActivitiesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ActivitiesRetrieveRequest request, RequestOptions? options = null, @@ -208,7 +211,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -218,17 +221,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/activities/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/activities/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -257,21 +262,23 @@ public async Task RetrieveAsync( /// await client.Ats.Activities.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/activities/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/activities/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Activities/Requests/ActivitiesListRequest.cs b/src/Merge.Client/Ats/Activities/Requests/ActivitiesListRequest.cs index da7047d7..5a2b6f59 100644 --- a/src/Merge.Client/Ats/Activities/Requests/ActivitiesListRequest.cs +++ b/src/Merge.Client/Ats/Activities/Requests/ActivitiesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ActivitiesListRequest diff --git a/src/Merge.Client/Ats/Activities/Requests/ActivitiesRetrieveRequest.cs b/src/Merge.Client/Ats/Activities/Requests/ActivitiesRetrieveRequest.cs index 927b2a39..e485f5da 100644 --- a/src/Merge.Client/Ats/Activities/Requests/ActivitiesRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Activities/Requests/ActivitiesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ActivitiesRetrieveRequest diff --git a/src/Merge.Client/Ats/Activities/Requests/ActivityEndpointRequest.cs b/src/Merge.Client/Ats/Activities/Requests/ActivityEndpointRequest.cs index d201f0a1..e6ab0195 100644 --- a/src/Merge.Client/Ats/Activities/Requests/ActivityEndpointRequest.cs +++ b/src/Merge.Client/Ats/Activities/Requests/ActivityEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ActivityEndpointRequest diff --git a/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestRemoteFields.cs b/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestRemoteFields.cs index 322e4293..6a43d626 100644 --- a/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestRemoteFields.cs +++ b/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivitiesListRequestRemoteFields { [EnumMember(Value = "activity_type")] diff --git a/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestShowEnumOrigins.cs b/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestShowEnumOrigins.cs index f96fced9..5e3cad99 100644 --- a/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ats/Activities/Types/ActivitiesListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivitiesListRequestShowEnumOrigins { [EnumMember(Value = "activity_type")] diff --git a/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestRemoteFields.cs b/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestRemoteFields.cs index 683a80c8..0c891050 100644 --- a/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivitiesRetrieveRequestRemoteFields { [EnumMember(Value = "activity_type")] diff --git a/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestShowEnumOrigins.cs index 467ca8b0..c164c5c2 100644 --- a/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ats/Activities/Types/ActivitiesRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivitiesRetrieveRequestShowEnumOrigins { [EnumMember(Value = "activity_type")] diff --git a/src/Merge.Client/Ats/Applications/ApplicationsClient.cs b/src/Merge.Client/Ats/Applications/ApplicationsClient.cs index f0b61f59..f0079e4e 100644 --- a/src/Merge.Client/Ats/Applications/ApplicationsClient.cs +++ b/src/Merge.Client/Ats/Applications/ApplicationsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class ApplicationsClient @@ -24,7 +22,7 @@ internal ApplicationsClient(RawClient client) /// await client.Ats.Applications.ListAsync(new ApplicationsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ApplicationsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,15 +61,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.JobId != null) { @@ -91,7 +89,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RejectReasonId != null) { @@ -105,17 +103,19 @@ public async Task ListAsync( { _query["source"] = request.Source; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/applications", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/applications", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -153,7 +153,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( ApplicationEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -162,29 +162,32 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/applications", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/applications", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -213,7 +216,7 @@ public async Task CreateAsync( /// await client.Ats.Applications.RetrieveAsync("id", new ApplicationsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ApplicationsRetrieveRequest request, RequestOptions? options = null, @@ -227,19 +230,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/applications/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/applications/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -268,7 +273,7 @@ public async Task RetrieveAsync( /// await client.Ats.Applications.ChangeStageCreateAsync("id", new UpdateApplicationStageRequest()); /// /// - public async Task ChangeStageCreateAsync( + public async System.Threading.Tasks.Task ChangeStageCreateAsync( string id, UpdateApplicationStageRequest request, RequestOptions? options = null, @@ -278,29 +283,32 @@ public async Task ChangeStageCreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "job_interview_stage", request.JobInterviewStage }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"ats/v1/applications/{id}/change-stage", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"ats/v1/applications/{id}/change-stage", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -329,7 +337,7 @@ public async Task ChangeStageCreateAsync( /// await client.Ats.Applications.MetaPostRetrieveAsync(new ApplicationsMetaPostRetrieveRequest()); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( ApplicationsMetaPostRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -340,17 +348,19 @@ public async Task MetaPostRetrieveAsync( { _query["application_remote_template_id"] = request.ApplicationRemoteTemplateId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/applications/meta/post", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/applications/meta/post", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Applications/Requests/ApplicationEndpointRequest.cs b/src/Merge.Client/Ats/Applications/Requests/ApplicationEndpointRequest.cs index eb85e0b7..1921e06a 100644 --- a/src/Merge.Client/Ats/Applications/Requests/ApplicationEndpointRequest.cs +++ b/src/Merge.Client/Ats/Applications/Requests/ApplicationEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationEndpointRequest diff --git a/src/Merge.Client/Ats/Applications/Requests/ApplicationsListRequest.cs b/src/Merge.Client/Ats/Applications/Requests/ApplicationsListRequest.cs index 562fc0a8..885603f3 100644 --- a/src/Merge.Client/Ats/Applications/Requests/ApplicationsListRequest.cs +++ b/src/Merge.Client/Ats/Applications/Requests/ApplicationsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationsListRequest diff --git a/src/Merge.Client/Ats/Applications/Requests/ApplicationsMetaPostRetrieveRequest.cs b/src/Merge.Client/Ats/Applications/Requests/ApplicationsMetaPostRetrieveRequest.cs index f6a9cb24..a7e53fc8 100644 --- a/src/Merge.Client/Ats/Applications/Requests/ApplicationsMetaPostRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Applications/Requests/ApplicationsMetaPostRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationsMetaPostRetrieveRequest diff --git a/src/Merge.Client/Ats/Applications/Requests/ApplicationsRetrieveRequest.cs b/src/Merge.Client/Ats/Applications/Requests/ApplicationsRetrieveRequest.cs index ffe1a4b3..7b1c1d43 100644 --- a/src/Merge.Client/Ats/Applications/Requests/ApplicationsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Applications/Requests/ApplicationsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationsRetrieveRequest diff --git a/src/Merge.Client/Ats/Applications/Requests/UpdateApplicationStageRequest.cs b/src/Merge.Client/Ats/Applications/Requests/UpdateApplicationStageRequest.cs index d819d395..e0ca8f5e 100644 --- a/src/Merge.Client/Ats/Applications/Requests/UpdateApplicationStageRequest.cs +++ b/src/Merge.Client/Ats/Applications/Requests/UpdateApplicationStageRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record UpdateApplicationStageRequest diff --git a/src/Merge.Client/Ats/Applications/Types/ApplicationsListRequestExpand.cs b/src/Merge.Client/Ats/Applications/Types/ApplicationsListRequestExpand.cs index 8dbbce76..6329c3a7 100644 --- a/src/Merge.Client/Ats/Applications/Types/ApplicationsListRequestExpand.cs +++ b/src/Merge.Client/Ats/Applications/Types/ApplicationsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ApplicationsListRequestExpand { [EnumMember(Value = "candidate")] diff --git a/src/Merge.Client/Ats/Applications/Types/ApplicationsRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Applications/Types/ApplicationsRetrieveRequestExpand.cs index 1b134a15..e92e301e 100644 --- a/src/Merge.Client/Ats/Applications/Types/ApplicationsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Applications/Types/ApplicationsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ApplicationsRetrieveRequestExpand { [EnumMember(Value = "candidate")] diff --git a/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs index 21e7198c..ea8b1526 100644 --- a/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Ats/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Ats.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/AtsClient.cs b/src/Merge.Client/Ats/AtsClient.cs index 549ceeee..19a25c09 100644 --- a/src/Merge.Client/Ats/AtsClient.cs +++ b/src/Merge.Client/Ats/AtsClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AtsClient diff --git a/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs b/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs index 0dde58ae..3007b540 100644 --- a/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Ats/Attachments/AttachmentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AttachmentsClient @@ -24,7 +22,7 @@ internal AttachmentsClient(RawClient client) /// await client.Ats.Attachments.ListAsync(new AttachmentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AttachmentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/attachments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/attachments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( AttachmentEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,29 +147,32 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/attachments", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/attachments", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -198,7 +201,7 @@ public async Task CreateAsync( /// await client.Ats.Attachments.RetrieveAsync("id", new AttachmentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AttachmentsRetrieveRequest request, RequestOptions? options = null, @@ -212,7 +215,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -222,17 +225,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/attachments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/attachments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -261,21 +266,23 @@ public async Task RetrieveAsync( /// await client.Ats.Attachments.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/attachments/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/attachments/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Attachments/Requests/AttachmentEndpointRequest.cs b/src/Merge.Client/Ats/Attachments/Requests/AttachmentEndpointRequest.cs index 66423f15..3f936d97 100644 --- a/src/Merge.Client/Ats/Attachments/Requests/AttachmentEndpointRequest.cs +++ b/src/Merge.Client/Ats/Attachments/Requests/AttachmentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AttachmentEndpointRequest diff --git a/src/Merge.Client/Ats/Attachments/Requests/AttachmentsListRequest.cs b/src/Merge.Client/Ats/Attachments/Requests/AttachmentsListRequest.cs index b0b4218a..1cebd471 100644 --- a/src/Merge.Client/Ats/Attachments/Requests/AttachmentsListRequest.cs +++ b/src/Merge.Client/Ats/Attachments/Requests/AttachmentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AttachmentsListRequest diff --git a/src/Merge.Client/Ats/Attachments/Requests/AttachmentsRetrieveRequest.cs b/src/Merge.Client/Ats/Attachments/Requests/AttachmentsRetrieveRequest.cs index 7f0bf8e5..c79f3718 100644 --- a/src/Merge.Client/Ats/Attachments/Requests/AttachmentsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Attachments/Requests/AttachmentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AttachmentsRetrieveRequest diff --git a/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs index d5321c10..2919909f 100644 --- a/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Ats/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Ats.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Ats/AuditTrail/Requests/AuditTrailListRequest.cs index 140d4a4d..75771c9e 100644 --- a/src/Merge.Client/Ats/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Ats/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AuditTrailListRequest diff --git a/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs index 4bbb666b..a3f6be17 100644 --- a/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Ats/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Ats.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Candidates/CandidatesClient.cs b/src/Merge.Client/Ats/Candidates/CandidatesClient.cs index 8d0114ec..d0bb2965 100644 --- a/src/Merge.Client/Ats/Candidates/CandidatesClient.cs +++ b/src/Merge.Client/Ats/Candidates/CandidatesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class CandidatesClient @@ -24,7 +22,7 @@ internal CandidatesClient(RawClient client) /// await client.Ats.Candidates.ListAsync(new CandidatesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CandidatesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,15 +57,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.LastName != null) { @@ -87,7 +85,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["tags"] = request.Tags; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/candidates", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/candidates", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( CandidateEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,29 +147,32 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/candidates", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/candidates", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -198,7 +201,7 @@ public async Task CreateAsync( /// await client.Ats.Candidates.RetrieveAsync("id", new CandidatesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CandidatesRetrieveRequest request, RequestOptions? options = null, @@ -212,19 +215,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/candidates/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/candidates/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -260,7 +265,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedCandidateEndpointRequest request, RequestOptions? options = null, @@ -270,29 +275,32 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"ats/v1/candidates/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"ats/v1/candidates/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -334,17 +342,20 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"ats/v1/candidates/ignore/{modelId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"ats/v1/candidates/ignore/{modelId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; @@ -365,22 +376,24 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( /// await client.Ats.Candidates.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/candidates/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/candidates/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -409,21 +422,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Ats.Candidates.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/candidates/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/candidates/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Candidates/Requests/CandidateEndpointRequest.cs b/src/Merge.Client/Ats/Candidates/Requests/CandidateEndpointRequest.cs index 962d85a1..7fe9da29 100644 --- a/src/Merge.Client/Ats/Candidates/Requests/CandidateEndpointRequest.cs +++ b/src/Merge.Client/Ats/Candidates/Requests/CandidateEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CandidateEndpointRequest diff --git a/src/Merge.Client/Ats/Candidates/Requests/CandidatesListRequest.cs b/src/Merge.Client/Ats/Candidates/Requests/CandidatesListRequest.cs index a8eb5ee0..a3ec3b5b 100644 --- a/src/Merge.Client/Ats/Candidates/Requests/CandidatesListRequest.cs +++ b/src/Merge.Client/Ats/Candidates/Requests/CandidatesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CandidatesListRequest diff --git a/src/Merge.Client/Ats/Candidates/Requests/CandidatesRetrieveRequest.cs b/src/Merge.Client/Ats/Candidates/Requests/CandidatesRetrieveRequest.cs index 074236b3..c8616887 100644 --- a/src/Merge.Client/Ats/Candidates/Requests/CandidatesRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Candidates/Requests/CandidatesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CandidatesRetrieveRequest diff --git a/src/Merge.Client/Ats/Candidates/Requests/IgnoreCommonModelRequest.cs b/src/Merge.Client/Ats/Candidates/Requests/IgnoreCommonModelRequest.cs index 48027ac3..dbed412b 100644 --- a/src/Merge.Client/Ats/Candidates/Requests/IgnoreCommonModelRequest.cs +++ b/src/Merge.Client/Ats/Candidates/Requests/IgnoreCommonModelRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record IgnoreCommonModelRequest diff --git a/src/Merge.Client/Ats/Candidates/Requests/PatchedCandidateEndpointRequest.cs b/src/Merge.Client/Ats/Candidates/Requests/PatchedCandidateEndpointRequest.cs index 0388011c..2d854152 100644 --- a/src/Merge.Client/Ats/Candidates/Requests/PatchedCandidateEndpointRequest.cs +++ b/src/Merge.Client/Ats/Candidates/Requests/PatchedCandidateEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PatchedCandidateEndpointRequest diff --git a/src/Merge.Client/Ats/Candidates/Types/CandidatesListRequestExpand.cs b/src/Merge.Client/Ats/Candidates/Types/CandidatesListRequestExpand.cs index 72815363..9f75d9a2 100644 --- a/src/Merge.Client/Ats/Candidates/Types/CandidatesListRequestExpand.cs +++ b/src/Merge.Client/Ats/Candidates/Types/CandidatesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CandidatesListRequestExpand { [EnumMember(Value = "applications")] diff --git a/src/Merge.Client/Ats/Candidates/Types/CandidatesRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Candidates/Types/CandidatesRetrieveRequestExpand.cs index 5e5c50e3..3184ff8b 100644 --- a/src/Merge.Client/Ats/Candidates/Types/CandidatesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Candidates/Types/CandidatesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CandidatesRetrieveRequestExpand { [EnumMember(Value = "applications")] diff --git a/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs index a87dd7df..1dae323d 100644 --- a/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Ats/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Ats/Departments/DepartmentsClient.cs b/src/Merge.Client/Ats/Departments/DepartmentsClient.cs index 83850a29..819e47e8 100644 --- a/src/Merge.Client/Ats/Departments/DepartmentsClient.cs +++ b/src/Merge.Client/Ats/Departments/DepartmentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class DepartmentsClient @@ -24,7 +22,7 @@ internal DepartmentsClient(RawClient client) /// await client.Ats.Departments.ListAsync(new DepartmentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( DepartmentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/departments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/departments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ats.Departments.RetrieveAsync("id", new DepartmentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, DepartmentsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/departments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/departments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Departments/Requests/DepartmentsListRequest.cs b/src/Merge.Client/Ats/Departments/Requests/DepartmentsListRequest.cs index 089a3e8c..035220cb 100644 --- a/src/Merge.Client/Ats/Departments/Requests/DepartmentsListRequest.cs +++ b/src/Merge.Client/Ats/Departments/Requests/DepartmentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record DepartmentsListRequest diff --git a/src/Merge.Client/Ats/Departments/Requests/DepartmentsRetrieveRequest.cs b/src/Merge.Client/Ats/Departments/Requests/DepartmentsRetrieveRequest.cs index 7ed2fafd..e737b282 100644 --- a/src/Merge.Client/Ats/Departments/Requests/DepartmentsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Departments/Requests/DepartmentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record DepartmentsRetrieveRequest diff --git a/src/Merge.Client/Ats/Eeocs/EeocsClient.cs b/src/Merge.Client/Ats/Eeocs/EeocsClient.cs index 4da5d65b..faa8d122 100644 --- a/src/Merge.Client/Ats/Eeocs/EeocsClient.cs +++ b/src/Merge.Client/Ats/Eeocs/EeocsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class EeocsClient @@ -24,7 +22,7 @@ internal EeocsClient(RawClient client) /// await client.Ats.Eeocs.ListAsync(new EeocsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EeocsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/eeocs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/eeocs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -132,7 +132,7 @@ public async Task ListAsync( /// await client.Ats.Eeocs.RetrieveAsync("id", new EeocsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EeocsRetrieveRequest request, RequestOptions? options = null, @@ -146,7 +146,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -156,17 +156,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/eeocs/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/eeocs/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Eeocs/Requests/EeocsListRequest.cs b/src/Merge.Client/Ats/Eeocs/Requests/EeocsListRequest.cs index 28f21f89..047f7de8 100644 --- a/src/Merge.Client/Ats/Eeocs/Requests/EeocsListRequest.cs +++ b/src/Merge.Client/Ats/Eeocs/Requests/EeocsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record EeocsListRequest diff --git a/src/Merge.Client/Ats/Eeocs/Requests/EeocsRetrieveRequest.cs b/src/Merge.Client/Ats/Eeocs/Requests/EeocsRetrieveRequest.cs index 89607fe8..02d05544 100644 --- a/src/Merge.Client/Ats/Eeocs/Requests/EeocsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Eeocs/Requests/EeocsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record EeocsRetrieveRequest diff --git a/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestRemoteFields.cs b/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestRemoteFields.cs index cc2fc5b4..1cb6ea92 100644 --- a/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestRemoteFields.cs +++ b/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EeocsListRequestRemoteFields { [EnumMember(Value = "disability_status")] diff --git a/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestShowEnumOrigins.cs b/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestShowEnumOrigins.cs index ae994ca7..d1954d0c 100644 --- a/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ats/Eeocs/Types/EeocsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EeocsListRequestShowEnumOrigins { [EnumMember(Value = "disability_status")] diff --git a/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestRemoteFields.cs index 5e48a9b9..06c5ae50 100644 --- a/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EeocsRetrieveRequestRemoteFields { [EnumMember(Value = "disability_status")] diff --git a/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestShowEnumOrigins.cs index 11881c7e..07934bbe 100644 --- a/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ats/Eeocs/Types/EeocsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EeocsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "disability_status")] diff --git a/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs index d2cbc7cf..8a272925 100644 --- a/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Ats/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class FieldMappingClient @@ -24,7 +22,7 @@ internal FieldMappingClient(RawClient client) /// await client.Ats.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -33,19 +31,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,7 +78,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -84,7 +86,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -93,7 +95,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -104,18 +108,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,22 +151,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Ats.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"ats/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"ats/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,24 +200,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"ats/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"ats/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -237,7 +249,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Ats.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -252,17 +264,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -291,21 +305,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Ats.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Ats/FieldMapping/Requests/CreateFieldMappingRequest.cs index 79dc35ee..8808815d 100644 --- a/src/Merge.Client/Ats/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Ats/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Ats/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Ats/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index be0fdeab..c697220d 100644 --- a/src/Merge.Client/Ats/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Ats/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Ats/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index 9555f8e2..0b3b2305 100644 --- a/src/Merge.Client/Ats/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Ats/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Ats/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Ats/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index 67497472..f40c015b 100644 --- a/src/Merge.Client/Ats/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs index 16e2ab84..aefde2e7 100644 --- a/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Ats/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Ats.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs index 213628f3..c8f2123c 100644 --- a/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Ats/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Ats/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index 58d325f1..c9f5cf48 100644 --- a/src/Merge.Client/Ats/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Ats/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Ats/Interviews/InterviewsClient.cs b/src/Merge.Client/Ats/Interviews/InterviewsClient.cs index b43202c8..f9260605 100644 --- a/src/Merge.Client/Ats/Interviews/InterviewsClient.cs +++ b/src/Merge.Client/Ats/Interviews/InterviewsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class InterviewsClient @@ -24,7 +22,7 @@ internal InterviewsClient(RawClient client) /// await client.Ats.Interviews.ListAsync(new InterviewsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( InterviewsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.JobId != null) { @@ -91,7 +89,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -105,17 +103,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/interviews", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/interviews", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -150,7 +150,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( ScheduledInterviewEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -159,29 +159,32 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model }, { "remote_user_id", request.RemoteUserId }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/interviews", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/interviews", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -210,7 +213,7 @@ public async Task CreateAsync( /// await client.Ats.Interviews.RetrieveAsync("id", new InterviewsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, InterviewsRetrieveRequest request, RequestOptions? options = null, @@ -224,7 +227,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -234,17 +237,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/interviews/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/interviews/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -273,21 +278,23 @@ public async Task RetrieveAsync( /// await client.Ats.Interviews.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/interviews/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/interviews/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Interviews/Requests/InterviewsListRequest.cs b/src/Merge.Client/Ats/Interviews/Requests/InterviewsListRequest.cs index 237f7bf5..6f38851d 100644 --- a/src/Merge.Client/Ats/Interviews/Requests/InterviewsListRequest.cs +++ b/src/Merge.Client/Ats/Interviews/Requests/InterviewsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record InterviewsListRequest diff --git a/src/Merge.Client/Ats/Interviews/Requests/InterviewsRetrieveRequest.cs b/src/Merge.Client/Ats/Interviews/Requests/InterviewsRetrieveRequest.cs index 48822993..caf8dd02 100644 --- a/src/Merge.Client/Ats/Interviews/Requests/InterviewsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Interviews/Requests/InterviewsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record InterviewsRetrieveRequest diff --git a/src/Merge.Client/Ats/Interviews/Requests/ScheduledInterviewEndpointRequest.cs b/src/Merge.Client/Ats/Interviews/Requests/ScheduledInterviewEndpointRequest.cs index 3df9a946..23ca0711 100644 --- a/src/Merge.Client/Ats/Interviews/Requests/ScheduledInterviewEndpointRequest.cs +++ b/src/Merge.Client/Ats/Interviews/Requests/ScheduledInterviewEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ScheduledInterviewEndpointRequest diff --git a/src/Merge.Client/Ats/Interviews/Types/InterviewsListRequestExpand.cs b/src/Merge.Client/Ats/Interviews/Types/InterviewsListRequestExpand.cs index 6ef7fbc3..653d92ea 100644 --- a/src/Merge.Client/Ats/Interviews/Types/InterviewsListRequestExpand.cs +++ b/src/Merge.Client/Ats/Interviews/Types/InterviewsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InterviewsListRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/Interviews/Types/InterviewsRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Interviews/Types/InterviewsRetrieveRequestExpand.cs index daefcbd5..36910242 100644 --- a/src/Merge.Client/Ats/Interviews/Types/InterviewsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Interviews/Types/InterviewsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum InterviewsRetrieveRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/Issues/IssuesClient.cs b/src/Merge.Client/Ats/Issues/IssuesClient.cs index d95459b1..068b56a1 100644 --- a/src/Merge.Client/Ats/Issues/IssuesClient.cs +++ b/src/Merge.Client/Ats/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Ats.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Ats.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Ats/Issues/Requests/IssuesListRequest.cs index d9cbebbe..eae7a8c3 100644 --- a/src/Merge.Client/Ats/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Ats/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record IssuesListRequest diff --git a/src/Merge.Client/Ats/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Ats/Issues/Types/IssuesListRequestStatus.cs index e81ffd74..63922149 100644 --- a/src/Merge.Client/Ats/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Ats/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs b/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs index 8a69275d..f90dc042 100644 --- a/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs +++ b/src/Merge.Client/Ats/JobInterviewStages/JobInterviewStagesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class JobInterviewStagesClient @@ -24,7 +22,7 @@ internal JobInterviewStagesClient(RawClient client) /// await client.Ats.JobInterviewStages.ListAsync(new JobInterviewStagesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( JobInterviewStagesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.JobId != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/job-interview-stages", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/job-interview-stages", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Ats.JobInterviewStages.RetrieveAsync("id", new JobInterviewStagesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, JobInterviewStagesRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/job-interview-stages/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/job-interview-stages/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesListRequest.cs b/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesListRequest.cs index d3dce1b1..651b1a1e 100644 --- a/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesListRequest.cs +++ b/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobInterviewStagesListRequest diff --git a/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesRetrieveRequest.cs b/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesRetrieveRequest.cs index 84f800c1..73e94489 100644 --- a/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesRetrieveRequest.cs +++ b/src/Merge.Client/Ats/JobInterviewStages/Requests/JobInterviewStagesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobInterviewStagesRetrieveRequest diff --git a/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs b/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs index abc2d4c8..20cd81c3 100644 --- a/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs +++ b/src/Merge.Client/Ats/JobPostings/JobPostingsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class JobPostingsClient @@ -24,7 +22,7 @@ internal JobPostingsClient(RawClient client) /// await client.Ats.JobPostings.ListAsync(new JobPostingsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( JobPostingsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -85,17 +83,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/job-postings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/job-postings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Ats.JobPostings.RetrieveAsync("id", new JobPostingsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, JobPostingsRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/job-postings/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/job-postings/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsListRequest.cs b/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsListRequest.cs index 27454aa2..51833b82 100644 --- a/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsListRequest.cs +++ b/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobPostingsListRequest diff --git a/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsRetrieveRequest.cs b/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsRetrieveRequest.cs index e8345983..ee2c7780 100644 --- a/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/JobPostings/Requests/JobPostingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobPostingsRetrieveRequest diff --git a/src/Merge.Client/Ats/JobPostings/Types/JobPostingsListRequestStatus.cs b/src/Merge.Client/Ats/JobPostings/Types/JobPostingsListRequestStatus.cs index 5b5efd06..87dad416 100644 --- a/src/Merge.Client/Ats/JobPostings/Types/JobPostingsListRequestStatus.cs +++ b/src/Merge.Client/Ats/JobPostings/Types/JobPostingsListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobPostingsListRequestStatus { [EnumMember(Value = "CLOSED")] diff --git a/src/Merge.Client/Ats/Jobs/JobsClient.cs b/src/Merge.Client/Ats/Jobs/JobsClient.cs index 987d1137..e49895ce 100644 --- a/src/Merge.Client/Ats/Jobs/JobsClient.cs +++ b/src/Merge.Client/Ats/Jobs/JobsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class JobsClient @@ -24,7 +22,7 @@ internal JobsClient(RawClient client) /// await client.Ats.Jobs.ListAsync(new JobsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( JobsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +81,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -101,17 +99,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/jobs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/jobs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -140,7 +140,7 @@ public async Task ListAsync( /// await client.Ats.Jobs.RetrieveAsync("id", new JobsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, JobsRetrieveRequest request, RequestOptions? options = null, @@ -154,7 +154,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -164,17 +164,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/jobs/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/jobs/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -206,7 +208,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task ScreeningQuestionsListAsync( + public async System.Threading.Tasks.Task ScreeningQuestionsListAsync( string jobId, JobsScreeningQuestionsListRequest request, RequestOptions? options = null, @@ -224,31 +226,33 @@ public async Task ScreeningQuestionsListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/jobs/{jobId}/screening-questions", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/jobs/{jobId}/screening-questions", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Jobs/Requests/JobsListRequest.cs b/src/Merge.Client/Ats/Jobs/Requests/JobsListRequest.cs index b08f8755..bb147a3e 100644 --- a/src/Merge.Client/Ats/Jobs/Requests/JobsListRequest.cs +++ b/src/Merge.Client/Ats/Jobs/Requests/JobsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobsListRequest diff --git a/src/Merge.Client/Ats/Jobs/Requests/JobsRetrieveRequest.cs b/src/Merge.Client/Ats/Jobs/Requests/JobsRetrieveRequest.cs index 2dfbc5bb..c65f212b 100644 --- a/src/Merge.Client/Ats/Jobs/Requests/JobsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Jobs/Requests/JobsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobsRetrieveRequest diff --git a/src/Merge.Client/Ats/Jobs/Requests/JobsScreeningQuestionsListRequest.cs b/src/Merge.Client/Ats/Jobs/Requests/JobsScreeningQuestionsListRequest.cs index 53ba6878..cc5a0a34 100644 --- a/src/Merge.Client/Ats/Jobs/Requests/JobsScreeningQuestionsListRequest.cs +++ b/src/Merge.Client/Ats/Jobs/Requests/JobsScreeningQuestionsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record JobsScreeningQuestionsListRequest diff --git a/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs b/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs index 4a6f6815..c3353c2e 100644 --- a/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs +++ b/src/Merge.Client/Ats/Jobs/Types/JobsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobsListRequestExpand { [EnumMember(Value = "departments")] diff --git a/src/Merge.Client/Ats/Jobs/Types/JobsListRequestStatus.cs b/src/Merge.Client/Ats/Jobs/Types/JobsListRequestStatus.cs index 6f815815..acf1cc1d 100644 --- a/src/Merge.Client/Ats/Jobs/Types/JobsListRequestStatus.cs +++ b/src/Merge.Client/Ats/Jobs/Types/JobsListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobsListRequestStatus { [EnumMember(Value = "ARCHIVED")] diff --git a/src/Merge.Client/Ats/Jobs/Types/JobsRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Jobs/Types/JobsRetrieveRequestExpand.cs index 0f788632..4d9efc71 100644 --- a/src/Merge.Client/Ats/Jobs/Types/JobsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Jobs/Types/JobsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobsRetrieveRequestExpand { [EnumMember(Value = "departments")] diff --git a/src/Merge.Client/Ats/Jobs/Types/JobsScreeningQuestionsListRequestExpand.cs b/src/Merge.Client/Ats/Jobs/Types/JobsScreeningQuestionsListRequestExpand.cs index 7870a1f9..aa411888 100644 --- a/src/Merge.Client/Ats/Jobs/Types/JobsScreeningQuestionsListRequestExpand.cs +++ b/src/Merge.Client/Ats/Jobs/Types/JobsScreeningQuestionsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobsScreeningQuestionsListRequestExpand { [EnumMember(Value = "job")] diff --git a/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs index 1bf3b1b0..813d78a4 100644 --- a/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Ats/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Ats.CategoriesEnum>() /// { /// Merge.Client.Ats.CategoriesEnum.Hris, /// Merge.Client.Ats.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Ats/LinkToken/Requests/EndUserDetailsRequest.cs index 4e29401c..79321f81 100644 --- a/src/Merge.Client/Ats/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Ats/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs index 29595108..8f50bb7d 100644 --- a/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Ats/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Ats.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Ats/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index 27bd708a..28c86904 100644 --- a/src/Merge.Client/Ats/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Ats/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Ats/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Ats/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index 103193e1..5b4c0d79 100644 --- a/src/Merge.Client/Ats/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Ats/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Ats/Offers/OffersClient.cs b/src/Merge.Client/Ats/Offers/OffersClient.cs index 2c3e5163..e87170b8 100644 --- a/src/Merge.Client/Ats/Offers/OffersClient.cs +++ b/src/Merge.Client/Ats/Offers/OffersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class OffersClient @@ -24,7 +22,7 @@ internal OffersClient(RawClient client) /// await client.Ats.Offers.ListAsync(new OffersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( OffersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,15 +57,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +81,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/offers", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/offers", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Ats.Offers.RetrieveAsync("id", new OffersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, OffersRetrieveRequest request, RequestOptions? options = null, @@ -150,7 +150,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -160,17 +160,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/offers/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/offers/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Offers/Requests/OffersListRequest.cs b/src/Merge.Client/Ats/Offers/Requests/OffersListRequest.cs index 28ce6daf..28678c31 100644 --- a/src/Merge.Client/Ats/Offers/Requests/OffersListRequest.cs +++ b/src/Merge.Client/Ats/Offers/Requests/OffersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record OffersListRequest diff --git a/src/Merge.Client/Ats/Offers/Requests/OffersRetrieveRequest.cs b/src/Merge.Client/Ats/Offers/Requests/OffersRetrieveRequest.cs index a780e716..f2633480 100644 --- a/src/Merge.Client/Ats/Offers/Requests/OffersRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Offers/Requests/OffersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record OffersRetrieveRequest diff --git a/src/Merge.Client/Ats/Offers/Types/OffersListRequestExpand.cs b/src/Merge.Client/Ats/Offers/Types/OffersListRequestExpand.cs index 95bd87c1..40307169 100644 --- a/src/Merge.Client/Ats/Offers/Types/OffersListRequestExpand.cs +++ b/src/Merge.Client/Ats/Offers/Types/OffersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OffersListRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/Offers/Types/OffersRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Offers/Types/OffersRetrieveRequestExpand.cs index ca398155..48b83129 100644 --- a/src/Merge.Client/Ats/Offers/Types/OffersRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Offers/Types/OffersRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OffersRetrieveRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/Offices/OfficesClient.cs b/src/Merge.Client/Ats/Offices/OfficesClient.cs index 83c24564..e0cc57b4 100644 --- a/src/Merge.Client/Ats/Offices/OfficesClient.cs +++ b/src/Merge.Client/Ats/Offices/OfficesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class OfficesClient @@ -24,7 +22,7 @@ internal OfficesClient(RawClient client) /// await client.Ats.Offices.ListAsync(new OfficesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( OfficesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/offices", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/offices", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ats.Offices.RetrieveAsync("id", new OfficesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, OfficesRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/offices/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/offices/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Offices/Requests/OfficesListRequest.cs b/src/Merge.Client/Ats/Offices/Requests/OfficesListRequest.cs index 43bcb0cd..b75c0694 100644 --- a/src/Merge.Client/Ats/Offices/Requests/OfficesListRequest.cs +++ b/src/Merge.Client/Ats/Offices/Requests/OfficesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record OfficesListRequest diff --git a/src/Merge.Client/Ats/Offices/Requests/OfficesRetrieveRequest.cs b/src/Merge.Client/Ats/Offices/Requests/OfficesRetrieveRequest.cs index 3ef7af47..56355e0c 100644 --- a/src/Merge.Client/Ats/Offices/Requests/OfficesRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Offices/Requests/OfficesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record OfficesRetrieveRequest diff --git a/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs b/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs index 2f18be1e..3f022f14 100644 --- a/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Ats/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs index 4afebb5e..6a5895e8 100644 --- a/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Ats/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Ats/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index d4e7be40..0a9b16af 100644 --- a/src/Merge.Client/Ats/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Ats/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs b/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs index e468fe73..889f446e 100644 --- a/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs +++ b/src/Merge.Client/Ats/RejectReasons/RejectReasonsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class RejectReasonsClient @@ -24,7 +22,7 @@ internal RejectReasonsClient(RawClient client) /// await client.Ats.RejectReasons.ListAsync(new RejectReasonsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( RejectReasonsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/reject-reasons", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/reject-reasons", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ats.RejectReasons.RetrieveAsync("id", new RejectReasonsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RejectReasonsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/reject-reasons/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/reject-reasons/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsListRequest.cs b/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsListRequest.cs index f5debaaf..79915ed6 100644 --- a/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsListRequest.cs +++ b/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RejectReasonsListRequest diff --git a/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsRetrieveRequest.cs b/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsRetrieveRequest.cs index 3c0b291f..0ca2658d 100644 --- a/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/RejectReasons/Requests/RejectReasonsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RejectReasonsRetrieveRequest diff --git a/src/Merge.Client/Ats/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Ats/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index ea9bee8a..efedb260 100644 --- a/src/Merge.Client/Ats/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Ats/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Ats/Scopes/ScopesClient.cs b/src/Merge.Client/Ats/Scopes/ScopesClient.cs index 49cf6e23..3f1f7147 100644 --- a/src/Merge.Client/Ats/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Ats/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Ats.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Ats.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -110,15 +112,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// await client.Ats.Scopes.LinkedAccountScopesCreateAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { - /// CommonModels = new List() + /// CommonModels = new List<Merge.Client.Ats.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Ats.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Ats.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -134,17 +136,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// }, /// FieldPermissions = new Merge.Client.Ats.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Ats.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Ats.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -160,23 +162,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsListRequest.cs b/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsListRequest.cs index 6ebaa588..01ac2abc 100644 --- a/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsListRequest.cs +++ b/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ScorecardsListRequest diff --git a/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsRetrieveRequest.cs b/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsRetrieveRequest.cs index ce6397c2..dcfd8f82 100644 --- a/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Scorecards/Requests/ScorecardsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ScorecardsRetrieveRequest diff --git a/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs b/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs index 6ed6e16a..f6bbe4ec 100644 --- a/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs +++ b/src/Merge.Client/Ats/Scorecards/ScorecardsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class ScorecardsClient @@ -24,7 +22,7 @@ internal ScorecardsClient(RawClient client) /// await client.Ats.Scorecards.ListAsync(new ScorecardsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ScorecardsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.InterviewId != null) { @@ -87,7 +85,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -101,17 +99,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/scorecards", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/scorecards", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -140,7 +140,7 @@ public async Task ListAsync( /// await client.Ats.Scorecards.RetrieveAsync("id", new ScorecardsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ScorecardsRetrieveRequest request, RequestOptions? options = null, @@ -154,7 +154,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -164,17 +164,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/scorecards/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/scorecards/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Scorecards/Types/ScorecardsListRequestExpand.cs b/src/Merge.Client/Ats/Scorecards/Types/ScorecardsListRequestExpand.cs index 87cdfeaa..75841ee7 100644 --- a/src/Merge.Client/Ats/Scorecards/Types/ScorecardsListRequestExpand.cs +++ b/src/Merge.Client/Ats/Scorecards/Types/ScorecardsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ScorecardsListRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/Scorecards/Types/ScorecardsRetrieveRequestExpand.cs b/src/Merge.Client/Ats/Scorecards/Types/ScorecardsRetrieveRequestExpand.cs index 41fb0f72..6022decf 100644 --- a/src/Merge.Client/Ats/Scorecards/Types/ScorecardsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ats/Scorecards/Types/ScorecardsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ScorecardsRetrieveRequestExpand { [EnumMember(Value = "application")] diff --git a/src/Merge.Client/Ats/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Ats/SyncStatus/Requests/SyncStatusListRequest.cs index 81657972..4eb9b46c 100644 --- a/src/Merge.Client/Ats/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Ats/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record SyncStatusListRequest diff --git a/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs index c0b188ea..d1ab45e8 100644 --- a/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Ats/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Ats.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Tags/Requests/TagsListRequest.cs b/src/Merge.Client/Ats/Tags/Requests/TagsListRequest.cs index 027ec212..d93dc073 100644 --- a/src/Merge.Client/Ats/Tags/Requests/TagsListRequest.cs +++ b/src/Merge.Client/Ats/Tags/Requests/TagsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record TagsListRequest diff --git a/src/Merge.Client/Ats/Tags/TagsClient.cs b/src/Merge.Client/Ats/Tags/TagsClient.cs index f246b739..6217c457 100644 --- a/src/Merge.Client/Ats/Tags/TagsClient.cs +++ b/src/Merge.Client/Ats/Tags/TagsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class TagsClient @@ -24,7 +22,7 @@ internal TagsClient(RawClient client) /// await client.Ats.Tags.ListAsync(new TagsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TagsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/tags", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/tags", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/Types/AccessRoleEnum.cs b/src/Merge.Client/Ats/Types/AccessRoleEnum.cs index a4b7ae81..1e12485e 100644 --- a/src/Merge.Client/Ats/Types/AccessRoleEnum.cs +++ b/src/Merge.Client/Ats/Types/AccessRoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccessRoleEnum { [EnumMember(Value = "SUPER_ADMIN")] diff --git a/src/Merge.Client/Ats/Types/AccountDetails.cs b/src/Merge.Client/Ats/Types/AccountDetails.cs index 76a426e5..ca55963a 100644 --- a/src/Merge.Client/Ats/Types/AccountDetails.cs +++ b/src/Merge.Client/Ats/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AccountDetails diff --git a/src/Merge.Client/Ats/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Ats/Types/AccountDetailsAndActions.cs index dcdb88f6..31d9040f 100644 --- a/src/Merge.Client/Ats/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Ats/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Ats/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Ats/Types/AccountDetailsAndActionsIntegration.cs index bc3f2ddd..d8c12913 100644 --- a/src/Merge.Client/Ats/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Ats/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Ats/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Ats/Types/AccountDetailsAndActionsStatusEnum.cs index ec3d099a..3a4a9f0a 100644 --- a/src/Merge.Client/Ats/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Ats/Types/AccountIntegration.cs b/src/Merge.Client/Ats/Types/AccountIntegration.cs index afdaf55e..8728c21d 100644 --- a/src/Merge.Client/Ats/Types/AccountIntegration.cs +++ b/src/Merge.Client/Ats/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Ats/Types/AccountToken.cs b/src/Merge.Client/Ats/Types/AccountToken.cs index c3bf0852..68cc2f2e 100644 --- a/src/Merge.Client/Ats/Types/AccountToken.cs +++ b/src/Merge.Client/Ats/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AccountToken diff --git a/src/Merge.Client/Ats/Types/Activity.cs b/src/Merge.Client/Ats/Types/Activity.cs index 6984bb8d..c7534578 100644 --- a/src/Merge.Client/Ats/Types/Activity.cs +++ b/src/Merge.Client/Ats/Types/Activity.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Activity diff --git a/src/Merge.Client/Ats/Types/ActivityRequest.cs b/src/Merge.Client/Ats/Types/ActivityRequest.cs index 26884c67..43c16605 100644 --- a/src/Merge.Client/Ats/Types/ActivityRequest.cs +++ b/src/Merge.Client/Ats/Types/ActivityRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ActivityRequest diff --git a/src/Merge.Client/Ats/Types/ActivityResponse.cs b/src/Merge.Client/Ats/Types/ActivityResponse.cs index 4f377e51..6efda802 100644 --- a/src/Merge.Client/Ats/Types/ActivityResponse.cs +++ b/src/Merge.Client/Ats/Types/ActivityResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ActivityResponse diff --git a/src/Merge.Client/Ats/Types/ActivityTypeEnum.cs b/src/Merge.Client/Ats/Types/ActivityTypeEnum.cs index 8601b4fc..5ec8696c 100644 --- a/src/Merge.Client/Ats/Types/ActivityTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/ActivityTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivityTypeEnum { [EnumMember(Value = "NOTE")] diff --git a/src/Merge.Client/Ats/Types/AdvancedMetadata.cs b/src/Merge.Client/Ats/Types/AdvancedMetadata.cs index 2014e472..78963455 100644 --- a/src/Merge.Client/Ats/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Ats/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AdvancedMetadata diff --git a/src/Merge.Client/Ats/Types/Application.cs b/src/Merge.Client/Ats/Types/Application.cs index 76382ed9..1b35187e 100644 --- a/src/Merge.Client/Ats/Types/Application.cs +++ b/src/Merge.Client/Ats/Types/Application.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Application diff --git a/src/Merge.Client/Ats/Types/ApplicationRequest.cs b/src/Merge.Client/Ats/Types/ApplicationRequest.cs index f75e1e3f..83ab610a 100644 --- a/src/Merge.Client/Ats/Types/ApplicationRequest.cs +++ b/src/Merge.Client/Ats/Types/ApplicationRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationRequest diff --git a/src/Merge.Client/Ats/Types/ApplicationResponse.cs b/src/Merge.Client/Ats/Types/ApplicationResponse.cs index 4eb286b1..7751aeed 100644 --- a/src/Merge.Client/Ats/Types/ApplicationResponse.cs +++ b/src/Merge.Client/Ats/Types/ApplicationResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ApplicationResponse diff --git a/src/Merge.Client/Ats/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Ats/Types/AsyncPassthroughReciept.cs index 414eaf2e..0a6c6318 100644 --- a/src/Merge.Client/Ats/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Ats/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Ats/Types/Attachment.cs b/src/Merge.Client/Ats/Types/Attachment.cs index 7e9be6b1..71142d39 100644 --- a/src/Merge.Client/Ats/Types/Attachment.cs +++ b/src/Merge.Client/Ats/Types/Attachment.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Attachment diff --git a/src/Merge.Client/Ats/Types/AttachmentRequest.cs b/src/Merge.Client/Ats/Types/AttachmentRequest.cs index 3ace2a9e..633b3f0c 100644 --- a/src/Merge.Client/Ats/Types/AttachmentRequest.cs +++ b/src/Merge.Client/Ats/Types/AttachmentRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AttachmentRequest diff --git a/src/Merge.Client/Ats/Types/AttachmentResponse.cs b/src/Merge.Client/Ats/Types/AttachmentResponse.cs index 80f98ea4..5ce189d4 100644 --- a/src/Merge.Client/Ats/Types/AttachmentResponse.cs +++ b/src/Merge.Client/Ats/Types/AttachmentResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AttachmentResponse diff --git a/src/Merge.Client/Ats/Types/AttachmentTypeEnum.cs b/src/Merge.Client/Ats/Types/AttachmentTypeEnum.cs index 0993705e..431d6d23 100644 --- a/src/Merge.Client/Ats/Types/AttachmentTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/AttachmentTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AttachmentTypeEnum { [EnumMember(Value = "RESUME")] diff --git a/src/Merge.Client/Ats/Types/AuditLogEvent.cs b/src/Merge.Client/Ats/Types/AuditLogEvent.cs index e831a06a..bfb38bd6 100644 --- a/src/Merge.Client/Ats/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Ats/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AuditLogEvent diff --git a/src/Merge.Client/Ats/Types/AvailableActions.cs b/src/Merge.Client/Ats/Types/AvailableActions.cs index ce303dc5..9fbc406e 100644 --- a/src/Merge.Client/Ats/Types/AvailableActions.cs +++ b/src/Merge.Client/Ats/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record AvailableActions diff --git a/src/Merge.Client/Ats/Types/Candidate.cs b/src/Merge.Client/Ats/Types/Candidate.cs index 955a8aee..00fa6a84 100644 --- a/src/Merge.Client/Ats/Types/Candidate.cs +++ b/src/Merge.Client/Ats/Types/Candidate.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Candidate diff --git a/src/Merge.Client/Ats/Types/CandidateRequest.cs b/src/Merge.Client/Ats/Types/CandidateRequest.cs index f38c67ca..69c12c3a 100644 --- a/src/Merge.Client/Ats/Types/CandidateRequest.cs +++ b/src/Merge.Client/Ats/Types/CandidateRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record CandidateRequest diff --git a/src/Merge.Client/Ats/Types/CandidateResponse.cs b/src/Merge.Client/Ats/Types/CandidateResponse.cs index 1a39e0d3..5d4a4f6f 100644 --- a/src/Merge.Client/Ats/Types/CandidateResponse.cs +++ b/src/Merge.Client/Ats/Types/CandidateResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CandidateResponse diff --git a/src/Merge.Client/Ats/Types/CategoriesEnum.cs b/src/Merge.Client/Ats/Types/CategoriesEnum.cs index 4d5c1097..468dfccd 100644 --- a/src/Merge.Client/Ats/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Ats/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Ats/Types/CategoryEnum.cs b/src/Merge.Client/Ats/Types/CategoryEnum.cs index 46b5c41a..8a4c264e 100644 --- a/src/Merge.Client/Ats/Types/CategoryEnum.cs +++ b/src/Merge.Client/Ats/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Ats/Types/CommonModelScopeApi.cs b/src/Merge.Client/Ats/Types/CommonModelScopeApi.cs index 1ac48d17..386e03d2 100644 --- a/src/Merge.Client/Ats/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Ats/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CommonModelScopeApi diff --git a/src/Merge.Client/Ats/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Ats/Types/CommonModelScopesBodyRequest.cs index 9c14139a..ecfaa919 100644 --- a/src/Merge.Client/Ats/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Ats/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Ats/Types/DataPassthroughRequest.cs b/src/Merge.Client/Ats/Types/DataPassthroughRequest.cs index b740931f..8f78b109 100644 --- a/src/Merge.Client/Ats/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Ats/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record DataPassthroughRequest diff --git a/src/Merge.Client/Ats/Types/DebugModeLog.cs b/src/Merge.Client/Ats/Types/DebugModeLog.cs index c7c84387..3993e0c4 100644 --- a/src/Merge.Client/Ats/Types/DebugModeLog.cs +++ b/src/Merge.Client/Ats/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record DebugModeLog diff --git a/src/Merge.Client/Ats/Types/DebugModelLogSummary.cs b/src/Merge.Client/Ats/Types/DebugModelLogSummary.cs index 503b0034..845bb6b4 100644 --- a/src/Merge.Client/Ats/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Ats/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record DebugModelLogSummary diff --git a/src/Merge.Client/Ats/Types/Department.cs b/src/Merge.Client/Ats/Types/Department.cs index f2b826ef..d5552860 100644 --- a/src/Merge.Client/Ats/Types/Department.cs +++ b/src/Merge.Client/Ats/Types/Department.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Department diff --git a/src/Merge.Client/Ats/Types/DisabilityStatusEnum.cs b/src/Merge.Client/Ats/Types/DisabilityStatusEnum.cs index c551a5e8..1eee27b6 100644 --- a/src/Merge.Client/Ats/Types/DisabilityStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/DisabilityStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum DisabilityStatusEnum { [EnumMember(Value = "YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY")] diff --git a/src/Merge.Client/Ats/Types/Eeoc.cs b/src/Merge.Client/Ats/Types/Eeoc.cs index e5c9cccd..79b55083 100644 --- a/src/Merge.Client/Ats/Types/Eeoc.cs +++ b/src/Merge.Client/Ats/Types/Eeoc.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Eeoc diff --git a/src/Merge.Client/Ats/Types/EmailAddress.cs b/src/Merge.Client/Ats/Types/EmailAddress.cs index 1cd502c1..a31ebc7d 100644 --- a/src/Merge.Client/Ats/Types/EmailAddress.cs +++ b/src/Merge.Client/Ats/Types/EmailAddress.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record EmailAddress diff --git a/src/Merge.Client/Ats/Types/EmailAddressRequest.cs b/src/Merge.Client/Ats/Types/EmailAddressRequest.cs index 69ac3c2e..516a80bf 100644 --- a/src/Merge.Client/Ats/Types/EmailAddressRequest.cs +++ b/src/Merge.Client/Ats/Types/EmailAddressRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record EmailAddressRequest diff --git a/src/Merge.Client/Ats/Types/EmailAddressTypeEnum.cs b/src/Merge.Client/Ats/Types/EmailAddressTypeEnum.cs index ab8f5386..47705005 100644 --- a/src/Merge.Client/Ats/Types/EmailAddressTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/EmailAddressTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmailAddressTypeEnum { [EnumMember(Value = "PERSONAL")] diff --git a/src/Merge.Client/Ats/Types/EnabledActionsEnum.cs b/src/Merge.Client/Ats/Types/EnabledActionsEnum.cs index 96130c2d..1e108c3b 100644 --- a/src/Merge.Client/Ats/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Ats/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Ats/Types/EncodingEnum.cs b/src/Merge.Client/Ats/Types/EncodingEnum.cs index 55a99e6f..09a13430 100644 --- a/src/Merge.Client/Ats/Types/EncodingEnum.cs +++ b/src/Merge.Client/Ats/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Ats/Types/ErrorValidationProblem.cs b/src/Merge.Client/Ats/Types/ErrorValidationProblem.cs index 58400232..a144d5b0 100644 --- a/src/Merge.Client/Ats/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Ats/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ErrorValidationProblem diff --git a/src/Merge.Client/Ats/Types/EventTypeEnum.cs b/src/Merge.Client/Ats/Types/EventTypeEnum.cs index c291d5f9..6c9cd7c0 100644 --- a/src/Merge.Client/Ats/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Ats/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Ats/Types/ExternalTargetFieldApi.cs index 78dbfeb0..9bf30a5a 100644 --- a/src/Merge.Client/Ats/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Ats/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Ats/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Ats/Types/ExternalTargetFieldApiResponse.cs index 6ac47be8..3563fd80 100644 --- a/src/Merge.Client/Ats/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Ats/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Ats/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Ats/Types/FieldMappingApiInstance.cs index ca73b6bc..bb2beda6 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteField.cs index 9c58435d..792b1364 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index d25433bf..9e8f8c2d 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceResponse.cs index 1a553e1c..74653e6a 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceTargetField.cs index 9ce80c3a..7fce9d97 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Ats/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Ats/Types/FieldMappingInstanceResponse.cs index 5705027d..ce559666 100644 --- a/src/Merge.Client/Ats/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Ats/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Ats/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Ats/Types/FieldPermissionDeserializer.cs index 6283e428..1fdd5b91 100644 --- a/src/Merge.Client/Ats/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Ats/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Ats/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Ats/Types/FieldPermissionDeserializerRequest.cs index 39ce1d5c..6ea708f5 100644 --- a/src/Merge.Client/Ats/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Ats/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Ats/Types/GenderEnum.cs b/src/Merge.Client/Ats/Types/GenderEnum.cs index 6c21bac7..71b1537c 100644 --- a/src/Merge.Client/Ats/Types/GenderEnum.cs +++ b/src/Merge.Client/Ats/Types/GenderEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum GenderEnum { [EnumMember(Value = "MALE")] diff --git a/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializer.cs index a7512181..e49c4e92 100644 --- a/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializerRequest.cs index b92829b8..a2068a0e 100644 --- a/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Ats/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Ats/Types/Issue.cs b/src/Merge.Client/Ats/Types/Issue.cs index 4ebd6fef..22ac697a 100644 --- a/src/Merge.Client/Ats/Types/Issue.cs +++ b/src/Merge.Client/Ats/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Issue diff --git a/src/Merge.Client/Ats/Types/IssueStatusEnum.cs b/src/Merge.Client/Ats/Types/IssueStatusEnum.cs index 618a28d7..9bb35d2c 100644 --- a/src/Merge.Client/Ats/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Ats/Types/Job.cs b/src/Merge.Client/Ats/Types/Job.cs index f9414caf..27b52ec9 100644 --- a/src/Merge.Client/Ats/Types/Job.cs +++ b/src/Merge.Client/Ats/Types/Job.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Job diff --git a/src/Merge.Client/Ats/Types/JobInterviewStage.cs b/src/Merge.Client/Ats/Types/JobInterviewStage.cs index 250c2e9e..68aa4914 100644 --- a/src/Merge.Client/Ats/Types/JobInterviewStage.cs +++ b/src/Merge.Client/Ats/Types/JobInterviewStage.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record JobInterviewStage diff --git a/src/Merge.Client/Ats/Types/JobPosting.cs b/src/Merge.Client/Ats/Types/JobPosting.cs index 30b8e211..7ae04f49 100644 --- a/src/Merge.Client/Ats/Types/JobPosting.cs +++ b/src/Merge.Client/Ats/Types/JobPosting.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record JobPosting diff --git a/src/Merge.Client/Ats/Types/JobPostingStatusEnum.cs b/src/Merge.Client/Ats/Types/JobPostingStatusEnum.cs index 027ce4b4..8a0b9d7f 100644 --- a/src/Merge.Client/Ats/Types/JobPostingStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/JobPostingStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobPostingStatusEnum { [EnumMember(Value = "PUBLISHED")] diff --git a/src/Merge.Client/Ats/Types/JobStatusEnum.cs b/src/Merge.Client/Ats/Types/JobStatusEnum.cs index 11eb6aa8..9d0f4c5b 100644 --- a/src/Merge.Client/Ats/Types/JobStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/JobStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobStatusEnum { [EnumMember(Value = "OPEN")] diff --git a/src/Merge.Client/Ats/Types/JobTypeEnum.cs b/src/Merge.Client/Ats/Types/JobTypeEnum.cs index 560545a4..f1a91ab0 100644 --- a/src/Merge.Client/Ats/Types/JobTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/JobTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum JobTypeEnum { [EnumMember(Value = "POSTING")] diff --git a/src/Merge.Client/Ats/Types/LanguageEnum.cs b/src/Merge.Client/Ats/Types/LanguageEnum.cs index b9cb285c..fbb5699c 100644 --- a/src/Merge.Client/Ats/Types/LanguageEnum.cs +++ b/src/Merge.Client/Ats/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Ats/Types/LinkToken.cs b/src/Merge.Client/Ats/Types/LinkToken.cs index f9c38517..39b0e2af 100644 --- a/src/Merge.Client/Ats/Types/LinkToken.cs +++ b/src/Merge.Client/Ats/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record LinkToken diff --git a/src/Merge.Client/Ats/Types/LinkedAccountStatus.cs b/src/Merge.Client/Ats/Types/LinkedAccountStatus.cs index 891a7178..b1b4b545 100644 --- a/src/Merge.Client/Ats/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Ats/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record LinkedAccountStatus diff --git a/src/Merge.Client/Ats/Types/MetaResponse.cs b/src/Merge.Client/Ats/Types/MetaResponse.cs index 30746a22..9f03104c 100644 --- a/src/Merge.Client/Ats/Types/MetaResponse.cs +++ b/src/Merge.Client/Ats/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record MetaResponse diff --git a/src/Merge.Client/Ats/Types/MethodEnum.cs b/src/Merge.Client/Ats/Types/MethodEnum.cs index b8e9b1e3..81c78c12 100644 --- a/src/Merge.Client/Ats/Types/MethodEnum.cs +++ b/src/Merge.Client/Ats/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Ats/Types/ModelOperation.cs b/src/Merge.Client/Ats/Types/ModelOperation.cs index e71ba93c..acc1ee22 100644 --- a/src/Merge.Client/Ats/Types/ModelOperation.cs +++ b/src/Merge.Client/Ats/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ModelOperation diff --git a/src/Merge.Client/Ats/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Ats/Types/ModelPermissionDeserializer.cs index e50e8902..681d720b 100644 --- a/src/Merge.Client/Ats/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Ats/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Ats/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Ats/Types/ModelPermissionDeserializerRequest.cs index 5cd3a8c0..932002bd 100644 --- a/src/Merge.Client/Ats/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Ats/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Ats/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Ats/Types/MultipartFormFieldRequest.cs index 6f316118..62742934 100644 --- a/src/Merge.Client/Ats/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Ats/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Ats/Types/Offer.cs b/src/Merge.Client/Ats/Types/Offer.cs index f862baec..70e5c6ab 100644 --- a/src/Merge.Client/Ats/Types/Offer.cs +++ b/src/Merge.Client/Ats/Types/Offer.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Offer diff --git a/src/Merge.Client/Ats/Types/OfferStatusEnum.cs b/src/Merge.Client/Ats/Types/OfferStatusEnum.cs index ddd33f6c..69c7843a 100644 --- a/src/Merge.Client/Ats/Types/OfferStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/OfferStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OfferStatusEnum { [EnumMember(Value = "DRAFT")] diff --git a/src/Merge.Client/Ats/Types/Office.cs b/src/Merge.Client/Ats/Types/Office.cs index b1c5730b..d2843b1b 100644 --- a/src/Merge.Client/Ats/Types/Office.cs +++ b/src/Merge.Client/Ats/Types/Office.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Office diff --git a/src/Merge.Client/Ats/Types/OverallRecommendationEnum.cs b/src/Merge.Client/Ats/Types/OverallRecommendationEnum.cs index 935df184..92b7620e 100644 --- a/src/Merge.Client/Ats/Types/OverallRecommendationEnum.cs +++ b/src/Merge.Client/Ats/Types/OverallRecommendationEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OverallRecommendationEnum { [EnumMember(Value = "DEFINITELY_NO")] diff --git a/src/Merge.Client/Ats/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Ats/Types/PaginatedAccountDetailsAndActionsList.cs index 6ea90d79..3fff17db 100644 --- a/src/Merge.Client/Ats/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Ats/Types/PaginatedActivityList.cs b/src/Merge.Client/Ats/Types/PaginatedActivityList.cs index a873c26b..ca8b83f5 100644 --- a/src/Merge.Client/Ats/Types/PaginatedActivityList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedActivityList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedActivityList diff --git a/src/Merge.Client/Ats/Types/PaginatedApplicationList.cs b/src/Merge.Client/Ats/Types/PaginatedApplicationList.cs index 82969a64..ac6e1d4d 100644 --- a/src/Merge.Client/Ats/Types/PaginatedApplicationList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedApplicationList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedApplicationList diff --git a/src/Merge.Client/Ats/Types/PaginatedAttachmentList.cs b/src/Merge.Client/Ats/Types/PaginatedAttachmentList.cs index 37a1a7aa..4bb52562 100644 --- a/src/Merge.Client/Ats/Types/PaginatedAttachmentList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedAttachmentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedAttachmentList diff --git a/src/Merge.Client/Ats/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Ats/Types/PaginatedAuditLogEventList.cs index 1d2ff866..b56020e7 100644 --- a/src/Merge.Client/Ats/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Ats/Types/PaginatedCandidateList.cs b/src/Merge.Client/Ats/Types/PaginatedCandidateList.cs index 8aca4a99..f3455289 100644 --- a/src/Merge.Client/Ats/Types/PaginatedCandidateList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedCandidateList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedCandidateList diff --git a/src/Merge.Client/Ats/Types/PaginatedDepartmentList.cs b/src/Merge.Client/Ats/Types/PaginatedDepartmentList.cs index 066bcf3b..9ba7cf81 100644 --- a/src/Merge.Client/Ats/Types/PaginatedDepartmentList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedDepartmentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedDepartmentList diff --git a/src/Merge.Client/Ats/Types/PaginatedEeocList.cs b/src/Merge.Client/Ats/Types/PaginatedEeocList.cs index 99c9ce34..6e2676ba 100644 --- a/src/Merge.Client/Ats/Types/PaginatedEeocList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedEeocList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedEeocList diff --git a/src/Merge.Client/Ats/Types/PaginatedIssueList.cs b/src/Merge.Client/Ats/Types/PaginatedIssueList.cs index 8fd784dc..1f917201 100644 --- a/src/Merge.Client/Ats/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedIssueList diff --git a/src/Merge.Client/Ats/Types/PaginatedJobInterviewStageList.cs b/src/Merge.Client/Ats/Types/PaginatedJobInterviewStageList.cs index aeee30b4..95eae559 100644 --- a/src/Merge.Client/Ats/Types/PaginatedJobInterviewStageList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedJobInterviewStageList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedJobInterviewStageList diff --git a/src/Merge.Client/Ats/Types/PaginatedJobList.cs b/src/Merge.Client/Ats/Types/PaginatedJobList.cs index aa09fef2..f83a8739 100644 --- a/src/Merge.Client/Ats/Types/PaginatedJobList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedJobList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedJobList diff --git a/src/Merge.Client/Ats/Types/PaginatedJobPostingList.cs b/src/Merge.Client/Ats/Types/PaginatedJobPostingList.cs index b42d84c1..a527fe08 100644 --- a/src/Merge.Client/Ats/Types/PaginatedJobPostingList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedJobPostingList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedJobPostingList diff --git a/src/Merge.Client/Ats/Types/PaginatedOfferList.cs b/src/Merge.Client/Ats/Types/PaginatedOfferList.cs index 22f9cf88..806c609e 100644 --- a/src/Merge.Client/Ats/Types/PaginatedOfferList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedOfferList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedOfferList diff --git a/src/Merge.Client/Ats/Types/PaginatedOfficeList.cs b/src/Merge.Client/Ats/Types/PaginatedOfficeList.cs index 7890159d..9de8f016 100644 --- a/src/Merge.Client/Ats/Types/PaginatedOfficeList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedOfficeList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedOfficeList diff --git a/src/Merge.Client/Ats/Types/PaginatedRejectReasonList.cs b/src/Merge.Client/Ats/Types/PaginatedRejectReasonList.cs index cf651f03..3399250d 100644 --- a/src/Merge.Client/Ats/Types/PaginatedRejectReasonList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedRejectReasonList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedRejectReasonList diff --git a/src/Merge.Client/Ats/Types/PaginatedRemoteUserList.cs b/src/Merge.Client/Ats/Types/PaginatedRemoteUserList.cs index d6d9e548..2d388331 100644 --- a/src/Merge.Client/Ats/Types/PaginatedRemoteUserList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedRemoteUserList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedRemoteUserList diff --git a/src/Merge.Client/Ats/Types/PaginatedScheduledInterviewList.cs b/src/Merge.Client/Ats/Types/PaginatedScheduledInterviewList.cs index 01e0c328..22bc8840 100644 --- a/src/Merge.Client/Ats/Types/PaginatedScheduledInterviewList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedScheduledInterviewList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedScheduledInterviewList diff --git a/src/Merge.Client/Ats/Types/PaginatedScorecardList.cs b/src/Merge.Client/Ats/Types/PaginatedScorecardList.cs index 93c56a9c..70fb8ff4 100644 --- a/src/Merge.Client/Ats/Types/PaginatedScorecardList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedScorecardList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedScorecardList diff --git a/src/Merge.Client/Ats/Types/PaginatedScreeningQuestionList.cs b/src/Merge.Client/Ats/Types/PaginatedScreeningQuestionList.cs index 0f5e835b..662cdfd9 100644 --- a/src/Merge.Client/Ats/Types/PaginatedScreeningQuestionList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedScreeningQuestionList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedScreeningQuestionList diff --git a/src/Merge.Client/Ats/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Ats/Types/PaginatedSyncStatusList.cs index b7e78f11..ea96c65a 100644 --- a/src/Merge.Client/Ats/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Ats/Types/PaginatedTagList.cs b/src/Merge.Client/Ats/Types/PaginatedTagList.cs index e7331216..1e4a0f63 100644 --- a/src/Merge.Client/Ats/Types/PaginatedTagList.cs +++ b/src/Merge.Client/Ats/Types/PaginatedTagList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PaginatedTagList diff --git a/src/Merge.Client/Ats/Types/PatchedCandidateRequest.cs b/src/Merge.Client/Ats/Types/PatchedCandidateRequest.cs index 38a704af..249256c1 100644 --- a/src/Merge.Client/Ats/Types/PatchedCandidateRequest.cs +++ b/src/Merge.Client/Ats/Types/PatchedCandidateRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PatchedCandidateRequest diff --git a/src/Merge.Client/Ats/Types/PhoneNumber.cs b/src/Merge.Client/Ats/Types/PhoneNumber.cs index 338f6ac2..661a8732 100644 --- a/src/Merge.Client/Ats/Types/PhoneNumber.cs +++ b/src/Merge.Client/Ats/Types/PhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PhoneNumber diff --git a/src/Merge.Client/Ats/Types/PhoneNumberRequest.cs b/src/Merge.Client/Ats/Types/PhoneNumberRequest.cs index b21b19d7..e8cffaff 100644 --- a/src/Merge.Client/Ats/Types/PhoneNumberRequest.cs +++ b/src/Merge.Client/Ats/Types/PhoneNumberRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record PhoneNumberRequest diff --git a/src/Merge.Client/Ats/Types/PhoneNumberTypeEnum.cs b/src/Merge.Client/Ats/Types/PhoneNumberTypeEnum.cs index e57213b1..e6b40ffd 100644 --- a/src/Merge.Client/Ats/Types/PhoneNumberTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/PhoneNumberTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PhoneNumberTypeEnum { [EnumMember(Value = "HOME")] diff --git a/src/Merge.Client/Ats/Types/RaceEnum.cs b/src/Merge.Client/Ats/Types/RaceEnum.cs index 9885c233..bb5b1852 100644 --- a/src/Merge.Client/Ats/Types/RaceEnum.cs +++ b/src/Merge.Client/Ats/Types/RaceEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RaceEnum { [EnumMember(Value = "AMERICAN_INDIAN_OR_ALASKAN_NATIVE")] diff --git a/src/Merge.Client/Ats/Types/ReasonEnum.cs b/src/Merge.Client/Ats/Types/ReasonEnum.cs index 4a7fea7b..dfccaa51 100644 --- a/src/Merge.Client/Ats/Types/ReasonEnum.cs +++ b/src/Merge.Client/Ats/Types/ReasonEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ReasonEnum { [EnumMember(Value = "GENERAL_CUSTOMER_REQUEST")] diff --git a/src/Merge.Client/Ats/Types/RejectReason.cs b/src/Merge.Client/Ats/Types/RejectReason.cs index cc96843c..711d33dd 100644 --- a/src/Merge.Client/Ats/Types/RejectReason.cs +++ b/src/Merge.Client/Ats/Types/RejectReason.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RejectReason diff --git a/src/Merge.Client/Ats/Types/RemoteData.cs b/src/Merge.Client/Ats/Types/RemoteData.cs index d13b40ef..b9159739 100644 --- a/src/Merge.Client/Ats/Types/RemoteData.cs +++ b/src/Merge.Client/Ats/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteData diff --git a/src/Merge.Client/Ats/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Ats/Types/RemoteEndpointInfo.cs index ed9f5c7f..d3a9f6f6 100644 --- a/src/Merge.Client/Ats/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Ats/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Ats/Types/RemoteFieldApi.cs b/src/Merge.Client/Ats/Types/RemoteFieldApi.cs index 34d90409..1d61f5a2 100644 --- a/src/Merge.Client/Ats/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Ats/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record RemoteFieldApi diff --git a/src/Merge.Client/Ats/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Ats/Types/RemoteFieldApiResponse.cs index 6be4212f..2719c14f 100644 --- a/src/Merge.Client/Ats/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Ats/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Ats/Types/RemoteKey.cs b/src/Merge.Client/Ats/Types/RemoteKey.cs index 15a777f7..63d3dd83 100644 --- a/src/Merge.Client/Ats/Types/RemoteKey.cs +++ b/src/Merge.Client/Ats/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteKey diff --git a/src/Merge.Client/Ats/Types/RemoteResponse.cs b/src/Merge.Client/Ats/Types/RemoteResponse.cs index c6eef978..8ce814ff 100644 --- a/src/Merge.Client/Ats/Types/RemoteResponse.cs +++ b/src/Merge.Client/Ats/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteResponse diff --git a/src/Merge.Client/Ats/Types/RemoteUser.cs b/src/Merge.Client/Ats/Types/RemoteUser.cs index 429fa3ed..004d4885 100644 --- a/src/Merge.Client/Ats/Types/RemoteUser.cs +++ b/src/Merge.Client/Ats/Types/RemoteUser.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record RemoteUser diff --git a/src/Merge.Client/Ats/Types/RequestFormatEnum.cs b/src/Merge.Client/Ats/Types/RequestFormatEnum.cs index 390ed36d..e15370a6 100644 --- a/src/Merge.Client/Ats/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Ats/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Ats/Types/ResponseTypeEnum.cs b/src/Merge.Client/Ats/Types/ResponseTypeEnum.cs index 52ca33a5..aa2d41db 100644 --- a/src/Merge.Client/Ats/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Ats/Types/RoleEnum.cs b/src/Merge.Client/Ats/Types/RoleEnum.cs index c466fcb0..529b083e 100644 --- a/src/Merge.Client/Ats/Types/RoleEnum.cs +++ b/src/Merge.Client/Ats/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Ats/Types/ScheduledInterview.cs b/src/Merge.Client/Ats/Types/ScheduledInterview.cs index 63f43c31..92f9d19d 100644 --- a/src/Merge.Client/Ats/Types/ScheduledInterview.cs +++ b/src/Merge.Client/Ats/Types/ScheduledInterview.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ScheduledInterview diff --git a/src/Merge.Client/Ats/Types/ScheduledInterviewRequest.cs b/src/Merge.Client/Ats/Types/ScheduledInterviewRequest.cs index afc10c53..ecebdef8 100644 --- a/src/Merge.Client/Ats/Types/ScheduledInterviewRequest.cs +++ b/src/Merge.Client/Ats/Types/ScheduledInterviewRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ScheduledInterviewRequest diff --git a/src/Merge.Client/Ats/Types/ScheduledInterviewResponse.cs b/src/Merge.Client/Ats/Types/ScheduledInterviewResponse.cs index 7fe7fb6d..bc92d3cf 100644 --- a/src/Merge.Client/Ats/Types/ScheduledInterviewResponse.cs +++ b/src/Merge.Client/Ats/Types/ScheduledInterviewResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ScheduledInterviewResponse diff --git a/src/Merge.Client/Ats/Types/ScheduledInterviewStatusEnum.cs b/src/Merge.Client/Ats/Types/ScheduledInterviewStatusEnum.cs index bac456ad..6cc6ee24 100644 --- a/src/Merge.Client/Ats/Types/ScheduledInterviewStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/ScheduledInterviewStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ScheduledInterviewStatusEnum { [EnumMember(Value = "SCHEDULED")] diff --git a/src/Merge.Client/Ats/Types/Scorecard.cs b/src/Merge.Client/Ats/Types/Scorecard.cs index 0a02178b..670242e2 100644 --- a/src/Merge.Client/Ats/Types/Scorecard.cs +++ b/src/Merge.Client/Ats/Types/Scorecard.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record Scorecard diff --git a/src/Merge.Client/Ats/Types/ScreeningQuestion.cs b/src/Merge.Client/Ats/Types/ScreeningQuestion.cs index ea75c568..36580abf 100644 --- a/src/Merge.Client/Ats/Types/ScreeningQuestion.cs +++ b/src/Merge.Client/Ats/Types/ScreeningQuestion.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ScreeningQuestion diff --git a/src/Merge.Client/Ats/Types/ScreeningQuestionAnswer.cs b/src/Merge.Client/Ats/Types/ScreeningQuestionAnswer.cs index 8377fb07..4c781c5b 100644 --- a/src/Merge.Client/Ats/Types/ScreeningQuestionAnswer.cs +++ b/src/Merge.Client/Ats/Types/ScreeningQuestionAnswer.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ScreeningQuestionAnswer diff --git a/src/Merge.Client/Ats/Types/ScreeningQuestionAnswerRequest.cs b/src/Merge.Client/Ats/Types/ScreeningQuestionAnswerRequest.cs index c3854056..7bd7d1d7 100644 --- a/src/Merge.Client/Ats/Types/ScreeningQuestionAnswerRequest.cs +++ b/src/Merge.Client/Ats/Types/ScreeningQuestionAnswerRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ats; public record ScreeningQuestionAnswerRequest diff --git a/src/Merge.Client/Ats/Types/ScreeningQuestionOption.cs b/src/Merge.Client/Ats/Types/ScreeningQuestionOption.cs index 281fc968..90c5fe7c 100644 --- a/src/Merge.Client/Ats/Types/ScreeningQuestionOption.cs +++ b/src/Merge.Client/Ats/Types/ScreeningQuestionOption.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ScreeningQuestionOption diff --git a/src/Merge.Client/Ats/Types/ScreeningQuestionTypeEnum.cs b/src/Merge.Client/Ats/Types/ScreeningQuestionTypeEnum.cs index c790100f..47e57dc2 100644 --- a/src/Merge.Client/Ats/Types/ScreeningQuestionTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/ScreeningQuestionTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ScreeningQuestionTypeEnum { [EnumMember(Value = "DATE")] diff --git a/src/Merge.Client/Ats/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Ats/Types/SelectiveSyncConfigurationsUsageEnum.cs index a8fb681d..9d45f7fc 100644 --- a/src/Merge.Client/Ats/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Ats/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Ats/Types/SyncStatus.cs b/src/Merge.Client/Ats/Types/SyncStatus.cs index 99e0495a..86fc9211 100644 --- a/src/Merge.Client/Ats/Types/SyncStatus.cs +++ b/src/Merge.Client/Ats/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record SyncStatus diff --git a/src/Merge.Client/Ats/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Ats/Types/SyncStatusStatusEnum.cs index efebece5..6536ae46 100644 --- a/src/Merge.Client/Ats/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Ats/Types/Tag.cs b/src/Merge.Client/Ats/Types/Tag.cs index 01ecaf25..4b0055c0 100644 --- a/src/Merge.Client/Ats/Types/Tag.cs +++ b/src/Merge.Client/Ats/Types/Tag.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Tag diff --git a/src/Merge.Client/Ats/Types/Url.cs b/src/Merge.Client/Ats/Types/Url.cs index f0ff80c1..ac7d9e73 100644 --- a/src/Merge.Client/Ats/Types/Url.cs +++ b/src/Merge.Client/Ats/Types/Url.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record Url diff --git a/src/Merge.Client/Ats/Types/UrlRequest.cs b/src/Merge.Client/Ats/Types/UrlRequest.cs index 6ff02a69..4bec71ec 100644 --- a/src/Merge.Client/Ats/Types/UrlRequest.cs +++ b/src/Merge.Client/Ats/Types/UrlRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record UrlRequest diff --git a/src/Merge.Client/Ats/Types/UrlTypeEnum.cs b/src/Merge.Client/Ats/Types/UrlTypeEnum.cs index f3124b00..8dac2e46 100644 --- a/src/Merge.Client/Ats/Types/UrlTypeEnum.cs +++ b/src/Merge.Client/Ats/Types/UrlTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum UrlTypeEnum { [EnumMember(Value = "PERSONAL")] diff --git a/src/Merge.Client/Ats/Types/ValidationProblemSource.cs b/src/Merge.Client/Ats/Types/ValidationProblemSource.cs index c73ebde4..42fe393f 100644 --- a/src/Merge.Client/Ats/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Ats/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record ValidationProblemSource diff --git a/src/Merge.Client/Ats/Types/VeteranStatusEnum.cs b/src/Merge.Client/Ats/Types/VeteranStatusEnum.cs index 5278187b..ceb4957e 100644 --- a/src/Merge.Client/Ats/Types/VeteranStatusEnum.cs +++ b/src/Merge.Client/Ats/Types/VeteranStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum VeteranStatusEnum { [EnumMember(Value = "I_AM_NOT_A_PROTECTED_VETERAN")] diff --git a/src/Merge.Client/Ats/Types/VisibilityEnum.cs b/src/Merge.Client/Ats/Types/VisibilityEnum.cs index 485e485b..ef628104 100644 --- a/src/Merge.Client/Ats/Types/VisibilityEnum.cs +++ b/src/Merge.Client/Ats/Types/VisibilityEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum VisibilityEnum { [EnumMember(Value = "ADMIN_ONLY")] diff --git a/src/Merge.Client/Ats/Types/WarningValidationProblem.cs b/src/Merge.Client/Ats/Types/WarningValidationProblem.cs index afb8c2f8..f9ae6f64 100644 --- a/src/Merge.Client/Ats/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Ats/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record WarningValidationProblem diff --git a/src/Merge.Client/Ats/Types/WebhookReceiver.cs b/src/Merge.Client/Ats/Types/WebhookReceiver.cs index 9c45b236..3f83de0e 100644 --- a/src/Merge.Client/Ats/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Ats/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record WebhookReceiver diff --git a/src/Merge.Client/Ats/Users/Requests/UsersListRequest.cs b/src/Merge.Client/Ats/Users/Requests/UsersListRequest.cs index e1ef3cc0..9e377df8 100644 --- a/src/Merge.Client/Ats/Users/Requests/UsersListRequest.cs +++ b/src/Merge.Client/Ats/Users/Requests/UsersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record UsersListRequest diff --git a/src/Merge.Client/Ats/Users/Requests/UsersRetrieveRequest.cs b/src/Merge.Client/Ats/Users/Requests/UsersRetrieveRequest.cs index 7345fe7d..f306d220 100644 --- a/src/Merge.Client/Ats/Users/Requests/UsersRetrieveRequest.cs +++ b/src/Merge.Client/Ats/Users/Requests/UsersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record UsersRetrieveRequest diff --git a/src/Merge.Client/Ats/Users/UsersClient.cs b/src/Merge.Client/Ats/Users/UsersClient.cs index 0fb93f52..dc152294 100644 --- a/src/Merge.Client/Ats/Users/UsersClient.cs +++ b/src/Merge.Client/Ats/Users/UsersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class UsersClient @@ -24,7 +22,7 @@ internal UsersClient(RawClient client) /// await client.Ats.Users.ListAsync(new UsersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( UsersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -89,17 +87,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/users", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/users", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -128,7 +128,7 @@ public async Task ListAsync( /// await client.Ats.Users.RetrieveAsync("id", new UsersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, UsersRetrieveRequest request, RequestOptions? options = null, @@ -138,7 +138,7 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -148,17 +148,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ats/v1/users/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ats/v1/users/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ats/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Ats/WebhookReceivers/Requests/WebhookReceiverRequest.cs index 7e7eee69..99ecc0db 100644 --- a/src/Merge.Client/Ats/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Ats/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs index 3588cc72..414e0df1 100644 --- a/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Ats/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ats; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Ats.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ats/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ats/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ats/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ats/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Core/CollectionItemSerializer.cs b/src/Merge.Client/Core/CollectionItemSerializer.cs index e212d40a..5f010a60 100644 --- a/src/Merge.Client/Core/CollectionItemSerializer.cs +++ b/src/Merge.Client/Core/CollectionItemSerializer.cs @@ -75,7 +75,7 @@ JsonSerializerOptions options return; } - JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options); + var jsonSerializerOptions = new JsonSerializerOptions(options); jsonSerializerOptions.Converters.Clear(); jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); diff --git a/src/Merge.Client/Core/StringEnumSerializer.cs b/src/Merge.Client/Core/EnumSerializer.cs similarity index 94% rename from src/Merge.Client/Core/StringEnumSerializer.cs rename to src/Merge.Client/Core/EnumSerializer.cs index 86e1405a..d1b2a535 100644 --- a/src/Merge.Client/Core/StringEnumSerializer.cs +++ b/src/Merge.Client/Core/EnumSerializer.cs @@ -4,13 +4,13 @@ namespace Merge.Client.Core; -internal class StringEnumSerializer : JsonConverter +internal class EnumSerializer : JsonConverter where TEnum : struct, System.Enum { private readonly Dictionary _enumToString = new(); private readonly Dictionary _stringToEnum = new(); - public StringEnumSerializer() + public EnumSerializer() { var type = typeof(TEnum); var values = Enum.GetValues(type); diff --git a/src/Merge.Client/Core/IRequestOptions.cs b/src/Merge.Client/Core/IRequestOptions.cs new file mode 100644 index 00000000..a89d57ce --- /dev/null +++ b/src/Merge.Client/Core/IRequestOptions.cs @@ -0,0 +1,32 @@ +using System; +using System.Net.Http; + +namespace Merge.Client.Core; + +internal interface IRequestOptions +{ + /// + /// The Base URL for the API. + /// + public string? BaseUrl { get; init; } + + /// + /// The http client used to make requests. + /// + public HttpClient? HttpClient { get; init; } + + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } + + /// + /// The http client used to make requests. + /// + public int? MaxRetries { get; init; } + + /// + /// The timeout for the request. + /// + public TimeSpan? Timeout { get; init; } +} diff --git a/src/Merge.Client/Core/JsonConfiguration.cs b/src/Merge.Client/Core/JsonConfiguration.cs index cf25cda2..046d7f62 100644 --- a/src/Merge.Client/Core/JsonConfiguration.cs +++ b/src/Merge.Client/Core/JsonConfiguration.cs @@ -3,19 +3,23 @@ namespace Merge.Client.Core; -internal static class JsonOptions +internal static partial class JsonOptions { public static readonly JsonSerializerOptions JsonSerializerOptions; static JsonOptions() { - JsonSerializerOptions = new JsonSerializerOptions + var options = new JsonSerializerOptions { Converters = { new DateTimeSerializer(), new OneOfSerializer() }, WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, }; + ConfigureJsonSerializerOptions(options); + JsonSerializerOptions = options; } + + static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); } internal static class JsonUtils diff --git a/src/Merge.Client/Core/OneOfSerializer.cs b/src/Merge.Client/Core/OneOfSerializer.cs index f8290bbd..99851381 100644 --- a/src/Merge.Client/Core/OneOfSerializer.cs +++ b/src/Merge.Client/Core/OneOfSerializer.cs @@ -40,11 +40,15 @@ public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOp private static (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type typeToConvert) { - var casts = typeToConvert - .GetRuntimeMethods() + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() .Where(m => m.IsSpecialName && m.Name == "op_Implicit") .ToArray(); - var type = typeToConvert; while (type != null) { if ( @@ -52,13 +56,29 @@ private static (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type t && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) ) { - return type.GetGenericArguments() + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) .ToArray(); } type = type.BaseType; } + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); } diff --git a/src/Merge.Client/Core/Public/ClientOptions.cs b/src/Merge.Client/Core/Public/ClientOptions.cs index 5dde37ed..0007f549 100644 --- a/src/Merge.Client/Core/Public/ClientOptions.cs +++ b/src/Merge.Client/Core/Public/ClientOptions.cs @@ -1,8 +1,6 @@ using System; using System.Net.Http; -#nullable enable - namespace Merge.Client.Core; public partial class ClientOptions @@ -31,4 +29,19 @@ public partial class ClientOptions /// The http headers sent with the request. /// internal Headers Headers { get; init; } = new(); + + /// + /// Clones this and returns a new instance + /// + internal ClientOptions Clone() + { + return new ClientOptions + { + BaseUrl = BaseUrl, + HttpClient = HttpClient, + MaxRetries = MaxRetries, + Timeout = Timeout, + Headers = new Headers(new Dictionary(Headers)), + }; + } } diff --git a/src/Merge.Client/Core/Public/MergeEnvironment.cs b/src/Merge.Client/Core/Public/MergeEnvironment.cs index 1d361bf7..94c7b8b6 100644 --- a/src/Merge.Client/Core/Public/MergeEnvironment.cs +++ b/src/Merge.Client/Core/Public/MergeEnvironment.cs @@ -2,9 +2,9 @@ namespace Merge.Client.Core; public class MergeEnvironment { - public static string PRODUCTION = "https://api.merge.dev/api"; + public const string PRODUCTION = "https://api.merge.dev/api"; - public static string SANDBOX = "https://api-sandbox.merge.dev/api"; + public const string SANDBOX = "https://api-sandbox.merge.dev/api"; - public static string PRODUCTION_EU = "https://api-eu.merge.dev/api"; + public const string PRODUCTION_EU = "https://api-eu.merge.dev/api"; } diff --git a/src/Merge.Client/Core/Public/MergeException.cs b/src/Merge.Client/Core/Public/MergeException.cs index 6f1c2925..f1bacf73 100644 --- a/src/Merge.Client/Core/Public/MergeException.cs +++ b/src/Merge.Client/Core/Public/MergeException.cs @@ -1,11 +1,9 @@ using System; -#nullable enable - namespace Merge.Client.Core; /// /// Base exception class for all exceptions thrown by the SDK. /// public class MergeException(string message, Exception? innerException = null) - : Exception(message, innerException) { } + : Exception(message, innerException); diff --git a/src/Merge.Client/Core/Public/RequestOptions.cs b/src/Merge.Client/Core/Public/RequestOptions.cs index 9507fb7d..443f4504 100644 --- a/src/Merge.Client/Core/Public/RequestOptions.cs +++ b/src/Merge.Client/Core/Public/RequestOptions.cs @@ -1,11 +1,9 @@ using System; using System.Net.Http; -#nullable enable - namespace Merge.Client.Core; -public partial class RequestOptions +public partial class RequestOptions : IRequestOptions { /// /// The Base URL for the API. @@ -30,5 +28,5 @@ public partial class RequestOptions /// /// The http headers sent with the request. /// - internal Headers Headers { get; init; } = new(); + Headers IRequestOptions.Headers { get; init; } = new(); } diff --git a/src/Merge.Client/Core/Public/Version.cs b/src/Merge.Client/Core/Public/Version.cs index 88d96130..1e972c59 100644 --- a/src/Merge.Client/Core/Public/Version.cs +++ b/src/Merge.Client/Core/Public/Version.cs @@ -2,5 +2,5 @@ namespace Merge.Client; internal class Version { - public const string Current = "1.0.0"; + public const string Current = "1.0.1"; } diff --git a/src/Merge.Client/Core/RawClient.cs b/src/Merge.Client/Core/RawClient.cs index cef78b3c..7bc0a9e2 100644 --- a/src/Merge.Client/Core/RawClient.cs +++ b/src/Merge.Client/Core/RawClient.cs @@ -1,11 +1,11 @@ using System.Net.Http; +using System.Net.Http.Headers; using System.Text; using System.Threading; +using SystemTask = System.Threading.Tasks.Task; namespace Merge.Client.Core; -#nullable enable - /// /// Utility class for making raw HTTP requests to the API. /// @@ -30,7 +30,7 @@ public async Task MakeRequestAsync( cts.CancelAfter(timeout); // Send the request. - return await SendWithRetriesAsync(request, cts.Token); + return await SendWithRetriesAsync(request, cts.Token).ConfigureAwait(false); } public record BaseApiRequest @@ -47,7 +47,7 @@ public record BaseApiRequest public Headers Headers { get; init; } = new(); - public RequestOptions? Options { get; init; } + public IRequestOptions? Options { get; init; } } /// @@ -83,7 +83,9 @@ CancellationToken cancellationToken { var httpClient = request.Options?.HttpClient ?? Options.HttpClient; var maxRetries = request.Options?.MaxRetries ?? Options.MaxRetries; - var response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); + var response = await httpClient + .SendAsync(BuildHttpRequest(request), cancellationToken) + .ConfigureAwait(false); for (var i = 0; i < maxRetries; i++) { if (!ShouldRetry(response)) @@ -91,8 +93,10 @@ CancellationToken cancellationToken break; } var delayMs = Math.Min(InitialRetryDelayMs * (int)Math.Pow(2, i), MaxRetryDelayMs); - await System.Threading.Tasks.Task.Delay(delayMs, cancellationToken); - response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); + await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + response = await httpClient + .SendAsync(BuildHttpRequest(request), cancellationToken) + .ConfigureAwait(false); } return new ApiResponse { StatusCode = (int)response.StatusCode, Raw = response }; } @@ -128,11 +132,14 @@ private HttpRequestMessage BuildHttpRequest(BaseApiRequest request) } if (request.ContentType != null) { - request.Headers.Add("Content-Type", request.ContentType); + httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse( + request.ContentType + ); } SetHeaders(httpRequest, Options.Headers); SetHeaders(httpRequest, request.Headers); SetHeaders(httpRequest, request.Options?.Headers ?? new Headers()); + return httpRequest; } diff --git a/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs index 49955af0..7f2b5a45 100644 --- a/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Crm/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Crm.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs index de64f1da..b594e18d 100644 --- a/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Crm/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Crm.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Accounts/AccountsClient.cs b/src/Merge.Client/Crm/Accounts/AccountsClient.cs index e7abb26b..27f6be2d 100644 --- a/src/Merge.Client/Crm/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Crm/Accounts/AccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AccountsClient @@ -24,7 +22,7 @@ internal AccountsClient(RawClient client) /// await client.Crm.Accounts.ListAsync(new AccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,19 +49,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -87,23 +87,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,7 +136,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( CrmAccountEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -143,25 +145,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/accounts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/accounts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -190,7 +195,7 @@ public async Task CreateAsync( /// await client.Crm.Accounts.RetrieveAsync("id", new AccountsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AccountsRetrieveRequest request, RequestOptions? options = null, @@ -204,23 +209,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/accounts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/accounts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -252,7 +261,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedCrmAccountEndpointRequest request, RequestOptions? options = null, @@ -262,25 +271,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/accounts/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/accounts/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -309,22 +321,24 @@ public async Task PartialUpdateAsync( /// await client.Crm.Accounts.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/accounts/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/accounts/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -353,21 +367,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Crm.Accounts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/accounts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/accounts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -396,7 +412,7 @@ public async Task MetaPostRetrieveAsync( /// await client.Crm.Accounts.RemoteFieldClassesListAsync(new AccountsRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( AccountsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -409,39 +425,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/accounts/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/accounts/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Accounts/Requests/AccountsListRequest.cs b/src/Merge.Client/Crm/Accounts/Requests/AccountsListRequest.cs index cd00870b..04264469 100644 --- a/src/Merge.Client/Crm/Accounts/Requests/AccountsListRequest.cs +++ b/src/Merge.Client/Crm/Accounts/Requests/AccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountsListRequest diff --git a/src/Merge.Client/Crm/Accounts/Requests/AccountsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Accounts/Requests/AccountsRemoteFieldClassesListRequest.cs index 03c1f607..17058f0c 100644 --- a/src/Merge.Client/Crm/Accounts/Requests/AccountsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Accounts/Requests/AccountsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Accounts/Requests/AccountsRetrieveRequest.cs b/src/Merge.Client/Crm/Accounts/Requests/AccountsRetrieveRequest.cs index c5f8f996..501c94b6 100644 --- a/src/Merge.Client/Crm/Accounts/Requests/AccountsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Accounts/Requests/AccountsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountsRetrieveRequest diff --git a/src/Merge.Client/Crm/Accounts/Requests/CrmAccountEndpointRequest.cs b/src/Merge.Client/Crm/Accounts/Requests/CrmAccountEndpointRequest.cs index 5e4e6271..8b4a2091 100644 --- a/src/Merge.Client/Crm/Accounts/Requests/CrmAccountEndpointRequest.cs +++ b/src/Merge.Client/Crm/Accounts/Requests/CrmAccountEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmAccountEndpointRequest diff --git a/src/Merge.Client/Crm/Accounts/Requests/PatchedCrmAccountEndpointRequest.cs b/src/Merge.Client/Crm/Accounts/Requests/PatchedCrmAccountEndpointRequest.cs index ac621558..8611b029 100644 --- a/src/Merge.Client/Crm/Accounts/Requests/PatchedCrmAccountEndpointRequest.cs +++ b/src/Merge.Client/Crm/Accounts/Requests/PatchedCrmAccountEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedCrmAccountEndpointRequest diff --git a/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs b/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs index 98ac5ba3..7fb7e55b 100644 --- a/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs +++ b/src/Merge.Client/Crm/AssociationTypes/AssociationTypesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AssociationTypesClient @@ -27,7 +25,7 @@ internal AssociationTypesClient(RawClient client) /// ); /// /// - public async Task CustomObjectClassesAssociationTypesListAsync( + public async System.Threading.Tasks.Task CustomObjectClassesAssociationTypesListAsync( string customObjectClassId, CustomObjectClassesAssociationTypesListRequest request, RequestOptions? options = null, @@ -55,15 +53,15 @@ public async Task CustomObjectClassesAssociationTy } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task CustomObjectClassesAssociationTy } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -132,7 +132,7 @@ public async Task CustomObjectClassesAssociationTy /// Id = "id", /// OriginType = OriginTypeEnum.CustomObject, /// }, - /// TargetObjectClasses = new List() + /// TargetObjectClasses = new List<ObjectClassDescriptionRequest>() /// { /// new ObjectClassDescriptionRequest /// { @@ -146,7 +146,7 @@ public async Task CustomObjectClassesAssociationTy /// ); /// /// - public async Task CustomObjectClassesAssociationTypesCreateAsync( + public async System.Threading.Tasks.Task CustomObjectClassesAssociationTypesCreateAsync( string customObjectClassId, CrmAssociationTypeEndpointRequest request, RequestOptions? options = null, @@ -156,25 +156,28 @@ public async Task CustomObjectClassesAssociationType var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -207,7 +210,7 @@ public async Task CustomObjectClassesAssociationType /// ); /// /// - public async Task CustomObjectClassesAssociationTypesRetrieveAsync( + public async System.Threading.Tasks.Task CustomObjectClassesAssociationTypesRetrieveAsync( string customObjectClassId, string id, CustomObjectClassesAssociationTypesRetrieveRequest request, @@ -222,19 +225,22 @@ public async Task CustomObjectClassesAssociationTypesRetrieveAs } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -265,23 +271,25 @@ public async Task CustomObjectClassesAssociationTypesRetrieveAs /// ); /// /// - public async Task CustomObjectClassesAssociationTypesMetaPostRetrieveAsync( + public async System.Threading.Tasks.Task CustomObjectClassesAssociationTypesMetaPostRetrieveAsync( string customObjectClassId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = - $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"crm/v1/custom-object-classes/{customObjectClassId}/association-types/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/AssociationTypes/Requests/CrmAssociationTypeEndpointRequest.cs b/src/Merge.Client/Crm/AssociationTypes/Requests/CrmAssociationTypeEndpointRequest.cs index 2adfa4c9..58519a5d 100644 --- a/src/Merge.Client/Crm/AssociationTypes/Requests/CrmAssociationTypeEndpointRequest.cs +++ b/src/Merge.Client/Crm/AssociationTypes/Requests/CrmAssociationTypeEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmAssociationTypeEndpointRequest diff --git a/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesListRequest.cs b/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesListRequest.cs index a366dda0..2eb276ff 100644 --- a/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesListRequest.cs +++ b/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesAssociationTypesListRequest diff --git a/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesRetrieveRequest.cs b/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesRetrieveRequest.cs index c3cb513c..1c84dad3 100644 --- a/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/AssociationTypes/Requests/CustomObjectClassesAssociationTypesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesAssociationTypesRetrieveRequest diff --git a/src/Merge.Client/Crm/Associations/AssociationsClient.cs b/src/Merge.Client/Crm/Associations/AssociationsClient.cs index 5a69bdfb..91bb4179 100644 --- a/src/Merge.Client/Crm/Associations/AssociationsClient.cs +++ b/src/Merge.Client/Crm/Associations/AssociationsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AssociationsClient @@ -28,7 +26,7 @@ internal AssociationsClient(RawClient client) /// ); /// /// - public async Task CustomObjectClassesCustomObjectsAssociationsListAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsAssociationsListAsync( string customObjectClassId, string objectId, CustomObjectClassesCustomObjectsAssociationsListRequest request, @@ -61,15 +59,15 @@ public async Task CustomObjectClassesCustomObjectsAsso } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -85,24 +83,26 @@ public async Task CustomObjectClassesCustomObjectsAsso } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = - $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{objectId}/associations", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{objectId}/associations", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task CustomObjectClassesCustomObjectsAsso /// ); /// /// - public async Task CustomObjectClassesCustomObjectsAssociationsUpdateAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsAssociationsUpdateAsync( string associationTypeId, string sourceClassId, string sourceObjectId, @@ -152,24 +152,26 @@ public async Task CustomObjectClassesCustomObjectsAssociationsUpdat var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Put, - Path = - $"crm/v1/custom-object-classes/{sourceClassId}/custom-objects/{sourceObjectId}/associations/{targetClassId}/{targetObjectId}/{associationTypeId}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Put, + Path = + $"crm/v1/custom-object-classes/{sourceClassId}/custom-objects/{sourceObjectId}/associations/{targetClassId}/{targetObjectId}/{associationTypeId}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsListRequest.cs b/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsListRequest.cs index a19e0ee8..6d0d60c3 100644 --- a/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsListRequest.cs +++ b/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesCustomObjectsAssociationsListRequest diff --git a/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.cs b/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.cs index 78408c17..f3e9f638 100644 --- a/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.cs +++ b/src/Merge.Client/Crm/Associations/Requests/CustomObjectClassesCustomObjectsAssociationsUpdateRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesCustomObjectsAssociationsUpdateRequest diff --git a/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs index 5d030896..c9966cb3 100644 --- a/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Crm/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Crm.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs index 9edbfdf9..a04b5a39 100644 --- a/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Crm/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Crm.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Crm/AuditTrail/Requests/AuditTrailListRequest.cs index eb102841..c301315f 100644 --- a/src/Merge.Client/Crm/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Crm/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AuditTrailListRequest diff --git a/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs index cd061200..f199e4fd 100644 --- a/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Crm/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Crm.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Contacts/ContactsClient.cs b/src/Merge.Client/Crm/Contacts/ContactsClient.cs index 825409bb..edc1e47a 100644 --- a/src/Merge.Client/Crm/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Crm/Contacts/ContactsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class ContactsClient @@ -24,7 +22,7 @@ internal ContactsClient(RawClient client) /// await client.Crm.Contacts.ListAsync(new ContactsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ContactsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,19 +57,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -87,7 +87,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PhoneNumbers != null) { @@ -97,17 +97,19 @@ public async Task ListAsync( { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/contacts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/contacts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +140,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( CrmContactEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,25 +149,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/contacts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/contacts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +199,7 @@ public async Task CreateAsync( /// await client.Crm.Contacts.RetrieveAsync("id", new ContactsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ContactsRetrieveRequest request, RequestOptions? options = null, @@ -208,23 +213,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/contacts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/contacts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -256,7 +265,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedCrmContactEndpointRequest request, RequestOptions? options = null, @@ -266,25 +275,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/contacts/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/contacts/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -323,17 +335,20 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"crm/v1/contacts/ignore/{modelId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"crm/v1/contacts/ignore/{modelId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; @@ -354,22 +369,24 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( /// await client.Crm.Contacts.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/contacts/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/contacts/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -398,21 +415,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Crm.Contacts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/contacts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/contacts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -441,7 +460,7 @@ public async Task MetaPostRetrieveAsync( /// await client.Crm.Contacts.RemoteFieldClassesListAsync(new ContactsRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( ContactsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -454,39 +473,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/contacts/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/contacts/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Contacts/Requests/ContactsListRequest.cs b/src/Merge.Client/Crm/Contacts/Requests/ContactsListRequest.cs index 7d08a185..6f5fe6dc 100644 --- a/src/Merge.Client/Crm/Contacts/Requests/ContactsListRequest.cs +++ b/src/Merge.Client/Crm/Contacts/Requests/ContactsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ContactsListRequest diff --git a/src/Merge.Client/Crm/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs index 94c92a94..b6df484e 100644 --- a/src/Merge.Client/Crm/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Contacts/Requests/ContactsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ContactsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Contacts/Requests/ContactsRetrieveRequest.cs b/src/Merge.Client/Crm/Contacts/Requests/ContactsRetrieveRequest.cs index 74f9f9a5..639c56e4 100644 --- a/src/Merge.Client/Crm/Contacts/Requests/ContactsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Contacts/Requests/ContactsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ContactsRetrieveRequest diff --git a/src/Merge.Client/Crm/Contacts/Requests/CrmContactEndpointRequest.cs b/src/Merge.Client/Crm/Contacts/Requests/CrmContactEndpointRequest.cs index 4f1d73c6..a363f4cc 100644 --- a/src/Merge.Client/Crm/Contacts/Requests/CrmContactEndpointRequest.cs +++ b/src/Merge.Client/Crm/Contacts/Requests/CrmContactEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmContactEndpointRequest diff --git a/src/Merge.Client/Crm/Contacts/Requests/PatchedCrmContactEndpointRequest.cs b/src/Merge.Client/Crm/Contacts/Requests/PatchedCrmContactEndpointRequest.cs index 92150029..5466c30b 100644 --- a/src/Merge.Client/Crm/Contacts/Requests/PatchedCrmContactEndpointRequest.cs +++ b/src/Merge.Client/Crm/Contacts/Requests/PatchedCrmContactEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedCrmContactEndpointRequest diff --git a/src/Merge.Client/Crm/Contacts/Types/ContactsListRequestExpand.cs b/src/Merge.Client/Crm/Contacts/Types/ContactsListRequestExpand.cs index b896ad4e..29c837dd 100644 --- a/src/Merge.Client/Crm/Contacts/Types/ContactsListRequestExpand.cs +++ b/src/Merge.Client/Crm/Contacts/Types/ContactsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ContactsListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Contacts/Types/ContactsRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Contacts/Types/ContactsRetrieveRequestExpand.cs index 850d2aad..8d0a6ddc 100644 --- a/src/Merge.Client/Crm/Contacts/Types/ContactsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Contacts/Types/ContactsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ContactsRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/CrmClient.cs b/src/Merge.Client/Crm/CrmClient.cs index c0d71335..35e7b680 100644 --- a/src/Merge.Client/Crm/CrmClient.cs +++ b/src/Merge.Client/Crm/CrmClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class CrmClient diff --git a/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs b/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs index 4e748cbc..3696314d 100644 --- a/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs +++ b/src/Merge.Client/Crm/CustomObjectClasses/CustomObjectClassesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class CustomObjectClassesClient @@ -24,7 +22,7 @@ internal CustomObjectClassesClient(RawClient client) /// await client.Crm.CustomObjectClasses.ListAsync(new CustomObjectClassesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CustomObjectClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/custom-object-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/custom-object-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +120,7 @@ public async Task ListAsync( /// await client.Crm.CustomObjectClasses.RetrieveAsync("id", new CustomObjectClassesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CustomObjectClassesRetrieveRequest request, RequestOptions? options = null, @@ -134,19 +134,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/custom-object-classes/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/custom-object-classes/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesListRequest.cs b/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesListRequest.cs index 5413f64d..04b1acee 100644 --- a/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesListRequest.cs +++ b/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesListRequest diff --git a/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesRetrieveRequest.cs b/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesRetrieveRequest.cs index 2b5af9bb..41242efd 100644 --- a/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/CustomObjectClasses/Requests/CustomObjectClassesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesRetrieveRequest diff --git a/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs b/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs index 3c802eb2..27c9564b 100644 --- a/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs +++ b/src/Merge.Client/Crm/CustomObjects/CustomObjectsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class CustomObjectsClient @@ -27,7 +25,7 @@ internal CustomObjectsClient(RawClient client) /// ); /// /// - public async Task CustomObjectClassesCustomObjectsListAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsListAsync( string customObjectClassId, CustomObjectClassesCustomObjectsListRequest request, RequestOptions? options = null, @@ -51,19 +49,21 @@ public async Task CustomObjectClassesCustomObjectsLis } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +79,25 @@ public async Task CustomObjectClassesCustomObjectsLis } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -127,13 +129,13 @@ public async Task CustomObjectClassesCustomObjectsLis /// { /// Model = new CustomObjectRequest /// { - /// Fields = new Dictionary() { { "test_field", "hello" } }, + /// Fields = new Dictionary<string, object>() { { "test_field", "hello" } }, /// }, /// } /// ); /// /// - public async Task CustomObjectClassesCustomObjectsCreateAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsCreateAsync( string customObjectClassId, CrmCustomObjectEndpointRequest request, RequestOptions? options = null, @@ -143,25 +145,28 @@ public async Task CustomObjectClassesCustomObjectsCreat var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +199,7 @@ public async Task CustomObjectClassesCustomObjectsCreat /// ); /// /// - public async Task CustomObjectClassesCustomObjectsRetrieveAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsRetrieveAsync( string customObjectClassId, string id, CustomObjectClassesCustomObjectsRetrieveRequest request, @@ -205,23 +210,28 @@ public async Task CustomObjectClassesCustomObjectsRetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -252,23 +262,25 @@ public async Task CustomObjectClassesCustomObjectsRetrieveAsync( /// ); /// /// - public async Task CustomObjectClassesCustomObjectsMetaPostRetrieveAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsMetaPostRetrieveAsync( string customObjectClassId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = - $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"crm/v1/custom-object-classes/{customObjectClassId}/custom-objects/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -299,7 +311,7 @@ public async Task CustomObjectClassesCustomObjectsMetaPostRetrieve /// ); /// /// - public async Task CustomObjectClassesCustomObjectsRemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task CustomObjectClassesCustomObjectsRemoteFieldClassesListAsync( CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -312,39 +324,43 @@ public async Task CustomObjectClassesCustomObject } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/custom-object-classes/custom-objects/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/custom-object-classes/custom-objects/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/CustomObjects/Requests/CrmCustomObjectEndpointRequest.cs b/src/Merge.Client/Crm/CustomObjects/Requests/CrmCustomObjectEndpointRequest.cs index 4a81c614..0a975062 100644 --- a/src/Merge.Client/Crm/CustomObjects/Requests/CrmCustomObjectEndpointRequest.cs +++ b/src/Merge.Client/Crm/CustomObjects/Requests/CrmCustomObjectEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmCustomObjectEndpointRequest diff --git a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsListRequest.cs b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsListRequest.cs index 8f9ae7f7..17d68e4f 100644 --- a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsListRequest.cs +++ b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesCustomObjectsListRequest diff --git a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.cs index cf78b467..6af5f3c4 100644 --- a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRetrieveRequest.cs b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRetrieveRequest.cs index 91278f62..442adea5 100644 --- a/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/CustomObjects/Requests/CustomObjectClassesCustomObjectsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClassesCustomObjectsRetrieveRequest diff --git a/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs index 1a9e4493..726538c8 100644 --- a/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Crm/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs b/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs index 1d762094..c854577d 100644 --- a/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs +++ b/src/Merge.Client/Crm/EngagementTypes/EngagementTypesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class EngagementTypesClient @@ -24,7 +22,7 @@ internal EngagementTypesClient(RawClient client) /// await client.Crm.EngagementTypes.ListAsync(new EngagementTypesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EngagementTypesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,19 +45,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/engagement-types", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/engagement-types", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +122,7 @@ public async Task ListAsync( /// await client.Crm.EngagementTypes.RetrieveAsync("id", new EngagementTypesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EngagementTypesRetrieveRequest request, RequestOptions? options = null, @@ -130,23 +132,27 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/engagement-types/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/engagement-types/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -177,7 +183,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( EngagementTypesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -190,39 +196,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/engagement-types/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/engagement-types/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesListRequest.cs b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesListRequest.cs index 58f618e4..6c751517 100644 --- a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesListRequest.cs +++ b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementTypesListRequest diff --git a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRemoteFieldClassesListRequest.cs index d6a2d40f..06d55b45 100644 --- a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementTypesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRetrieveRequest.cs b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRetrieveRequest.cs index 9946a09b..1e81c0f1 100644 --- a/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/EngagementTypes/Requests/EngagementTypesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementTypesRetrieveRequest diff --git a/src/Merge.Client/Crm/Engagements/EngagementsClient.cs b/src/Merge.Client/Crm/Engagements/EngagementsClient.cs index 0535fb80..8fdde7cf 100644 --- a/src/Merge.Client/Crm/Engagements/EngagementsClient.cs +++ b/src/Merge.Client/Crm/Engagements/EngagementsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class EngagementsClient @@ -24,7 +22,7 @@ internal EngagementsClient(RawClient client) /// await client.Crm.Engagements.ListAsync(new EngagementsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EngagementsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,19 +49,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +79,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -95,17 +95,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/engagements", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/engagements", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EngagementEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -145,25 +147,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/engagements", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/engagements", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -192,7 +197,7 @@ public async Task CreateAsync( /// await client.Crm.Engagements.RetrieveAsync("id", new EngagementsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EngagementsRetrieveRequest request, RequestOptions? options = null, @@ -206,23 +211,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/engagements/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/engagements/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -254,7 +263,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedEngagementEndpointRequest request, RequestOptions? options = null, @@ -264,25 +273,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/engagements/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/engagements/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -311,22 +323,24 @@ public async Task PartialUpdateAsync( /// await client.Crm.Engagements.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/engagements/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/engagements/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -355,21 +369,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Crm.Engagements.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/engagements/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/engagements/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -400,7 +416,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( EngagementsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -413,39 +429,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/engagements/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/engagements/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Engagements/Requests/EngagementEndpointRequest.cs b/src/Merge.Client/Crm/Engagements/Requests/EngagementEndpointRequest.cs index c5d16433..c40dbf9f 100644 --- a/src/Merge.Client/Crm/Engagements/Requests/EngagementEndpointRequest.cs +++ b/src/Merge.Client/Crm/Engagements/Requests/EngagementEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementEndpointRequest diff --git a/src/Merge.Client/Crm/Engagements/Requests/EngagementsListRequest.cs b/src/Merge.Client/Crm/Engagements/Requests/EngagementsListRequest.cs index 4fd8bc74..9216507f 100644 --- a/src/Merge.Client/Crm/Engagements/Requests/EngagementsListRequest.cs +++ b/src/Merge.Client/Crm/Engagements/Requests/EngagementsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementsListRequest diff --git a/src/Merge.Client/Crm/Engagements/Requests/EngagementsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Engagements/Requests/EngagementsRemoteFieldClassesListRequest.cs index f35e2e64..1e7ab3c9 100644 --- a/src/Merge.Client/Crm/Engagements/Requests/EngagementsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Engagements/Requests/EngagementsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Engagements/Requests/EngagementsRetrieveRequest.cs b/src/Merge.Client/Crm/Engagements/Requests/EngagementsRetrieveRequest.cs index f887cd8c..48b8351a 100644 --- a/src/Merge.Client/Crm/Engagements/Requests/EngagementsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Engagements/Requests/EngagementsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementsRetrieveRequest diff --git a/src/Merge.Client/Crm/Engagements/Requests/PatchedEngagementEndpointRequest.cs b/src/Merge.Client/Crm/Engagements/Requests/PatchedEngagementEndpointRequest.cs index e151cbe4..b2eaa31d 100644 --- a/src/Merge.Client/Crm/Engagements/Requests/PatchedEngagementEndpointRequest.cs +++ b/src/Merge.Client/Crm/Engagements/Requests/PatchedEngagementEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedEngagementEndpointRequest diff --git a/src/Merge.Client/Crm/Engagements/Types/EngagementsListRequestExpand.cs b/src/Merge.Client/Crm/Engagements/Types/EngagementsListRequestExpand.cs index 15dc9b4f..b41f382e 100644 --- a/src/Merge.Client/Crm/Engagements/Types/EngagementsListRequestExpand.cs +++ b/src/Merge.Client/Crm/Engagements/Types/EngagementsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EngagementsListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Engagements/Types/EngagementsRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Engagements/Types/EngagementsRetrieveRequestExpand.cs index 81a92d0f..34f22952 100644 --- a/src/Merge.Client/Crm/Engagements/Types/EngagementsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Engagements/Types/EngagementsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EngagementsRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs index f4dc2794..d08f97cf 100644 --- a/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Crm/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class FieldMappingClient @@ -24,7 +22,7 @@ internal FieldMappingClient(RawClient client) /// await client.Crm.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -33,19 +31,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,7 +78,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -84,7 +86,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -93,7 +95,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -104,18 +108,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,22 +151,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Crm.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"crm/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"crm/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,24 +200,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -237,7 +249,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Crm.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -252,17 +264,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -291,21 +305,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Crm.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Crm/FieldMapping/Requests/CreateFieldMappingRequest.cs index a5a8b425..09c0765c 100644 --- a/src/Merge.Client/Crm/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Crm/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Crm/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Crm/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index 27d7889b..c5702495 100644 --- a/src/Merge.Client/Crm/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Crm/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Crm/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index d8896d96..47b3de09 100644 --- a/src/Merge.Client/Crm/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Crm/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Crm/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Crm/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index d8e7f19d..c88aeb3a 100644 --- a/src/Merge.Client/Crm/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs index 3d083c9c..d6f4d0fb 100644 --- a/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Crm/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Crm.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs index 03210843..a87973e9 100644 --- a/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Crm/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Crm/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index c0fffaf2..6778a3d9 100644 --- a/src/Merge.Client/Crm/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Crm/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Crm/Issues/IssuesClient.cs b/src/Merge.Client/Crm/Issues/IssuesClient.cs index a138fe2a..cb685932 100644 --- a/src/Merge.Client/Crm/Issues/IssuesClient.cs +++ b/src/Merge.Client/Crm/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Crm.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Crm.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Crm/Issues/Requests/IssuesListRequest.cs index ba742066..b97cccda 100644 --- a/src/Merge.Client/Crm/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Crm/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record IssuesListRequest diff --git a/src/Merge.Client/Crm/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Crm/Issues/Types/IssuesListRequestStatus.cs index e481aa03..be93a5a3 100644 --- a/src/Merge.Client/Crm/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Crm/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Crm/Leads/LeadsClient.cs b/src/Merge.Client/Crm/Leads/LeadsClient.cs index 9a7b77da..660c9f29 100644 --- a/src/Merge.Client/Crm/Leads/LeadsClient.cs +++ b/src/Merge.Client/Crm/Leads/LeadsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class LeadsClient @@ -24,7 +22,7 @@ internal LeadsClient(RawClient client) /// await client.Crm.Leads.ListAsync(new LeadsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LeadsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,19 +61,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -95,7 +95,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PhoneNumbers != null) { @@ -105,17 +105,19 @@ public async Task ListAsync( { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/leads", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/leads", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,7 +146,7 @@ public async Task ListAsync( /// await client.Crm.Leads.CreateAsync(new LeadEndpointRequest { Model = new LeadRequest() }); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( LeadEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -153,25 +155,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/leads", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/leads", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -200,7 +205,7 @@ public async Task CreateAsync( /// await client.Crm.Leads.RetrieveAsync("id", new LeadsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, LeadsRetrieveRequest request, RequestOptions? options = null, @@ -214,23 +219,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/leads/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/leads/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -259,21 +268,23 @@ public async Task RetrieveAsync( /// await client.Crm.Leads.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/leads/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/leads/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -302,7 +313,7 @@ public async Task MetaPostRetrieveAsync( /// await client.Crm.Leads.RemoteFieldClassesListAsync(new LeadsRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( LeadsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -315,39 +326,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/leads/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/leads/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Leads/Requests/LeadEndpointRequest.cs b/src/Merge.Client/Crm/Leads/Requests/LeadEndpointRequest.cs index 1d8d783c..bfd980df 100644 --- a/src/Merge.Client/Crm/Leads/Requests/LeadEndpointRequest.cs +++ b/src/Merge.Client/Crm/Leads/Requests/LeadEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LeadEndpointRequest diff --git a/src/Merge.Client/Crm/Leads/Requests/LeadsListRequest.cs b/src/Merge.Client/Crm/Leads/Requests/LeadsListRequest.cs index b301ce1a..6a035c77 100644 --- a/src/Merge.Client/Crm/Leads/Requests/LeadsListRequest.cs +++ b/src/Merge.Client/Crm/Leads/Requests/LeadsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LeadsListRequest diff --git a/src/Merge.Client/Crm/Leads/Requests/LeadsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Leads/Requests/LeadsRemoteFieldClassesListRequest.cs index 42a15361..65de80d2 100644 --- a/src/Merge.Client/Crm/Leads/Requests/LeadsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Leads/Requests/LeadsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LeadsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Leads/Requests/LeadsRetrieveRequest.cs b/src/Merge.Client/Crm/Leads/Requests/LeadsRetrieveRequest.cs index 9a4e4b38..a664578a 100644 --- a/src/Merge.Client/Crm/Leads/Requests/LeadsRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Leads/Requests/LeadsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LeadsRetrieveRequest diff --git a/src/Merge.Client/Crm/Leads/Types/LeadsListRequestExpand.cs b/src/Merge.Client/Crm/Leads/Types/LeadsListRequestExpand.cs index af43dd38..5f37b3b3 100644 --- a/src/Merge.Client/Crm/Leads/Types/LeadsListRequestExpand.cs +++ b/src/Merge.Client/Crm/Leads/Types/LeadsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LeadsListRequestExpand { [EnumMember(Value = "converted_account")] diff --git a/src/Merge.Client/Crm/Leads/Types/LeadsRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Leads/Types/LeadsRetrieveRequestExpand.cs index d762afaa..7be1ecba 100644 --- a/src/Merge.Client/Crm/Leads/Types/LeadsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Leads/Types/LeadsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LeadsRetrieveRequestExpand { [EnumMember(Value = "converted_account")] diff --git a/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs index ed4227dc..d7b4f59e 100644 --- a/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Crm/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Crm.CategoriesEnum>() /// { /// Merge.Client.Crm.CategoriesEnum.Hris, /// Merge.Client.Crm.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Crm/LinkToken/Requests/EndUserDetailsRequest.cs index 1c158e69..591e22a4 100644 --- a/src/Merge.Client/Crm/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Crm/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs index bb861859..22100c27 100644 --- a/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Crm/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Crm.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Crm/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index b7c0d277..e9770a5d 100644 --- a/src/Merge.Client/Crm/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Crm/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Crm/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Crm/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index 5bfa6de4..efc9d3f1 100644 --- a/src/Merge.Client/Crm/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Crm/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Crm/Notes/NotesClient.cs b/src/Merge.Client/Crm/Notes/NotesClient.cs index db38f387..44220ef9 100644 --- a/src/Merge.Client/Crm/Notes/NotesClient.cs +++ b/src/Merge.Client/Crm/Notes/NotesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class NotesClient @@ -24,7 +22,7 @@ internal NotesClient(RawClient client) /// await client.Crm.Notes.ListAsync(new NotesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( NotesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,19 +57,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -95,23 +95,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/notes", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/notes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -140,7 +142,7 @@ public async Task ListAsync( /// await client.Crm.Notes.CreateAsync(new NoteEndpointRequest { Model = new NoteRequest() }); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( NoteEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -149,25 +151,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/notes", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/notes", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -196,7 +201,7 @@ public async Task CreateAsync( /// await client.Crm.Notes.RetrieveAsync("id", new NotesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, NotesRetrieveRequest request, RequestOptions? options = null, @@ -210,23 +215,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/notes/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/notes/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -255,21 +264,23 @@ public async Task RetrieveAsync( /// await client.Crm.Notes.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/notes/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/notes/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -298,7 +309,7 @@ public async Task MetaPostRetrieveAsync( /// await client.Crm.Notes.RemoteFieldClassesListAsync(new NotesRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( NotesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -311,39 +322,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/notes/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/notes/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Notes/Requests/NoteEndpointRequest.cs b/src/Merge.Client/Crm/Notes/Requests/NoteEndpointRequest.cs index f7cae557..3f0e09cc 100644 --- a/src/Merge.Client/Crm/Notes/Requests/NoteEndpointRequest.cs +++ b/src/Merge.Client/Crm/Notes/Requests/NoteEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record NoteEndpointRequest diff --git a/src/Merge.Client/Crm/Notes/Requests/NotesListRequest.cs b/src/Merge.Client/Crm/Notes/Requests/NotesListRequest.cs index b8aba715..3c38db19 100644 --- a/src/Merge.Client/Crm/Notes/Requests/NotesListRequest.cs +++ b/src/Merge.Client/Crm/Notes/Requests/NotesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record NotesListRequest diff --git a/src/Merge.Client/Crm/Notes/Requests/NotesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Notes/Requests/NotesRemoteFieldClassesListRequest.cs index 514ba731..c4557399 100644 --- a/src/Merge.Client/Crm/Notes/Requests/NotesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Notes/Requests/NotesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record NotesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Notes/Requests/NotesRetrieveRequest.cs b/src/Merge.Client/Crm/Notes/Requests/NotesRetrieveRequest.cs index 7f13fcaa..626d5f5e 100644 --- a/src/Merge.Client/Crm/Notes/Requests/NotesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Notes/Requests/NotesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record NotesRetrieveRequest diff --git a/src/Merge.Client/Crm/Notes/Types/NotesListRequestExpand.cs b/src/Merge.Client/Crm/Notes/Types/NotesListRequestExpand.cs index 12ef7cd8..af2048b5 100644 --- a/src/Merge.Client/Crm/Notes/Types/NotesListRequestExpand.cs +++ b/src/Merge.Client/Crm/Notes/Types/NotesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum NotesListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Notes/Types/NotesRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Notes/Types/NotesRetrieveRequestExpand.cs index f8117bd1..2539befb 100644 --- a/src/Merge.Client/Crm/Notes/Types/NotesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Notes/Types/NotesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum NotesRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs b/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs index 5a5d1f62..ef516cc2 100644 --- a/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs +++ b/src/Merge.Client/Crm/Opportunities/OpportunitiesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class OpportunitiesClient @@ -24,7 +22,7 @@ internal OpportunitiesClient(RawClient client) /// await client.Crm.Opportunities.ListAsync(new OpportunitiesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( OpportunitiesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,19 +53,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -87,7 +87,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteCreatedAfter != null) { @@ -115,17 +115,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/opportunities", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/opportunities", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -156,7 +158,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( OpportunityEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -165,25 +167,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/opportunities", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/opportunities", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -212,7 +217,7 @@ public async Task CreateAsync( /// await client.Crm.Opportunities.RetrieveAsync("id", new OpportunitiesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, OpportunitiesRetrieveRequest request, RequestOptions? options = null, @@ -226,11 +231,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.RemoteFields != null) { @@ -240,17 +247,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/opportunities/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/opportunities/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -282,7 +291,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedOpportunityEndpointRequest request, RequestOptions? options = null, @@ -292,25 +301,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/opportunities/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/opportunities/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -339,22 +351,24 @@ public async Task PartialUpdateAsync( /// await client.Crm.Opportunities.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/opportunities/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/opportunities/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -383,21 +397,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Crm.Opportunities.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/opportunities/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/opportunities/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -428,7 +444,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( OpportunitiesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -441,39 +457,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/opportunities/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/opportunities/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesListRequest.cs b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesListRequest.cs index 37c72a89..2cf340a6 100644 --- a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesListRequest.cs +++ b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record OpportunitiesListRequest diff --git a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRemoteFieldClassesListRequest.cs index 32b089a3..10d003dd 100644 --- a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record OpportunitiesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRetrieveRequest.cs b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRetrieveRequest.cs index 8b435f8b..05c191ef 100644 --- a/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Opportunities/Requests/OpportunitiesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record OpportunitiesRetrieveRequest diff --git a/src/Merge.Client/Crm/Opportunities/Requests/OpportunityEndpointRequest.cs b/src/Merge.Client/Crm/Opportunities/Requests/OpportunityEndpointRequest.cs index 375b8e5e..315c3c49 100644 --- a/src/Merge.Client/Crm/Opportunities/Requests/OpportunityEndpointRequest.cs +++ b/src/Merge.Client/Crm/Opportunities/Requests/OpportunityEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record OpportunityEndpointRequest diff --git a/src/Merge.Client/Crm/Opportunities/Requests/PatchedOpportunityEndpointRequest.cs b/src/Merge.Client/Crm/Opportunities/Requests/PatchedOpportunityEndpointRequest.cs index 451a180c..3b96f07a 100644 --- a/src/Merge.Client/Crm/Opportunities/Requests/PatchedOpportunityEndpointRequest.cs +++ b/src/Merge.Client/Crm/Opportunities/Requests/PatchedOpportunityEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedOpportunityEndpointRequest diff --git a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestExpand.cs b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestExpand.cs index 083a6168..c01abcaa 100644 --- a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestExpand.cs +++ b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OpportunitiesListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestStatus.cs b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestStatus.cs index 4fb3aa46..832347be 100644 --- a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestStatus.cs +++ b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OpportunitiesListRequestStatus { [EnumMember(Value = "LOST")] diff --git a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesRetrieveRequestExpand.cs index 57cbf0f3..1dae32e5 100644 --- a/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Opportunities/Types/OpportunitiesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OpportunitiesRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs b/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs index bf5f1d09..8d69bcdf 100644 --- a/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Crm/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs index 7107d4d4..f4fc3a29 100644 --- a/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Crm/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Crm/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index 424f68d7..7bfbf2b7 100644 --- a/src/Merge.Client/Crm/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Crm/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Crm/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Crm/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index 97a082f3..c7387fc1 100644 --- a/src/Merge.Client/Crm/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Crm/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Crm/Scopes/ScopesClient.cs b/src/Merge.Client/Crm/Scopes/ScopesClient.cs index 41475b53..7997f90f 100644 --- a/src/Merge.Client/Crm/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Crm/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Crm.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Crm.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -110,15 +112,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// await client.Crm.Scopes.LinkedAccountScopesCreateAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { - /// CommonModels = new List() + /// CommonModels = new List<Merge.Client.Crm.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Crm.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Crm.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -134,17 +136,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// }, /// FieldPermissions = new Merge.Client.Crm.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Crm.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Crm.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -160,23 +162,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Stages/Requests/StagesListRequest.cs b/src/Merge.Client/Crm/Stages/Requests/StagesListRequest.cs index 03b70020..7aabf186 100644 --- a/src/Merge.Client/Crm/Stages/Requests/StagesListRequest.cs +++ b/src/Merge.Client/Crm/Stages/Requests/StagesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record StagesListRequest diff --git a/src/Merge.Client/Crm/Stages/Requests/StagesRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Stages/Requests/StagesRemoteFieldClassesListRequest.cs index 75a31e05..139b563d 100644 --- a/src/Merge.Client/Crm/Stages/Requests/StagesRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Stages/Requests/StagesRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record StagesRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Stages/Requests/StagesRetrieveRequest.cs b/src/Merge.Client/Crm/Stages/Requests/StagesRetrieveRequest.cs index 956ce1fa..46717dcc 100644 --- a/src/Merge.Client/Crm/Stages/Requests/StagesRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Stages/Requests/StagesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record StagesRetrieveRequest diff --git a/src/Merge.Client/Crm/Stages/StagesClient.cs b/src/Merge.Client/Crm/Stages/StagesClient.cs index de131a49..9cf7ef58 100644 --- a/src/Merge.Client/Crm/Stages/StagesClient.cs +++ b/src/Merge.Client/Crm/Stages/StagesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class StagesClient @@ -24,7 +22,7 @@ internal StagesClient(RawClient client) /// await client.Crm.Stages.ListAsync(new StagesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( StagesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,19 +45,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/stages", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/stages", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +122,7 @@ public async Task ListAsync( /// await client.Crm.Stages.RetrieveAsync("id", new StagesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, StagesRetrieveRequest request, RequestOptions? options = null, @@ -130,23 +132,27 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/stages/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/stages/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -175,7 +181,7 @@ public async Task RetrieveAsync( /// await client.Crm.Stages.RemoteFieldClassesListAsync(new StagesRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( StagesRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -188,39 +194,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/stages/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/stages/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Crm/SyncStatus/Requests/SyncStatusListRequest.cs index d758d5de..f9820dff 100644 --- a/src/Merge.Client/Crm/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Crm/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record SyncStatusListRequest diff --git a/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs index 2300e5c1..ee80d56e 100644 --- a/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Crm/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Crm.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Tasks/Requests/PatchedTaskEndpointRequest.cs b/src/Merge.Client/Crm/Tasks/Requests/PatchedTaskEndpointRequest.cs index 28e4299a..74f3f2ee 100644 --- a/src/Merge.Client/Crm/Tasks/Requests/PatchedTaskEndpointRequest.cs +++ b/src/Merge.Client/Crm/Tasks/Requests/PatchedTaskEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedTaskEndpointRequest diff --git a/src/Merge.Client/Crm/Tasks/Requests/TaskEndpointRequest.cs b/src/Merge.Client/Crm/Tasks/Requests/TaskEndpointRequest.cs index dbba4545..914227ae 100644 --- a/src/Merge.Client/Crm/Tasks/Requests/TaskEndpointRequest.cs +++ b/src/Merge.Client/Crm/Tasks/Requests/TaskEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record TaskEndpointRequest diff --git a/src/Merge.Client/Crm/Tasks/Requests/TasksListRequest.cs b/src/Merge.Client/Crm/Tasks/Requests/TasksListRequest.cs index 232cc315..c1874c3c 100644 --- a/src/Merge.Client/Crm/Tasks/Requests/TasksListRequest.cs +++ b/src/Merge.Client/Crm/Tasks/Requests/TasksListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record TasksListRequest diff --git a/src/Merge.Client/Crm/Tasks/Requests/TasksRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Tasks/Requests/TasksRemoteFieldClassesListRequest.cs index a7feb1f9..453f8a69 100644 --- a/src/Merge.Client/Crm/Tasks/Requests/TasksRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Tasks/Requests/TasksRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record TasksRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Tasks/Requests/TasksRetrieveRequest.cs b/src/Merge.Client/Crm/Tasks/Requests/TasksRetrieveRequest.cs index 7152566c..75b7f247 100644 --- a/src/Merge.Client/Crm/Tasks/Requests/TasksRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Tasks/Requests/TasksRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record TasksRetrieveRequest diff --git a/src/Merge.Client/Crm/Tasks/TasksClient.cs b/src/Merge.Client/Crm/Tasks/TasksClient.cs index 37060974..59ece5a4 100644 --- a/src/Merge.Client/Crm/Tasks/TasksClient.cs +++ b/src/Merge.Client/Crm/Tasks/TasksClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class TasksClient @@ -24,7 +22,7 @@ internal TasksClient(RawClient client) /// await client.Crm.Tasks.ListAsync(new TasksListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TasksListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,19 +49,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +79,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/tasks", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/tasks", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +126,7 @@ public async Task ListAsync( /// await client.Crm.Tasks.CreateAsync(new TaskEndpointRequest { Model = new TaskRequest() }); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TaskEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -133,25 +135,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/tasks", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/tasks", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -180,7 +185,7 @@ public async Task CreateAsync( /// await client.Crm.Tasks.RetrieveAsync("id", new TasksRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TasksRetrieveRequest request, RequestOptions? options = null, @@ -194,23 +199,27 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/tasks/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/tasks/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -242,7 +251,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedTaskEndpointRequest request, RequestOptions? options = null, @@ -252,25 +261,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"crm/v1/tasks/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"crm/v1/tasks/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -299,22 +311,24 @@ public async Task PartialUpdateAsync( /// await client.Crm.Tasks.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/tasks/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/tasks/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -343,21 +357,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Crm.Tasks.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/tasks/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/tasks/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -386,7 +402,7 @@ public async Task MetaPostRetrieveAsync( /// await client.Crm.Tasks.RemoteFieldClassesListAsync(new TasksRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( TasksRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -399,39 +415,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/tasks/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/tasks/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/Tasks/Types/TasksListRequestExpand.cs b/src/Merge.Client/Crm/Tasks/Types/TasksListRequestExpand.cs index a488ea3f..82b5e6de 100644 --- a/src/Merge.Client/Crm/Tasks/Types/TasksListRequestExpand.cs +++ b/src/Merge.Client/Crm/Tasks/Types/TasksListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TasksListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Tasks/Types/TasksRetrieveRequestExpand.cs b/src/Merge.Client/Crm/Tasks/Types/TasksRetrieveRequestExpand.cs index 3aa91b15..93c1b7cd 100644 --- a/src/Merge.Client/Crm/Tasks/Types/TasksRetrieveRequestExpand.cs +++ b/src/Merge.Client/Crm/Tasks/Types/TasksRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TasksRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Crm/Types/Account.cs b/src/Merge.Client/Crm/Types/Account.cs index 9b40a8be..ff674e18 100644 --- a/src/Merge.Client/Crm/Types/Account.cs +++ b/src/Merge.Client/Crm/Types/Account.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Account diff --git a/src/Merge.Client/Crm/Types/AccountDetails.cs b/src/Merge.Client/Crm/Types/AccountDetails.cs index baab9819..763c80ca 100644 --- a/src/Merge.Client/Crm/Types/AccountDetails.cs +++ b/src/Merge.Client/Crm/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountDetails diff --git a/src/Merge.Client/Crm/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Crm/Types/AccountDetailsAndActions.cs index 3bb7ddad..0cadd89f 100644 --- a/src/Merge.Client/Crm/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Crm/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Crm/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Crm/Types/AccountDetailsAndActionsIntegration.cs index a5e2dbcb..d8aa04f9 100644 --- a/src/Merge.Client/Crm/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Crm/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Crm/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Crm/Types/AccountDetailsAndActionsStatusEnum.cs index 19f6f3be..82e91c39 100644 --- a/src/Merge.Client/Crm/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Crm/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Crm/Types/AccountIntegration.cs b/src/Merge.Client/Crm/Types/AccountIntegration.cs index 54d25689..64ad5bc0 100644 --- a/src/Merge.Client/Crm/Types/AccountIntegration.cs +++ b/src/Merge.Client/Crm/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Crm/Types/AccountRequest.cs b/src/Merge.Client/Crm/Types/AccountRequest.cs index 697f9b80..12707a5b 100644 --- a/src/Merge.Client/Crm/Types/AccountRequest.cs +++ b/src/Merge.Client/Crm/Types/AccountRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record AccountRequest diff --git a/src/Merge.Client/Crm/Types/AccountToken.cs b/src/Merge.Client/Crm/Types/AccountToken.cs index 2f7ccf84..6fab399a 100644 --- a/src/Merge.Client/Crm/Types/AccountToken.cs +++ b/src/Merge.Client/Crm/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AccountToken diff --git a/src/Merge.Client/Crm/Types/ActivityTypeEnum.cs b/src/Merge.Client/Crm/Types/ActivityTypeEnum.cs index 512bff74..a215c09b 100644 --- a/src/Merge.Client/Crm/Types/ActivityTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/ActivityTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ActivityTypeEnum { [EnumMember(Value = "CALL")] diff --git a/src/Merge.Client/Crm/Types/Address.cs b/src/Merge.Client/Crm/Types/Address.cs index f216ffde..54fd08c6 100644 --- a/src/Merge.Client/Crm/Types/Address.cs +++ b/src/Merge.Client/Crm/Types/Address.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record Address diff --git a/src/Merge.Client/Crm/Types/AddressRequest.cs b/src/Merge.Client/Crm/Types/AddressRequest.cs index f8a160b8..90d8191a 100644 --- a/src/Merge.Client/Crm/Types/AddressRequest.cs +++ b/src/Merge.Client/Crm/Types/AddressRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AddressRequest diff --git a/src/Merge.Client/Crm/Types/AddressTypeEnum.cs b/src/Merge.Client/Crm/Types/AddressTypeEnum.cs index 1ab0d8f5..0b56a100 100644 --- a/src/Merge.Client/Crm/Types/AddressTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/AddressTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AddressTypeEnum { [EnumMember(Value = "BILLING")] diff --git a/src/Merge.Client/Crm/Types/AdvancedMetadata.cs b/src/Merge.Client/Crm/Types/AdvancedMetadata.cs index 2ae531e9..430eb2e7 100644 --- a/src/Merge.Client/Crm/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Crm/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AdvancedMetadata diff --git a/src/Merge.Client/Crm/Types/Association.cs b/src/Merge.Client/Crm/Types/Association.cs index a2701827..3a7a6e40 100644 --- a/src/Merge.Client/Crm/Types/Association.cs +++ b/src/Merge.Client/Crm/Types/Association.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Association diff --git a/src/Merge.Client/Crm/Types/AssociationSubType.cs b/src/Merge.Client/Crm/Types/AssociationSubType.cs index 7e10638f..af842e73 100644 --- a/src/Merge.Client/Crm/Types/AssociationSubType.cs +++ b/src/Merge.Client/Crm/Types/AssociationSubType.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AssociationSubType diff --git a/src/Merge.Client/Crm/Types/AssociationType.cs b/src/Merge.Client/Crm/Types/AssociationType.cs index 0a430aba..7f0127da 100644 --- a/src/Merge.Client/Crm/Types/AssociationType.cs +++ b/src/Merge.Client/Crm/Types/AssociationType.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AssociationType diff --git a/src/Merge.Client/Crm/Types/AssociationTypeRequestRequest.cs b/src/Merge.Client/Crm/Types/AssociationTypeRequestRequest.cs index c3028b0d..12d8be04 100644 --- a/src/Merge.Client/Crm/Types/AssociationTypeRequestRequest.cs +++ b/src/Merge.Client/Crm/Types/AssociationTypeRequestRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AssociationTypeRequestRequest diff --git a/src/Merge.Client/Crm/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Crm/Types/AsyncPassthroughReciept.cs index 62068070..bc0a1562 100644 --- a/src/Merge.Client/Crm/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Crm/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Crm/Types/AuditLogEvent.cs b/src/Merge.Client/Crm/Types/AuditLogEvent.cs index 30594989..c61bbec4 100644 --- a/src/Merge.Client/Crm/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Crm/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AuditLogEvent diff --git a/src/Merge.Client/Crm/Types/AvailableActions.cs b/src/Merge.Client/Crm/Types/AvailableActions.cs index 2a770637..a62e98f3 100644 --- a/src/Merge.Client/Crm/Types/AvailableActions.cs +++ b/src/Merge.Client/Crm/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record AvailableActions diff --git a/src/Merge.Client/Crm/Types/CardinalityEnum.cs b/src/Merge.Client/Crm/Types/CardinalityEnum.cs index 412ccf05..50d32c77 100644 --- a/src/Merge.Client/Crm/Types/CardinalityEnum.cs +++ b/src/Merge.Client/Crm/Types/CardinalityEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CardinalityEnum { [EnumMember(Value = "ONE_TO_ONE")] diff --git a/src/Merge.Client/Crm/Types/CategoriesEnum.cs b/src/Merge.Client/Crm/Types/CategoriesEnum.cs index 7d9e2ab9..85dc1e99 100644 --- a/src/Merge.Client/Crm/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Crm/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Crm/Types/CategoryEnum.cs b/src/Merge.Client/Crm/Types/CategoryEnum.cs index ea2a4fd7..b85a2cba 100644 --- a/src/Merge.Client/Crm/Types/CategoryEnum.cs +++ b/src/Merge.Client/Crm/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Crm/Types/CommonModelScopeApi.cs b/src/Merge.Client/Crm/Types/CommonModelScopeApi.cs index 5c628ed8..ace8092b 100644 --- a/src/Merge.Client/Crm/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Crm/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CommonModelScopeApi diff --git a/src/Merge.Client/Crm/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Crm/Types/CommonModelScopesBodyRequest.cs index 6911f7ee..92f8cbb7 100644 --- a/src/Merge.Client/Crm/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Crm/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Crm/Types/Contact.cs b/src/Merge.Client/Crm/Types/Contact.cs index 1fd76902..4a0843e4 100644 --- a/src/Merge.Client/Crm/Types/Contact.cs +++ b/src/Merge.Client/Crm/Types/Contact.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Contact diff --git a/src/Merge.Client/Crm/Types/ContactRequest.cs b/src/Merge.Client/Crm/Types/ContactRequest.cs index 1291c4a6..b0d1c8f1 100644 --- a/src/Merge.Client/Crm/Types/ContactRequest.cs +++ b/src/Merge.Client/Crm/Types/ContactRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record ContactRequest diff --git a/src/Merge.Client/Crm/Types/CountryEnum.cs b/src/Merge.Client/Crm/Types/CountryEnum.cs index c655daa8..966e1d08 100644 --- a/src/Merge.Client/Crm/Types/CountryEnum.cs +++ b/src/Merge.Client/Crm/Types/CountryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CountryEnum { [EnumMember(Value = "AF")] diff --git a/src/Merge.Client/Crm/Types/CrmAccountResponse.cs b/src/Merge.Client/Crm/Types/CrmAccountResponse.cs index 4c19fcf8..96b7e9c9 100644 --- a/src/Merge.Client/Crm/Types/CrmAccountResponse.cs +++ b/src/Merge.Client/Crm/Types/CrmAccountResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmAccountResponse diff --git a/src/Merge.Client/Crm/Types/CrmAssociationTypeResponse.cs b/src/Merge.Client/Crm/Types/CrmAssociationTypeResponse.cs index 5fc71b1a..b84a7e79 100644 --- a/src/Merge.Client/Crm/Types/CrmAssociationTypeResponse.cs +++ b/src/Merge.Client/Crm/Types/CrmAssociationTypeResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmAssociationTypeResponse diff --git a/src/Merge.Client/Crm/Types/CrmContactResponse.cs b/src/Merge.Client/Crm/Types/CrmContactResponse.cs index 711ed80a..2d94bc53 100644 --- a/src/Merge.Client/Crm/Types/CrmContactResponse.cs +++ b/src/Merge.Client/Crm/Types/CrmContactResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmContactResponse diff --git a/src/Merge.Client/Crm/Types/CrmCustomObjectResponse.cs b/src/Merge.Client/Crm/Types/CrmCustomObjectResponse.cs index 7d9cf33a..88f19934 100644 --- a/src/Merge.Client/Crm/Types/CrmCustomObjectResponse.cs +++ b/src/Merge.Client/Crm/Types/CrmCustomObjectResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CrmCustomObjectResponse diff --git a/src/Merge.Client/Crm/Types/CustomObject.cs b/src/Merge.Client/Crm/Types/CustomObject.cs index aab8adfa..e5ef8116 100644 --- a/src/Merge.Client/Crm/Types/CustomObject.cs +++ b/src/Merge.Client/Crm/Types/CustomObject.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObject diff --git a/src/Merge.Client/Crm/Types/CustomObjectClass.cs b/src/Merge.Client/Crm/Types/CustomObjectClass.cs index 5a17e62f..3d2c8b81 100644 --- a/src/Merge.Client/Crm/Types/CustomObjectClass.cs +++ b/src/Merge.Client/Crm/Types/CustomObjectClass.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectClass diff --git a/src/Merge.Client/Crm/Types/CustomObjectRequest.cs b/src/Merge.Client/Crm/Types/CustomObjectRequest.cs index 40716c90..73d8350d 100644 --- a/src/Merge.Client/Crm/Types/CustomObjectRequest.cs +++ b/src/Merge.Client/Crm/Types/CustomObjectRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record CustomObjectRequest diff --git a/src/Merge.Client/Crm/Types/DataPassthroughRequest.cs b/src/Merge.Client/Crm/Types/DataPassthroughRequest.cs index 4f5570e2..3235a512 100644 --- a/src/Merge.Client/Crm/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Crm/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record DataPassthroughRequest diff --git a/src/Merge.Client/Crm/Types/DebugModeLog.cs b/src/Merge.Client/Crm/Types/DebugModeLog.cs index 305e89fd..d4bed87b 100644 --- a/src/Merge.Client/Crm/Types/DebugModeLog.cs +++ b/src/Merge.Client/Crm/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record DebugModeLog diff --git a/src/Merge.Client/Crm/Types/DebugModelLogSummary.cs b/src/Merge.Client/Crm/Types/DebugModelLogSummary.cs index e24b78d3..a01317ec 100644 --- a/src/Merge.Client/Crm/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Crm/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record DebugModelLogSummary diff --git a/src/Merge.Client/Crm/Types/DirectionEnum.cs b/src/Merge.Client/Crm/Types/DirectionEnum.cs index 558fc193..94256d9d 100644 --- a/src/Merge.Client/Crm/Types/DirectionEnum.cs +++ b/src/Merge.Client/Crm/Types/DirectionEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum DirectionEnum { [EnumMember(Value = "INBOUND")] diff --git a/src/Merge.Client/Crm/Types/EmailAddress.cs b/src/Merge.Client/Crm/Types/EmailAddress.cs index bf80635f..3be94919 100644 --- a/src/Merge.Client/Crm/Types/EmailAddress.cs +++ b/src/Merge.Client/Crm/Types/EmailAddress.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EmailAddress diff --git a/src/Merge.Client/Crm/Types/EmailAddressRequest.cs b/src/Merge.Client/Crm/Types/EmailAddressRequest.cs index d09c9441..9e4d9168 100644 --- a/src/Merge.Client/Crm/Types/EmailAddressRequest.cs +++ b/src/Merge.Client/Crm/Types/EmailAddressRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EmailAddressRequest diff --git a/src/Merge.Client/Crm/Types/EnabledActionsEnum.cs b/src/Merge.Client/Crm/Types/EnabledActionsEnum.cs index 7ac3f77b..a012fce2 100644 --- a/src/Merge.Client/Crm/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Crm/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Crm/Types/EncodingEnum.cs b/src/Merge.Client/Crm/Types/EncodingEnum.cs index e0735a25..ddaf67b0 100644 --- a/src/Merge.Client/Crm/Types/EncodingEnum.cs +++ b/src/Merge.Client/Crm/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Crm/Types/Engagement.cs b/src/Merge.Client/Crm/Types/Engagement.cs index ee047a5c..06621e73 100644 --- a/src/Merge.Client/Crm/Types/Engagement.cs +++ b/src/Merge.Client/Crm/Types/Engagement.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Engagement diff --git a/src/Merge.Client/Crm/Types/EngagementRequest.cs b/src/Merge.Client/Crm/Types/EngagementRequest.cs index 468bedb7..5a7b5a08 100644 --- a/src/Merge.Client/Crm/Types/EngagementRequest.cs +++ b/src/Merge.Client/Crm/Types/EngagementRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record EngagementRequest diff --git a/src/Merge.Client/Crm/Types/EngagementResponse.cs b/src/Merge.Client/Crm/Types/EngagementResponse.cs index 7bd1baea..e37eaa90 100644 --- a/src/Merge.Client/Crm/Types/EngagementResponse.cs +++ b/src/Merge.Client/Crm/Types/EngagementResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementResponse diff --git a/src/Merge.Client/Crm/Types/EngagementType.cs b/src/Merge.Client/Crm/Types/EngagementType.cs index d121316d..db0bdab7 100644 --- a/src/Merge.Client/Crm/Types/EngagementType.cs +++ b/src/Merge.Client/Crm/Types/EngagementType.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record EngagementType diff --git a/src/Merge.Client/Crm/Types/ErrorValidationProblem.cs b/src/Merge.Client/Crm/Types/ErrorValidationProblem.cs index c41186f4..e4a73ee3 100644 --- a/src/Merge.Client/Crm/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Crm/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ErrorValidationProblem diff --git a/src/Merge.Client/Crm/Types/EventTypeEnum.cs b/src/Merge.Client/Crm/Types/EventTypeEnum.cs index b9197289..054c8dba 100644 --- a/src/Merge.Client/Crm/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Crm/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Crm/Types/ExternalTargetFieldApi.cs index f062bebd..283b609b 100644 --- a/src/Merge.Client/Crm/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Crm/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Crm/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Crm/Types/ExternalTargetFieldApiResponse.cs index 12ab4698..f851f3bd 100644 --- a/src/Merge.Client/Crm/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Crm/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Crm/Types/FieldFormatEnum.cs b/src/Merge.Client/Crm/Types/FieldFormatEnum.cs index 673271e3..07616b23 100644 --- a/src/Merge.Client/Crm/Types/FieldFormatEnum.cs +++ b/src/Merge.Client/Crm/Types/FieldFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Crm/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Crm/Types/FieldMappingApiInstance.cs index cdaccdff..afd24de0 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteField.cs index 3c899388..eacaba84 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index 06423fc2..2b418ef0 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceResponse.cs index bfb1a666..fa037ee7 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceTargetField.cs index ae15d0c9..a28ab2ca 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Crm/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Crm/Types/FieldMappingInstanceResponse.cs index 1a47c044..fbff9de5 100644 --- a/src/Merge.Client/Crm/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Crm/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Crm/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Crm/Types/FieldPermissionDeserializer.cs index 7dfc34da..51ca7210 100644 --- a/src/Merge.Client/Crm/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Crm/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Crm/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Crm/Types/FieldPermissionDeserializerRequest.cs index 526c35da..cd34705c 100644 --- a/src/Merge.Client/Crm/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Crm/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Crm/Types/FieldTypeEnum.cs b/src/Merge.Client/Crm/Types/FieldTypeEnum.cs index 7cc95be5..d81260da 100644 --- a/src/Merge.Client/Crm/Types/FieldTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/FieldTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Crm/Types/IgnoreCommonModelRequest.cs b/src/Merge.Client/Crm/Types/IgnoreCommonModelRequest.cs index bf029742..7b27cb4f 100644 --- a/src/Merge.Client/Crm/Types/IgnoreCommonModelRequest.cs +++ b/src/Merge.Client/Crm/Types/IgnoreCommonModelRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record IgnoreCommonModelRequest diff --git a/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializer.cs index 6aff8d38..159807a4 100644 --- a/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializerRequest.cs index 7b44747e..659654d3 100644 --- a/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Crm/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Crm/Types/Issue.cs b/src/Merge.Client/Crm/Types/Issue.cs index bc3feaa5..2355e2cf 100644 --- a/src/Merge.Client/Crm/Types/Issue.cs +++ b/src/Merge.Client/Crm/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record Issue diff --git a/src/Merge.Client/Crm/Types/IssueStatusEnum.cs b/src/Merge.Client/Crm/Types/IssueStatusEnum.cs index 15d1e93a..992de3f5 100644 --- a/src/Merge.Client/Crm/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Crm/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Crm/Types/ItemFormatEnum.cs b/src/Merge.Client/Crm/Types/ItemFormatEnum.cs index 608d312b..74f3d059 100644 --- a/src/Merge.Client/Crm/Types/ItemFormatEnum.cs +++ b/src/Merge.Client/Crm/Types/ItemFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Crm/Types/ItemSchema.cs b/src/Merge.Client/Crm/Types/ItemSchema.cs index 5eae9ce8..a4147141 100644 --- a/src/Merge.Client/Crm/Types/ItemSchema.cs +++ b/src/Merge.Client/Crm/Types/ItemSchema.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ItemSchema diff --git a/src/Merge.Client/Crm/Types/ItemTypeEnum.cs b/src/Merge.Client/Crm/Types/ItemTypeEnum.cs index ea0ab9b5..ba165fb0 100644 --- a/src/Merge.Client/Crm/Types/ItemTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/ItemTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Crm/Types/LanguageEnum.cs b/src/Merge.Client/Crm/Types/LanguageEnum.cs index aeae1b22..24b28849 100644 --- a/src/Merge.Client/Crm/Types/LanguageEnum.cs +++ b/src/Merge.Client/Crm/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Crm/Types/Lead.cs b/src/Merge.Client/Crm/Types/Lead.cs index c82d0bfa..23070d8b 100644 --- a/src/Merge.Client/Crm/Types/Lead.cs +++ b/src/Merge.Client/Crm/Types/Lead.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Lead diff --git a/src/Merge.Client/Crm/Types/LeadRequest.cs b/src/Merge.Client/Crm/Types/LeadRequest.cs index e8eece49..a2cb9747 100644 --- a/src/Merge.Client/Crm/Types/LeadRequest.cs +++ b/src/Merge.Client/Crm/Types/LeadRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record LeadRequest diff --git a/src/Merge.Client/Crm/Types/LeadResponse.cs b/src/Merge.Client/Crm/Types/LeadResponse.cs index c8e77a4d..b59a63d8 100644 --- a/src/Merge.Client/Crm/Types/LeadResponse.cs +++ b/src/Merge.Client/Crm/Types/LeadResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LeadResponse diff --git a/src/Merge.Client/Crm/Types/LinkToken.cs b/src/Merge.Client/Crm/Types/LinkToken.cs index 6b8398f7..ed2ba54d 100644 --- a/src/Merge.Client/Crm/Types/LinkToken.cs +++ b/src/Merge.Client/Crm/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LinkToken diff --git a/src/Merge.Client/Crm/Types/LinkedAccountStatus.cs b/src/Merge.Client/Crm/Types/LinkedAccountStatus.cs index f012e119..5d2de4ec 100644 --- a/src/Merge.Client/Crm/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Crm/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record LinkedAccountStatus diff --git a/src/Merge.Client/Crm/Types/MetaResponse.cs b/src/Merge.Client/Crm/Types/MetaResponse.cs index 315cc10e..9b3d10ad 100644 --- a/src/Merge.Client/Crm/Types/MetaResponse.cs +++ b/src/Merge.Client/Crm/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record MetaResponse diff --git a/src/Merge.Client/Crm/Types/MethodEnum.cs b/src/Merge.Client/Crm/Types/MethodEnum.cs index 6d0a041b..2f6913d1 100644 --- a/src/Merge.Client/Crm/Types/MethodEnum.cs +++ b/src/Merge.Client/Crm/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Crm/Types/ModelOperation.cs b/src/Merge.Client/Crm/Types/ModelOperation.cs index ecf4c3db..8728de06 100644 --- a/src/Merge.Client/Crm/Types/ModelOperation.cs +++ b/src/Merge.Client/Crm/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ModelOperation diff --git a/src/Merge.Client/Crm/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Crm/Types/ModelPermissionDeserializer.cs index 3a9a079b..d3d94d00 100644 --- a/src/Merge.Client/Crm/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Crm/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Crm/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Crm/Types/ModelPermissionDeserializerRequest.cs index 08e25bac..c614a6cb 100644 --- a/src/Merge.Client/Crm/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Crm/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Crm/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Crm/Types/MultipartFormFieldRequest.cs index dcde09b7..657fa68f 100644 --- a/src/Merge.Client/Crm/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Crm/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Crm/Types/Note.cs b/src/Merge.Client/Crm/Types/Note.cs index 9fa89eb0..b2b0abc0 100644 --- a/src/Merge.Client/Crm/Types/Note.cs +++ b/src/Merge.Client/Crm/Types/Note.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Note diff --git a/src/Merge.Client/Crm/Types/NoteRequest.cs b/src/Merge.Client/Crm/Types/NoteRequest.cs index 087e0e36..c75caf90 100644 --- a/src/Merge.Client/Crm/Types/NoteRequest.cs +++ b/src/Merge.Client/Crm/Types/NoteRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record NoteRequest diff --git a/src/Merge.Client/Crm/Types/NoteResponse.cs b/src/Merge.Client/Crm/Types/NoteResponse.cs index c2854ce6..7f5dc345 100644 --- a/src/Merge.Client/Crm/Types/NoteResponse.cs +++ b/src/Merge.Client/Crm/Types/NoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record NoteResponse diff --git a/src/Merge.Client/Crm/Types/ObjectClassDescriptionRequest.cs b/src/Merge.Client/Crm/Types/ObjectClassDescriptionRequest.cs index 82507160..3f3cfff2 100644 --- a/src/Merge.Client/Crm/Types/ObjectClassDescriptionRequest.cs +++ b/src/Merge.Client/Crm/Types/ObjectClassDescriptionRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ObjectClassDescriptionRequest diff --git a/src/Merge.Client/Crm/Types/Opportunity.cs b/src/Merge.Client/Crm/Types/Opportunity.cs index 155a7e9b..ab972583 100644 --- a/src/Merge.Client/Crm/Types/Opportunity.cs +++ b/src/Merge.Client/Crm/Types/Opportunity.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Opportunity diff --git a/src/Merge.Client/Crm/Types/OpportunityRequest.cs b/src/Merge.Client/Crm/Types/OpportunityRequest.cs index 5f40ab42..ad4a7541 100644 --- a/src/Merge.Client/Crm/Types/OpportunityRequest.cs +++ b/src/Merge.Client/Crm/Types/OpportunityRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record OpportunityRequest diff --git a/src/Merge.Client/Crm/Types/OpportunityResponse.cs b/src/Merge.Client/Crm/Types/OpportunityResponse.cs index f2fb734e..80338c0c 100644 --- a/src/Merge.Client/Crm/Types/OpportunityResponse.cs +++ b/src/Merge.Client/Crm/Types/OpportunityResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record OpportunityResponse diff --git a/src/Merge.Client/Crm/Types/OpportunityStatusEnum.cs b/src/Merge.Client/Crm/Types/OpportunityStatusEnum.cs index c214d10e..f3c1eb68 100644 --- a/src/Merge.Client/Crm/Types/OpportunityStatusEnum.cs +++ b/src/Merge.Client/Crm/Types/OpportunityStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OpportunityStatusEnum { [EnumMember(Value = "OPEN")] diff --git a/src/Merge.Client/Crm/Types/OriginTypeEnum.cs b/src/Merge.Client/Crm/Types/OriginTypeEnum.cs index c445a318..502bb4ac 100644 --- a/src/Merge.Client/Crm/Types/OriginTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/OriginTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum OriginTypeEnum { [EnumMember(Value = "CUSTOM_OBJECT")] diff --git a/src/Merge.Client/Crm/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Crm/Types/PaginatedAccountDetailsAndActionsList.cs index 52a15294..fe83986a 100644 --- a/src/Merge.Client/Crm/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Crm/Types/PaginatedAccountList.cs b/src/Merge.Client/Crm/Types/PaginatedAccountList.cs index 69fc9654..4fa80985 100644 --- a/src/Merge.Client/Crm/Types/PaginatedAccountList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedAccountList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedAccountList diff --git a/src/Merge.Client/Crm/Types/PaginatedAssociationList.cs b/src/Merge.Client/Crm/Types/PaginatedAssociationList.cs index 2c3bd269..de9c5bdd 100644 --- a/src/Merge.Client/Crm/Types/PaginatedAssociationList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedAssociationList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedAssociationList diff --git a/src/Merge.Client/Crm/Types/PaginatedAssociationTypeList.cs b/src/Merge.Client/Crm/Types/PaginatedAssociationTypeList.cs index 76ce5e32..2022b801 100644 --- a/src/Merge.Client/Crm/Types/PaginatedAssociationTypeList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedAssociationTypeList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedAssociationTypeList diff --git a/src/Merge.Client/Crm/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Crm/Types/PaginatedAuditLogEventList.cs index a8adf83a..fef178dd 100644 --- a/src/Merge.Client/Crm/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Crm/Types/PaginatedContactList.cs b/src/Merge.Client/Crm/Types/PaginatedContactList.cs index f5959f25..9aff33c2 100644 --- a/src/Merge.Client/Crm/Types/PaginatedContactList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedContactList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedContactList diff --git a/src/Merge.Client/Crm/Types/PaginatedCustomObjectClassList.cs b/src/Merge.Client/Crm/Types/PaginatedCustomObjectClassList.cs index 14c32d8e..108fbff6 100644 --- a/src/Merge.Client/Crm/Types/PaginatedCustomObjectClassList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedCustomObjectClassList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedCustomObjectClassList diff --git a/src/Merge.Client/Crm/Types/PaginatedCustomObjectList.cs b/src/Merge.Client/Crm/Types/PaginatedCustomObjectList.cs index 800337b0..01a58230 100644 --- a/src/Merge.Client/Crm/Types/PaginatedCustomObjectList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedCustomObjectList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedCustomObjectList diff --git a/src/Merge.Client/Crm/Types/PaginatedEngagementList.cs b/src/Merge.Client/Crm/Types/PaginatedEngagementList.cs index 95af8b76..4ca791a1 100644 --- a/src/Merge.Client/Crm/Types/PaginatedEngagementList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedEngagementList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedEngagementList diff --git a/src/Merge.Client/Crm/Types/PaginatedEngagementTypeList.cs b/src/Merge.Client/Crm/Types/PaginatedEngagementTypeList.cs index 90266bf4..857b6a12 100644 --- a/src/Merge.Client/Crm/Types/PaginatedEngagementTypeList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedEngagementTypeList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedEngagementTypeList diff --git a/src/Merge.Client/Crm/Types/PaginatedIssueList.cs b/src/Merge.Client/Crm/Types/PaginatedIssueList.cs index 2dc134a9..aac0ab64 100644 --- a/src/Merge.Client/Crm/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedIssueList diff --git a/src/Merge.Client/Crm/Types/PaginatedLeadList.cs b/src/Merge.Client/Crm/Types/PaginatedLeadList.cs index c9401d66..ac808af6 100644 --- a/src/Merge.Client/Crm/Types/PaginatedLeadList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedLeadList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedLeadList diff --git a/src/Merge.Client/Crm/Types/PaginatedNoteList.cs b/src/Merge.Client/Crm/Types/PaginatedNoteList.cs index e0f94f02..9564ea52 100644 --- a/src/Merge.Client/Crm/Types/PaginatedNoteList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedNoteList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedNoteList diff --git a/src/Merge.Client/Crm/Types/PaginatedOpportunityList.cs b/src/Merge.Client/Crm/Types/PaginatedOpportunityList.cs index 9e5143da..e6a2d25c 100644 --- a/src/Merge.Client/Crm/Types/PaginatedOpportunityList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedOpportunityList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedOpportunityList diff --git a/src/Merge.Client/Crm/Types/PaginatedRemoteFieldClassList.cs b/src/Merge.Client/Crm/Types/PaginatedRemoteFieldClassList.cs index 243b5251..3a60cb6b 100644 --- a/src/Merge.Client/Crm/Types/PaginatedRemoteFieldClassList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedRemoteFieldClassList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedRemoteFieldClassList diff --git a/src/Merge.Client/Crm/Types/PaginatedStageList.cs b/src/Merge.Client/Crm/Types/PaginatedStageList.cs index 43760112..eec0db69 100644 --- a/src/Merge.Client/Crm/Types/PaginatedStageList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedStageList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedStageList diff --git a/src/Merge.Client/Crm/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Crm/Types/PaginatedSyncStatusList.cs index 8e10fba9..b7935b7e 100644 --- a/src/Merge.Client/Crm/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Crm/Types/PaginatedTaskList.cs b/src/Merge.Client/Crm/Types/PaginatedTaskList.cs index 6cb8ab69..b52a462d 100644 --- a/src/Merge.Client/Crm/Types/PaginatedTaskList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedTaskList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedTaskList diff --git a/src/Merge.Client/Crm/Types/PaginatedUserList.cs b/src/Merge.Client/Crm/Types/PaginatedUserList.cs index 018ef7d6..0fea26c0 100644 --- a/src/Merge.Client/Crm/Types/PaginatedUserList.cs +++ b/src/Merge.Client/Crm/Types/PaginatedUserList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PaginatedUserList diff --git a/src/Merge.Client/Crm/Types/PatchedAccountRequest.cs b/src/Merge.Client/Crm/Types/PatchedAccountRequest.cs index 9b96d4ca..e2fed4bc 100644 --- a/src/Merge.Client/Crm/Types/PatchedAccountRequest.cs +++ b/src/Merge.Client/Crm/Types/PatchedAccountRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedAccountRequest diff --git a/src/Merge.Client/Crm/Types/PatchedContactRequest.cs b/src/Merge.Client/Crm/Types/PatchedContactRequest.cs index c424ec9e..49e25c63 100644 --- a/src/Merge.Client/Crm/Types/PatchedContactRequest.cs +++ b/src/Merge.Client/Crm/Types/PatchedContactRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record PatchedContactRequest diff --git a/src/Merge.Client/Crm/Types/PatchedEngagementRequest.cs b/src/Merge.Client/Crm/Types/PatchedEngagementRequest.cs index f70905af..1284ab79 100644 --- a/src/Merge.Client/Crm/Types/PatchedEngagementRequest.cs +++ b/src/Merge.Client/Crm/Types/PatchedEngagementRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedEngagementRequest diff --git a/src/Merge.Client/Crm/Types/PatchedOpportunityRequest.cs b/src/Merge.Client/Crm/Types/PatchedOpportunityRequest.cs index 5b48c6e2..5eb4e43c 100644 --- a/src/Merge.Client/Crm/Types/PatchedOpportunityRequest.cs +++ b/src/Merge.Client/Crm/Types/PatchedOpportunityRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedOpportunityRequest diff --git a/src/Merge.Client/Crm/Types/PatchedTaskRequest.cs b/src/Merge.Client/Crm/Types/PatchedTaskRequest.cs index 8b88f46f..969d192f 100644 --- a/src/Merge.Client/Crm/Types/PatchedTaskRequest.cs +++ b/src/Merge.Client/Crm/Types/PatchedTaskRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PatchedTaskRequest diff --git a/src/Merge.Client/Crm/Types/PhoneNumber.cs b/src/Merge.Client/Crm/Types/PhoneNumber.cs index 76385a27..6f198819 100644 --- a/src/Merge.Client/Crm/Types/PhoneNumber.cs +++ b/src/Merge.Client/Crm/Types/PhoneNumber.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PhoneNumber diff --git a/src/Merge.Client/Crm/Types/PhoneNumberRequest.cs b/src/Merge.Client/Crm/Types/PhoneNumberRequest.cs index ae61d1a4..8274f00c 100644 --- a/src/Merge.Client/Crm/Types/PhoneNumberRequest.cs +++ b/src/Merge.Client/Crm/Types/PhoneNumberRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record PhoneNumberRequest diff --git a/src/Merge.Client/Crm/Types/ReasonEnum.cs b/src/Merge.Client/Crm/Types/ReasonEnum.cs index 500c59ed..2388f241 100644 --- a/src/Merge.Client/Crm/Types/ReasonEnum.cs +++ b/src/Merge.Client/Crm/Types/ReasonEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ReasonEnum { [EnumMember(Value = "GENERAL_CUSTOMER_REQUEST")] diff --git a/src/Merge.Client/Crm/Types/RemoteData.cs b/src/Merge.Client/Crm/Types/RemoteData.cs index 82893b52..cd5f234d 100644 --- a/src/Merge.Client/Crm/Types/RemoteData.cs +++ b/src/Merge.Client/Crm/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteData diff --git a/src/Merge.Client/Crm/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Crm/Types/RemoteEndpointInfo.cs index 452fbf72..67c8db18 100644 --- a/src/Merge.Client/Crm/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Crm/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Crm/Types/RemoteField.cs b/src/Merge.Client/Crm/Types/RemoteField.cs index 77e3fc2c..70395c91 100644 --- a/src/Merge.Client/Crm/Types/RemoteField.cs +++ b/src/Merge.Client/Crm/Types/RemoteField.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record RemoteField diff --git a/src/Merge.Client/Crm/Types/RemoteFieldApi.cs b/src/Merge.Client/Crm/Types/RemoteFieldApi.cs index 405c0548..4903be63 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldApi diff --git a/src/Merge.Client/Crm/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Crm/Types/RemoteFieldApiResponse.cs index 27822ed3..f197fde4 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Crm/Types/RemoteFieldClass.cs b/src/Merge.Client/Crm/Types/RemoteFieldClass.cs index c6565a8a..1ce207e6 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldClass.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldClass.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldClass diff --git a/src/Merge.Client/Crm/Types/RemoteFieldClassFieldChoicesItem.cs b/src/Merge.Client/Crm/Types/RemoteFieldClassFieldChoicesItem.cs index b78bf347..97300603 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldClassFieldChoicesItem.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldClassFieldChoicesItem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldClassFieldChoicesItem diff --git a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClass.cs b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClass.cs index fca234f5..32df7787 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClass.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClass.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldClassForCustomObjectClass diff --git a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.cs b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.cs index 110aa27d..7ee7eb71 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldClassForCustomObjectClassFieldChoicesItem diff --git a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassItemSchema.cs b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassItemSchema.cs index 24a9953f..83983e58 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassItemSchema.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldClassForCustomObjectClassItemSchema.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldClassForCustomObjectClassItemSchema diff --git a/src/Merge.Client/Crm/Types/RemoteFieldRequest.cs b/src/Merge.Client/Crm/Types/RemoteFieldRequest.cs index b9765648..b5b2e811 100644 --- a/src/Merge.Client/Crm/Types/RemoteFieldRequest.cs +++ b/src/Merge.Client/Crm/Types/RemoteFieldRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record RemoteFieldRequest diff --git a/src/Merge.Client/Crm/Types/RemoteKey.cs b/src/Merge.Client/Crm/Types/RemoteKey.cs index ad62452a..a3a28688 100644 --- a/src/Merge.Client/Crm/Types/RemoteKey.cs +++ b/src/Merge.Client/Crm/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteKey diff --git a/src/Merge.Client/Crm/Types/RemoteResponse.cs b/src/Merge.Client/Crm/Types/RemoteResponse.cs index b0c2412f..5c79b461 100644 --- a/src/Merge.Client/Crm/Types/RemoteResponse.cs +++ b/src/Merge.Client/Crm/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record RemoteResponse diff --git a/src/Merge.Client/Crm/Types/RequestFormatEnum.cs b/src/Merge.Client/Crm/Types/RequestFormatEnum.cs index b3bf0af0..fe0893b0 100644 --- a/src/Merge.Client/Crm/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Crm/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Crm/Types/ResponseTypeEnum.cs b/src/Merge.Client/Crm/Types/ResponseTypeEnum.cs index e6d96c8a..ca0a956c 100644 --- a/src/Merge.Client/Crm/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Crm/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Crm/Types/RoleEnum.cs b/src/Merge.Client/Crm/Types/RoleEnum.cs index 86f7d924..e61bdd9d 100644 --- a/src/Merge.Client/Crm/Types/RoleEnum.cs +++ b/src/Merge.Client/Crm/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Crm/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Crm/Types/SelectiveSyncConfigurationsUsageEnum.cs index c4bb5da2..4d941b81 100644 --- a/src/Merge.Client/Crm/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Crm/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Crm/Types/Stage.cs b/src/Merge.Client/Crm/Types/Stage.cs index c769348d..36c4f65e 100644 --- a/src/Merge.Client/Crm/Types/Stage.cs +++ b/src/Merge.Client/Crm/Types/Stage.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record Stage diff --git a/src/Merge.Client/Crm/Types/SyncStatus.cs b/src/Merge.Client/Crm/Types/SyncStatus.cs index 4e479253..0603cd49 100644 --- a/src/Merge.Client/Crm/Types/SyncStatus.cs +++ b/src/Merge.Client/Crm/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record SyncStatus diff --git a/src/Merge.Client/Crm/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Crm/Types/SyncStatusStatusEnum.cs index 1e777c76..69be38b4 100644 --- a/src/Merge.Client/Crm/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Crm/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Crm/Types/Task.cs b/src/Merge.Client/Crm/Types/Task.cs index b3abc7f4..250a5e0d 100644 --- a/src/Merge.Client/Crm/Types/Task.cs +++ b/src/Merge.Client/Crm/Types/Task.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record Task diff --git a/src/Merge.Client/Crm/Types/TaskRequest.cs b/src/Merge.Client/Crm/Types/TaskRequest.cs index 94aeeb3c..bc7387e3 100644 --- a/src/Merge.Client/Crm/Types/TaskRequest.cs +++ b/src/Merge.Client/Crm/Types/TaskRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Crm; public record TaskRequest diff --git a/src/Merge.Client/Crm/Types/TaskResponse.cs b/src/Merge.Client/Crm/Types/TaskResponse.cs index ad13487c..e0f5a976 100644 --- a/src/Merge.Client/Crm/Types/TaskResponse.cs +++ b/src/Merge.Client/Crm/Types/TaskResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record TaskResponse diff --git a/src/Merge.Client/Crm/Types/TaskStatusEnum.cs b/src/Merge.Client/Crm/Types/TaskStatusEnum.cs index 147f73fa..c8c41c08 100644 --- a/src/Merge.Client/Crm/Types/TaskStatusEnum.cs +++ b/src/Merge.Client/Crm/Types/TaskStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TaskStatusEnum { [EnumMember(Value = "OPEN")] diff --git a/src/Merge.Client/Crm/Types/User.cs b/src/Merge.Client/Crm/Types/User.cs index e440757f..a6c36e2f 100644 --- a/src/Merge.Client/Crm/Types/User.cs +++ b/src/Merge.Client/Crm/Types/User.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record User diff --git a/src/Merge.Client/Crm/Types/ValidationProblemSource.cs b/src/Merge.Client/Crm/Types/ValidationProblemSource.cs index 6a5833ca..644e3805 100644 --- a/src/Merge.Client/Crm/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Crm/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record ValidationProblemSource diff --git a/src/Merge.Client/Crm/Types/WarningValidationProblem.cs b/src/Merge.Client/Crm/Types/WarningValidationProblem.cs index e233bd3c..b4a4d4f0 100644 --- a/src/Merge.Client/Crm/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Crm/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record WarningValidationProblem diff --git a/src/Merge.Client/Crm/Types/WebhookReceiver.cs b/src/Merge.Client/Crm/Types/WebhookReceiver.cs index 4054df53..ff55ce41 100644 --- a/src/Merge.Client/Crm/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Crm/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record WebhookReceiver diff --git a/src/Merge.Client/Crm/Users/Requests/UsersListRequest.cs b/src/Merge.Client/Crm/Users/Requests/UsersListRequest.cs index 9951c51b..444b64da 100644 --- a/src/Merge.Client/Crm/Users/Requests/UsersListRequest.cs +++ b/src/Merge.Client/Crm/Users/Requests/UsersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record UsersListRequest diff --git a/src/Merge.Client/Crm/Users/Requests/UsersRemoteFieldClassesListRequest.cs b/src/Merge.Client/Crm/Users/Requests/UsersRemoteFieldClassesListRequest.cs index aa3efff7..94563e05 100644 --- a/src/Merge.Client/Crm/Users/Requests/UsersRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Crm/Users/Requests/UsersRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record UsersRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Crm/Users/Requests/UsersRetrieveRequest.cs b/src/Merge.Client/Crm/Users/Requests/UsersRetrieveRequest.cs index 19a5cf31..94e52d26 100644 --- a/src/Merge.Client/Crm/Users/Requests/UsersRetrieveRequest.cs +++ b/src/Merge.Client/Crm/Users/Requests/UsersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record UsersRetrieveRequest diff --git a/src/Merge.Client/Crm/Users/UsersClient.cs b/src/Merge.Client/Crm/Users/UsersClient.cs index 9c535a42..e04a304a 100644 --- a/src/Merge.Client/Crm/Users/UsersClient.cs +++ b/src/Merge.Client/Crm/Users/UsersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class UsersClient @@ -24,7 +22,7 @@ internal UsersClient(RawClient client) /// await client.Crm.Users.ListAsync(new UsersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( UsersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,19 +49,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +79,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/users", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/users", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +126,7 @@ public async Task ListAsync( /// await client.Crm.Users.RetrieveAsync("id", new UsersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, UsersRetrieveRequest request, RequestOptions? options = null, @@ -134,23 +136,27 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"crm/v1/users/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"crm/v1/users/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -189,17 +195,20 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"crm/v1/users/ignore/{modelId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"crm/v1/users/ignore/{modelId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; @@ -220,7 +229,7 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( /// await client.Crm.Users.RemoteFieldClassesListAsync(new UsersRemoteFieldClassesListRequest()); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( UsersRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -233,39 +242,43 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/users/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/users/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Crm/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Crm/WebhookReceivers/Requests/WebhookReceiverRequest.cs index a4d3c3dc..8ffe0332 100644 --- a/src/Merge.Client/Crm/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Crm/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs index 77fec0d4..be6c08ed 100644 --- a/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Crm/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Crm; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Crm.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "crm/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "crm/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "crm/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "crm/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs index b8592b31..efaae469 100644 --- a/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Filestorage/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Filestorage.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs index e746632c..c1bfa93b 100644 --- a/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Filestorage/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Filestorage.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs index f124df27..932a5e70 100644 --- a/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Filestorage/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Filestorage.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs index 5a22ab05..64739ab0 100644 --- a/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Filestorage/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Filestorage.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Filestorage/AuditTrail/Requests/AuditTrailListRequest.cs index ef648687..aa883943 100644 --- a/src/Merge.Client/Filestorage/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Filestorage/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AuditTrailListRequest diff --git a/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs index 0aacc14d..8d03e112 100644 --- a/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Filestorage/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Filestorage.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs index d0b782d1..f77dd269 100644 --- a/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Filestorage/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Filestorage/Drives/DrivesClient.cs b/src/Merge.Client/Filestorage/Drives/DrivesClient.cs index 8c2248f0..71754c99 100644 --- a/src/Merge.Client/Filestorage/Drives/DrivesClient.cs +++ b/src/Merge.Client/Filestorage/Drives/DrivesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class DrivesClient @@ -24,7 +22,7 @@ internal DrivesClient(RawClient client) /// await client.Filestorage.Drives.ListAsync(new DrivesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( DrivesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/drives", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/drives", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +120,7 @@ public async Task ListAsync( /// await client.Filestorage.Drives.RetrieveAsync("id", new DrivesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, DrivesRetrieveRequest request, RequestOptions? options = null, @@ -130,19 +130,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/drives/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/drives/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Drives/Requests/DrivesListRequest.cs b/src/Merge.Client/Filestorage/Drives/Requests/DrivesListRequest.cs index c19c3e5a..1369f014 100644 --- a/src/Merge.Client/Filestorage/Drives/Requests/DrivesListRequest.cs +++ b/src/Merge.Client/Filestorage/Drives/Requests/DrivesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record DrivesListRequest diff --git a/src/Merge.Client/Filestorage/Drives/Requests/DrivesRetrieveRequest.cs b/src/Merge.Client/Filestorage/Drives/Requests/DrivesRetrieveRequest.cs index 95bea963..1dd8fffa 100644 --- a/src/Merge.Client/Filestorage/Drives/Requests/DrivesRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Drives/Requests/DrivesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record DrivesRetrieveRequest diff --git a/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs index 7127fce9..0c4d4049 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class FieldMappingClient @@ -26,7 +24,7 @@ internal FieldMappingClient(RawClient client) /// ); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -35,19 +33,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -78,7 +80,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -86,7 +88,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -95,7 +97,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -106,18 +110,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -146,22 +153,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Filestorage.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"filestorage/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"filestorage/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -193,24 +202,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"filestorage/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"filestorage/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -239,7 +251,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Filestorage.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -254,17 +266,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -293,21 +307,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Filestorage.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Filestorage/FieldMapping/Requests/CreateFieldMappingRequest.cs index 53096d81..86500e51 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Filestorage/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Filestorage/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index b8d7935e..c948521d 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Filestorage/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Filestorage/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index 71cf98fc..9f7ad323 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Filestorage/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Filestorage/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index 6649e27e..c8c299f5 100644 --- a/src/Merge.Client/Filestorage/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Filestorage/Files/FilesClient.cs b/src/Merge.Client/Filestorage/Files/FilesClient.cs index fd82830c..9f355537 100644 --- a/src/Merge.Client/Filestorage/Files/FilesClient.cs +++ b/src/Merge.Client/Filestorage/Files/FilesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class FilesClient @@ -24,7 +22,7 @@ internal FilesClient(RawClient client) /// await client.Filestorage.Files.ListAsync(new FilesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( FilesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -59,15 +57,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.MimeType != null) { @@ -91,23 +89,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/files", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/files", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -138,7 +138,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( FileStorageFileEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -147,25 +147,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/files", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/files", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -194,7 +197,7 @@ public async Task CreateAsync( /// await client.Filestorage.Files.RetrieveAsync("id", new FilesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, FilesRetrieveRequest request, RequestOptions? options = null, @@ -208,19 +211,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/files/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/files/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -264,17 +269,19 @@ public async System.Threading.Tasks.Task DownloadRetrieveAsync( { _query["mime_type"] = request.MimeType; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/files/{id}/download", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/files/{id}/download", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); throw new MergeApiException( $"Error with status code {response.StatusCode}", @@ -291,21 +298,23 @@ public async System.Threading.Tasks.Task DownloadRetrieveAsync( /// await client.Filestorage.Files.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/files/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/files/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Files/Requests/FileStorageFileEndpointRequest.cs b/src/Merge.Client/Filestorage/Files/Requests/FileStorageFileEndpointRequest.cs index 8f4f0470..bda08917 100644 --- a/src/Merge.Client/Filestorage/Files/Requests/FileStorageFileEndpointRequest.cs +++ b/src/Merge.Client/Filestorage/Files/Requests/FileStorageFileEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FileStorageFileEndpointRequest diff --git a/src/Merge.Client/Filestorage/Files/Requests/FilesDownloadRetrieveRequest.cs b/src/Merge.Client/Filestorage/Files/Requests/FilesDownloadRetrieveRequest.cs index eae8572d..b46b830e 100644 --- a/src/Merge.Client/Filestorage/Files/Requests/FilesDownloadRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Files/Requests/FilesDownloadRetrieveRequest.cs @@ -1,13 +1,11 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FilesDownloadRetrieveRequest { /// - /// If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our export format help center article. + /// If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. /// public string? MimeType { get; set; } diff --git a/src/Merge.Client/Filestorage/Files/Requests/FilesListRequest.cs b/src/Merge.Client/Filestorage/Files/Requests/FilesListRequest.cs index 088730b2..d160e655 100644 --- a/src/Merge.Client/Filestorage/Files/Requests/FilesListRequest.cs +++ b/src/Merge.Client/Filestorage/Files/Requests/FilesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FilesListRequest diff --git a/src/Merge.Client/Filestorage/Files/Requests/FilesRetrieveRequest.cs b/src/Merge.Client/Filestorage/Files/Requests/FilesRetrieveRequest.cs index 37b2032a..6df45a3f 100644 --- a/src/Merge.Client/Filestorage/Files/Requests/FilesRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Files/Requests/FilesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FilesRetrieveRequest diff --git a/src/Merge.Client/Filestorage/Files/Types/FilesListRequestExpand.cs b/src/Merge.Client/Filestorage/Files/Types/FilesListRequestExpand.cs index fbceccde..89a6215a 100644 --- a/src/Merge.Client/Filestorage/Files/Types/FilesListRequestExpand.cs +++ b/src/Merge.Client/Filestorage/Files/Types/FilesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FilesListRequestExpand { [EnumMember(Value = "drive")] diff --git a/src/Merge.Client/Filestorage/Files/Types/FilesRetrieveRequestExpand.cs b/src/Merge.Client/Filestorage/Files/Types/FilesRetrieveRequestExpand.cs index 8f67354e..d878ba15 100644 --- a/src/Merge.Client/Filestorage/Files/Types/FilesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Filestorage/Files/Types/FilesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FilesRetrieveRequestExpand { [EnumMember(Value = "drive")] diff --git a/src/Merge.Client/Filestorage/FilestorageClient.cs b/src/Merge.Client/Filestorage/FilestorageClient.cs index 377436dd..502d7649 100644 --- a/src/Merge.Client/Filestorage/FilestorageClient.cs +++ b/src/Merge.Client/Filestorage/FilestorageClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class FilestorageClient diff --git a/src/Merge.Client/Filestorage/Folders/FoldersClient.cs b/src/Merge.Client/Filestorage/Folders/FoldersClient.cs index 8fc6be6f..472d32f7 100644 --- a/src/Merge.Client/Filestorage/Folders/FoldersClient.cs +++ b/src/Merge.Client/Filestorage/Folders/FoldersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class FoldersClient @@ -24,7 +22,7 @@ internal FoldersClient(RawClient client) /// await client.Filestorage.Folders.ListAsync(new FoldersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( FoldersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +81,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.ParentFolderId != null) { @@ -93,17 +91,19 @@ public async Task ListAsync( { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/folders", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/folders", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,7 +134,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( FileStorageFolderEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -143,25 +143,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/folders", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/folders", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -190,7 +193,7 @@ public async Task CreateAsync( /// await client.Filestorage.Folders.RetrieveAsync("id", new FoldersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, FoldersRetrieveRequest request, RequestOptions? options = null, @@ -204,19 +207,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/folders/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/folders/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -245,21 +250,23 @@ public async Task RetrieveAsync( /// await client.Filestorage.Folders.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/folders/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/folders/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Folders/Requests/FileStorageFolderEndpointRequest.cs b/src/Merge.Client/Filestorage/Folders/Requests/FileStorageFolderEndpointRequest.cs index 472e3804..81606351 100644 --- a/src/Merge.Client/Filestorage/Folders/Requests/FileStorageFolderEndpointRequest.cs +++ b/src/Merge.Client/Filestorage/Folders/Requests/FileStorageFolderEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FileStorageFolderEndpointRequest diff --git a/src/Merge.Client/Filestorage/Folders/Requests/FoldersListRequest.cs b/src/Merge.Client/Filestorage/Folders/Requests/FoldersListRequest.cs index fc57fb9e..918347fe 100644 --- a/src/Merge.Client/Filestorage/Folders/Requests/FoldersListRequest.cs +++ b/src/Merge.Client/Filestorage/Folders/Requests/FoldersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FoldersListRequest diff --git a/src/Merge.Client/Filestorage/Folders/Requests/FoldersRetrieveRequest.cs b/src/Merge.Client/Filestorage/Folders/Requests/FoldersRetrieveRequest.cs index bd699c8c..203d8e4d 100644 --- a/src/Merge.Client/Filestorage/Folders/Requests/FoldersRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Folders/Requests/FoldersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FoldersRetrieveRequest diff --git a/src/Merge.Client/Filestorage/Folders/Types/FoldersListRequestExpand.cs b/src/Merge.Client/Filestorage/Folders/Types/FoldersListRequestExpand.cs index b8307ec2..096a242c 100644 --- a/src/Merge.Client/Filestorage/Folders/Types/FoldersListRequestExpand.cs +++ b/src/Merge.Client/Filestorage/Folders/Types/FoldersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FoldersListRequestExpand { [EnumMember(Value = "drive")] diff --git a/src/Merge.Client/Filestorage/Folders/Types/FoldersRetrieveRequestExpand.cs b/src/Merge.Client/Filestorage/Folders/Types/FoldersRetrieveRequestExpand.cs index fde70425..af730a98 100644 --- a/src/Merge.Client/Filestorage/Folders/Types/FoldersRetrieveRequestExpand.cs +++ b/src/Merge.Client/Filestorage/Folders/Types/FoldersRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FoldersRetrieveRequestExpand { [EnumMember(Value = "drive")] diff --git a/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs index 4de0fa74..91aa920d 100644 --- a/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Filestorage/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Filestorage.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs index 6e8ba978..6c0e3d4d 100644 --- a/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Filestorage/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Filestorage/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index 9ce144a3..6e708845 100644 --- a/src/Merge.Client/Filestorage/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Filestorage/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Filestorage/Groups/GroupsClient.cs b/src/Merge.Client/Filestorage/Groups/GroupsClient.cs index 3631003d..834e6c0a 100644 --- a/src/Merge.Client/Filestorage/Groups/GroupsClient.cs +++ b/src/Merge.Client/Filestorage/Groups/GroupsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class GroupsClient @@ -24,7 +22,7 @@ internal GroupsClient(RawClient client) /// await client.Filestorage.Groups.ListAsync(new GroupsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( GroupsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/groups", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/groups", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +120,7 @@ public async Task ListAsync( /// await client.Filestorage.Groups.RetrieveAsync("id", new GroupsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, GroupsRetrieveRequest request, RequestOptions? options = null, @@ -134,19 +134,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/groups/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/groups/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Groups/Requests/GroupsListRequest.cs b/src/Merge.Client/Filestorage/Groups/Requests/GroupsListRequest.cs index bece48e2..555d7125 100644 --- a/src/Merge.Client/Filestorage/Groups/Requests/GroupsListRequest.cs +++ b/src/Merge.Client/Filestorage/Groups/Requests/GroupsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record GroupsListRequest diff --git a/src/Merge.Client/Filestorage/Groups/Requests/GroupsRetrieveRequest.cs b/src/Merge.Client/Filestorage/Groups/Requests/GroupsRetrieveRequest.cs index bfabe7a5..c969f362 100644 --- a/src/Merge.Client/Filestorage/Groups/Requests/GroupsRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Groups/Requests/GroupsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record GroupsRetrieveRequest diff --git a/src/Merge.Client/Filestorage/Issues/IssuesClient.cs b/src/Merge.Client/Filestorage/Issues/IssuesClient.cs index bd1a7718..c860d8c9 100644 --- a/src/Merge.Client/Filestorage/Issues/IssuesClient.cs +++ b/src/Merge.Client/Filestorage/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Filestorage.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Filestorage.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Filestorage/Issues/Requests/IssuesListRequest.cs index 717ecc46..d15cd129 100644 --- a/src/Merge.Client/Filestorage/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Filestorage/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record IssuesListRequest diff --git a/src/Merge.Client/Filestorage/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Filestorage/Issues/Types/IssuesListRequestStatus.cs index fad98f44..27b50c73 100644 --- a/src/Merge.Client/Filestorage/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Filestorage/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs index df723513..cd2e9da8 100644 --- a/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Filestorage/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Filestorage.CategoriesEnum>() /// { /// Merge.Client.Filestorage.CategoriesEnum.Hris, /// Merge.Client.Filestorage.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Filestorage/LinkToken/Requests/EndUserDetailsRequest.cs index 52dba926..b4d4f1bd 100644 --- a/src/Merge.Client/Filestorage/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Filestorage/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs index 795b9a84..5df4bc91 100644 --- a/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Filestorage/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Filestorage.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Filestorage/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index 68172b82..198c99c2 100644 --- a/src/Merge.Client/Filestorage/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Filestorage/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Filestorage/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Filestorage/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index 7beb1886..a6c4edf5 100644 --- a/src/Merge.Client/Filestorage/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Filestorage/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs b/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs index 258aed28..2218ed97 100644 --- a/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Filestorage/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs index 0b261d1b..66312342 100644 --- a/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Filestorage/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Filestorage/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index 2684e1af..1c01c4c0 100644 --- a/src/Merge.Client/Filestorage/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Filestorage/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Filestorage/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Filestorage/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index 73677500..0353427d 100644 --- a/src/Merge.Client/Filestorage/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Filestorage/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs b/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs index 4ac6aaa5..83956f58 100644 --- a/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Filestorage/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Filestorage.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Filestorage.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -111,15 +113,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { /// CommonModels = - /// new List() + /// new List<Merge.Client.Filestorage.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Filestorage.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Filestorage.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -139,17 +141,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// FieldPermissions = /// new Merge.Client.Filestorage.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Filestorage.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Filestorage.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -165,23 +167,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Filestorage/SyncStatus/Requests/SyncStatusListRequest.cs index e2da11b0..4586beab 100644 --- a/src/Merge.Client/Filestorage/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Filestorage/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record SyncStatusListRequest diff --git a/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs index a64f5a54..b90956b5 100644 --- a/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Filestorage/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Filestorage.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/Types/AccountDetails.cs b/src/Merge.Client/Filestorage/Types/AccountDetails.cs index e510e1e6..b029dbc2 100644 --- a/src/Merge.Client/Filestorage/Types/AccountDetails.cs +++ b/src/Merge.Client/Filestorage/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AccountDetails diff --git a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActions.cs index 82127769..503c0f87 100644 --- a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsIntegration.cs index 37c9462d..077b4a7c 100644 --- a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsStatusEnum.cs index 591180ab..e94c825c 100644 --- a/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Filestorage/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Filestorage/Types/AccountIntegration.cs b/src/Merge.Client/Filestorage/Types/AccountIntegration.cs index aa77c9bc..3cc211ed 100644 --- a/src/Merge.Client/Filestorage/Types/AccountIntegration.cs +++ b/src/Merge.Client/Filestorage/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Filestorage/Types/AccountToken.cs b/src/Merge.Client/Filestorage/Types/AccountToken.cs index e27e840f..296b84f3 100644 --- a/src/Merge.Client/Filestorage/Types/AccountToken.cs +++ b/src/Merge.Client/Filestorage/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AccountToken diff --git a/src/Merge.Client/Filestorage/Types/AdvancedMetadata.cs b/src/Merge.Client/Filestorage/Types/AdvancedMetadata.cs index 46c4833e..7face467 100644 --- a/src/Merge.Client/Filestorage/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Filestorage/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AdvancedMetadata diff --git a/src/Merge.Client/Filestorage/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Filestorage/Types/AsyncPassthroughReciept.cs index 75c91cab..535cbbc2 100644 --- a/src/Merge.Client/Filestorage/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Filestorage/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Filestorage/Types/AuditLogEvent.cs b/src/Merge.Client/Filestorage/Types/AuditLogEvent.cs index dad0f1d8..0ef365a4 100644 --- a/src/Merge.Client/Filestorage/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Filestorage/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AuditLogEvent diff --git a/src/Merge.Client/Filestorage/Types/AvailableActions.cs b/src/Merge.Client/Filestorage/Types/AvailableActions.cs index 482a336c..bf368448 100644 --- a/src/Merge.Client/Filestorage/Types/AvailableActions.cs +++ b/src/Merge.Client/Filestorage/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record AvailableActions diff --git a/src/Merge.Client/Filestorage/Types/CategoriesEnum.cs b/src/Merge.Client/Filestorage/Types/CategoriesEnum.cs index af053d08..e9e85f88 100644 --- a/src/Merge.Client/Filestorage/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Filestorage/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Filestorage/Types/CategoryEnum.cs b/src/Merge.Client/Filestorage/Types/CategoryEnum.cs index 3131fe61..15bae683 100644 --- a/src/Merge.Client/Filestorage/Types/CategoryEnum.cs +++ b/src/Merge.Client/Filestorage/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Filestorage/Types/CommonModelScopeApi.cs b/src/Merge.Client/Filestorage/Types/CommonModelScopeApi.cs index b3b30b60..02b96381 100644 --- a/src/Merge.Client/Filestorage/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Filestorage/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record CommonModelScopeApi diff --git a/src/Merge.Client/Filestorage/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Filestorage/Types/CommonModelScopesBodyRequest.cs index e2c8016a..361d5c21 100644 --- a/src/Merge.Client/Filestorage/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Filestorage/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Filestorage/Types/DataPassthroughRequest.cs b/src/Merge.Client/Filestorage/Types/DataPassthroughRequest.cs index 04f4bd62..183371ec 100644 --- a/src/Merge.Client/Filestorage/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Filestorage/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record DataPassthroughRequest diff --git a/src/Merge.Client/Filestorage/Types/DebugModeLog.cs b/src/Merge.Client/Filestorage/Types/DebugModeLog.cs index b09700fc..7ef65dcf 100644 --- a/src/Merge.Client/Filestorage/Types/DebugModeLog.cs +++ b/src/Merge.Client/Filestorage/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record DebugModeLog diff --git a/src/Merge.Client/Filestorage/Types/DebugModelLogSummary.cs b/src/Merge.Client/Filestorage/Types/DebugModelLogSummary.cs index 58d8a07f..a83d4427 100644 --- a/src/Merge.Client/Filestorage/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Filestorage/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record DebugModelLogSummary diff --git a/src/Merge.Client/Filestorage/Types/Drive.cs b/src/Merge.Client/Filestorage/Types/Drive.cs index 3755b0b6..b8a1bcd7 100644 --- a/src/Merge.Client/Filestorage/Types/Drive.cs +++ b/src/Merge.Client/Filestorage/Types/Drive.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record Drive diff --git a/src/Merge.Client/Filestorage/Types/EnabledActionsEnum.cs b/src/Merge.Client/Filestorage/Types/EnabledActionsEnum.cs index c948423a..3ba4d36f 100644 --- a/src/Merge.Client/Filestorage/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Filestorage/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Filestorage/Types/EncodingEnum.cs b/src/Merge.Client/Filestorage/Types/EncodingEnum.cs index d3341b86..da9a1e15 100644 --- a/src/Merge.Client/Filestorage/Types/EncodingEnum.cs +++ b/src/Merge.Client/Filestorage/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Filestorage/Types/ErrorValidationProblem.cs b/src/Merge.Client/Filestorage/Types/ErrorValidationProblem.cs index 7a8d5780..5ef4e508 100644 --- a/src/Merge.Client/Filestorage/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Filestorage/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ErrorValidationProblem diff --git a/src/Merge.Client/Filestorage/Types/EventTypeEnum.cs b/src/Merge.Client/Filestorage/Types/EventTypeEnum.cs index ab40b06e..970b890f 100644 --- a/src/Merge.Client/Filestorage/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Filestorage/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApi.cs index 07a184bf..9a3fbb5e 100644 --- a/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApiResponse.cs index 0244332c..e3b062bc 100644 --- a/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Filestorage/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstance.cs index f9fa950f..d50e653e 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteField.cs index 3c911c25..f8acf018 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index f6f26cb4..bc8f69ce 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceResponse.cs index 2d112d68..35fce430 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceTargetField.cs index 744f8567..13d8f928 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Filestorage/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Filestorage/Types/FieldMappingInstanceResponse.cs index dcd70104..fc8b91fb 100644 --- a/src/Merge.Client/Filestorage/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Filestorage/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializer.cs index 4b010d0d..e8ec7ad4 100644 --- a/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializerRequest.cs index 05c4b2bc..172cca5e 100644 --- a/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Filestorage/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Filestorage/Types/File.cs b/src/Merge.Client/Filestorage/Types/File.cs index fbc7befc..210c981f 100644 --- a/src/Merge.Client/Filestorage/Types/File.cs +++ b/src/Merge.Client/Filestorage/Types/File.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record File diff --git a/src/Merge.Client/Filestorage/Types/FileRequest.cs b/src/Merge.Client/Filestorage/Types/FileRequest.cs index 1997fd7d..fca391f0 100644 --- a/src/Merge.Client/Filestorage/Types/FileRequest.cs +++ b/src/Merge.Client/Filestorage/Types/FileRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record FileRequest diff --git a/src/Merge.Client/Filestorage/Types/FileStorageFileResponse.cs b/src/Merge.Client/Filestorage/Types/FileStorageFileResponse.cs index f50f9b9a..c13fb172 100644 --- a/src/Merge.Client/Filestorage/Types/FileStorageFileResponse.cs +++ b/src/Merge.Client/Filestorage/Types/FileStorageFileResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FileStorageFileResponse diff --git a/src/Merge.Client/Filestorage/Types/FileStorageFolderResponse.cs b/src/Merge.Client/Filestorage/Types/FileStorageFolderResponse.cs index 94f2ec2e..fcfa1bf7 100644 --- a/src/Merge.Client/Filestorage/Types/FileStorageFolderResponse.cs +++ b/src/Merge.Client/Filestorage/Types/FileStorageFolderResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record FileStorageFolderResponse diff --git a/src/Merge.Client/Filestorage/Types/Folder.cs b/src/Merge.Client/Filestorage/Types/Folder.cs index 3ffa0fb9..076e6458 100644 --- a/src/Merge.Client/Filestorage/Types/Folder.cs +++ b/src/Merge.Client/Filestorage/Types/Folder.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record Folder diff --git a/src/Merge.Client/Filestorage/Types/FolderRequest.cs b/src/Merge.Client/Filestorage/Types/FolderRequest.cs index af0799d5..17eded4c 100644 --- a/src/Merge.Client/Filestorage/Types/FolderRequest.cs +++ b/src/Merge.Client/Filestorage/Types/FolderRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record FolderRequest diff --git a/src/Merge.Client/Filestorage/Types/Group.cs b/src/Merge.Client/Filestorage/Types/Group.cs index c12b57fc..7ceb6881 100644 --- a/src/Merge.Client/Filestorage/Types/Group.cs +++ b/src/Merge.Client/Filestorage/Types/Group.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record Group diff --git a/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializer.cs index 1293261f..6b6588bc 100644 --- a/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializerRequest.cs index c5eab23e..490ef05c 100644 --- a/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Filestorage/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Filestorage/Types/Issue.cs b/src/Merge.Client/Filestorage/Types/Issue.cs index f6159cfc..31b08ec5 100644 --- a/src/Merge.Client/Filestorage/Types/Issue.cs +++ b/src/Merge.Client/Filestorage/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record Issue diff --git a/src/Merge.Client/Filestorage/Types/IssueStatusEnum.cs b/src/Merge.Client/Filestorage/Types/IssueStatusEnum.cs index b27acef1..80db88fe 100644 --- a/src/Merge.Client/Filestorage/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Filestorage/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Filestorage/Types/LanguageEnum.cs b/src/Merge.Client/Filestorage/Types/LanguageEnum.cs index bf8b2978..27ad839e 100644 --- a/src/Merge.Client/Filestorage/Types/LanguageEnum.cs +++ b/src/Merge.Client/Filestorage/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Filestorage/Types/LinkToken.cs b/src/Merge.Client/Filestorage/Types/LinkToken.cs index 47bc65c0..b7fe0182 100644 --- a/src/Merge.Client/Filestorage/Types/LinkToken.cs +++ b/src/Merge.Client/Filestorage/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record LinkToken diff --git a/src/Merge.Client/Filestorage/Types/LinkedAccountStatus.cs b/src/Merge.Client/Filestorage/Types/LinkedAccountStatus.cs index bce38222..398b3ff9 100644 --- a/src/Merge.Client/Filestorage/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Filestorage/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record LinkedAccountStatus diff --git a/src/Merge.Client/Filestorage/Types/MetaResponse.cs b/src/Merge.Client/Filestorage/Types/MetaResponse.cs index 2d85873f..830a0d9d 100644 --- a/src/Merge.Client/Filestorage/Types/MetaResponse.cs +++ b/src/Merge.Client/Filestorage/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record MetaResponse diff --git a/src/Merge.Client/Filestorage/Types/MethodEnum.cs b/src/Merge.Client/Filestorage/Types/MethodEnum.cs index a8ac1aa8..d06aa2ce 100644 --- a/src/Merge.Client/Filestorage/Types/MethodEnum.cs +++ b/src/Merge.Client/Filestorage/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Filestorage/Types/ModelOperation.cs b/src/Merge.Client/Filestorage/Types/ModelOperation.cs index f60b50b0..881271ea 100644 --- a/src/Merge.Client/Filestorage/Types/ModelOperation.cs +++ b/src/Merge.Client/Filestorage/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ModelOperation diff --git a/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializer.cs index 0727d3f0..174c7ca2 100644 --- a/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializerRequest.cs index 1c94b601..ff7cbe9f 100644 --- a/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Filestorage/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Filestorage/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Filestorage/Types/MultipartFormFieldRequest.cs index e2824326..0fad5753 100644 --- a/src/Merge.Client/Filestorage/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Filestorage/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Filestorage/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Filestorage/Types/PaginatedAccountDetailsAndActionsList.cs index 1dea8a16..ee4774a0 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Filestorage/Types/PaginatedAuditLogEventList.cs index c67cf4d5..3eb0e4f6 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedDriveList.cs b/src/Merge.Client/Filestorage/Types/PaginatedDriveList.cs index 9385a6d4..c1860dd3 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedDriveList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedDriveList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedDriveList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedFileList.cs b/src/Merge.Client/Filestorage/Types/PaginatedFileList.cs index 88edd511..ad5d3e1f 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedFileList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedFileList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedFileList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedFolderList.cs b/src/Merge.Client/Filestorage/Types/PaginatedFolderList.cs index 8710e98a..28fdfa88 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedFolderList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedFolderList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedFolderList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedGroupList.cs b/src/Merge.Client/Filestorage/Types/PaginatedGroupList.cs index 448d62b3..dc15322d 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedGroupList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedGroupList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedGroupList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedIssueList.cs b/src/Merge.Client/Filestorage/Types/PaginatedIssueList.cs index 9a03e5bb..7e109173 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedIssueList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Filestorage/Types/PaginatedSyncStatusList.cs index eb541b3b..97d25323 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Filestorage/Types/PaginatedUserList.cs b/src/Merge.Client/Filestorage/Types/PaginatedUserList.cs index bf2c51fa..d0c12603 100644 --- a/src/Merge.Client/Filestorage/Types/PaginatedUserList.cs +++ b/src/Merge.Client/Filestorage/Types/PaginatedUserList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record PaginatedUserList diff --git a/src/Merge.Client/Filestorage/Types/Permission.cs b/src/Merge.Client/Filestorage/Types/Permission.cs index b384c67e..027f78ab 100644 --- a/src/Merge.Client/Filestorage/Types/Permission.cs +++ b/src/Merge.Client/Filestorage/Types/Permission.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record Permission diff --git a/src/Merge.Client/Filestorage/Types/PermissionRequest.cs b/src/Merge.Client/Filestorage/Types/PermissionRequest.cs index 958bc3c5..ec1b7e0e 100644 --- a/src/Merge.Client/Filestorage/Types/PermissionRequest.cs +++ b/src/Merge.Client/Filestorage/Types/PermissionRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record PermissionRequest diff --git a/src/Merge.Client/Filestorage/Types/RemoteData.cs b/src/Merge.Client/Filestorage/Types/RemoteData.cs index a78c1e32..216fad95 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteData.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteData diff --git a/src/Merge.Client/Filestorage/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Filestorage/Types/RemoteEndpointInfo.cs index a4014491..4f8fb0c8 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Filestorage/Types/RemoteFieldApi.cs b/src/Merge.Client/Filestorage/Types/RemoteFieldApi.cs index 55ebd126..9c8d6a02 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteFieldApi diff --git a/src/Merge.Client/Filestorage/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Filestorage/Types/RemoteFieldApiResponse.cs index e84bdeb2..47658135 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Filestorage/Types/RemoteKey.cs b/src/Merge.Client/Filestorage/Types/RemoteKey.cs index 67259636..938b0867 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteKey.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteKey diff --git a/src/Merge.Client/Filestorage/Types/RemoteResponse.cs b/src/Merge.Client/Filestorage/Types/RemoteResponse.cs index 8caecfe7..eb411542 100644 --- a/src/Merge.Client/Filestorage/Types/RemoteResponse.cs +++ b/src/Merge.Client/Filestorage/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record RemoteResponse diff --git a/src/Merge.Client/Filestorage/Types/RequestFormatEnum.cs b/src/Merge.Client/Filestorage/Types/RequestFormatEnum.cs index e7017330..50ca1e1d 100644 --- a/src/Merge.Client/Filestorage/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Filestorage/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Filestorage/Types/ResponseTypeEnum.cs b/src/Merge.Client/Filestorage/Types/ResponseTypeEnum.cs index a31ce09f..2ed6df6b 100644 --- a/src/Merge.Client/Filestorage/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Filestorage/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Filestorage/Types/RoleEnum.cs b/src/Merge.Client/Filestorage/Types/RoleEnum.cs index 7547e89c..4e658d71 100644 --- a/src/Merge.Client/Filestorage/Types/RoleEnum.cs +++ b/src/Merge.Client/Filestorage/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Filestorage/Types/RolesEnum.cs b/src/Merge.Client/Filestorage/Types/RolesEnum.cs index 7b8231bb..e660194f 100644 --- a/src/Merge.Client/Filestorage/Types/RolesEnum.cs +++ b/src/Merge.Client/Filestorage/Types/RolesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RolesEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Filestorage/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Filestorage/Types/SelectiveSyncConfigurationsUsageEnum.cs index d47c2a16..08589c96 100644 --- a/src/Merge.Client/Filestorage/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Filestorage/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Filestorage/Types/SyncStatus.cs b/src/Merge.Client/Filestorage/Types/SyncStatus.cs index 9c68e09c..4c2a6bd7 100644 --- a/src/Merge.Client/Filestorage/Types/SyncStatus.cs +++ b/src/Merge.Client/Filestorage/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record SyncStatus diff --git a/src/Merge.Client/Filestorage/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Filestorage/Types/SyncStatusStatusEnum.cs index f0ca9d58..a448e1fa 100644 --- a/src/Merge.Client/Filestorage/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Filestorage/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Filestorage/Types/TypeEnum.cs b/src/Merge.Client/Filestorage/Types/TypeEnum.cs index 4d5e5f75..de5015d1 100644 --- a/src/Merge.Client/Filestorage/Types/TypeEnum.cs +++ b/src/Merge.Client/Filestorage/Types/TypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TypeEnum { [EnumMember(Value = "USER")] diff --git a/src/Merge.Client/Filestorage/Types/User.cs b/src/Merge.Client/Filestorage/Types/User.cs index 09f069e9..2cd7ee3f 100644 --- a/src/Merge.Client/Filestorage/Types/User.cs +++ b/src/Merge.Client/Filestorage/Types/User.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record User diff --git a/src/Merge.Client/Filestorage/Types/ValidationProblemSource.cs b/src/Merge.Client/Filestorage/Types/ValidationProblemSource.cs index b87d4597..eb23b3ed 100644 --- a/src/Merge.Client/Filestorage/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Filestorage/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record ValidationProblemSource diff --git a/src/Merge.Client/Filestorage/Types/WarningValidationProblem.cs b/src/Merge.Client/Filestorage/Types/WarningValidationProblem.cs index 1323cccc..1d2656e6 100644 --- a/src/Merge.Client/Filestorage/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Filestorage/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record WarningValidationProblem diff --git a/src/Merge.Client/Filestorage/Types/WebhookReceiver.cs b/src/Merge.Client/Filestorage/Types/WebhookReceiver.cs index a121e891..8dc11586 100644 --- a/src/Merge.Client/Filestorage/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Filestorage/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record WebhookReceiver diff --git a/src/Merge.Client/Filestorage/Users/Requests/UsersListRequest.cs b/src/Merge.Client/Filestorage/Users/Requests/UsersListRequest.cs index 3512335d..39783c85 100644 --- a/src/Merge.Client/Filestorage/Users/Requests/UsersListRequest.cs +++ b/src/Merge.Client/Filestorage/Users/Requests/UsersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record UsersListRequest diff --git a/src/Merge.Client/Filestorage/Users/Requests/UsersRetrieveRequest.cs b/src/Merge.Client/Filestorage/Users/Requests/UsersRetrieveRequest.cs index b69531a5..296204e9 100644 --- a/src/Merge.Client/Filestorage/Users/Requests/UsersRetrieveRequest.cs +++ b/src/Merge.Client/Filestorage/Users/Requests/UsersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record UsersRetrieveRequest diff --git a/src/Merge.Client/Filestorage/Users/UsersClient.cs b/src/Merge.Client/Filestorage/Users/UsersClient.cs index 9b258df6..63308bfa 100644 --- a/src/Merge.Client/Filestorage/Users/UsersClient.cs +++ b/src/Merge.Client/Filestorage/Users/UsersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class UsersClient @@ -24,7 +22,7 @@ internal UsersClient(RawClient client) /// await client.Filestorage.Users.ListAsync(new UsersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( UsersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsMe != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/users", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/users", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +120,7 @@ public async Task ListAsync( /// await client.Filestorage.Users.RetrieveAsync("id", new UsersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, UsersRetrieveRequest request, RequestOptions? options = null, @@ -130,19 +130,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"filestorage/v1/users/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"filestorage/v1/users/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Filestorage/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Filestorage/WebhookReceivers/Requests/WebhookReceiverRequest.cs index ebde71b7..7eede482 100644 --- a/src/Merge.Client/Filestorage/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Filestorage/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs index 876b9ea6..e9318088 100644 --- a/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Filestorage/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Filestorage; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Filestorage.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "filestorage/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "filestorage/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "filestorage/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "filestorage/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs index c0fcdd8d..bad6d6bd 100644 --- a/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Hris/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Hris.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs index 9564e842..7437bd41 100644 --- a/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Hris/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Hris.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs index 13e9b9d5..7d0623bf 100644 --- a/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Hris/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Hris.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs index 8c8c4879..2e280331 100644 --- a/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Hris/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Hris.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Hris/AuditTrail/Requests/AuditTrailListRequest.cs index 0de584a5..169b87f7 100644 --- a/src/Merge.Client/Hris/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Hris/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AuditTrailListRequest diff --git a/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs index d6cf57a7..db2ef5dc 100644 --- a/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Hris/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Hris.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs b/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs index 5d2c50d8..95ec27ae 100644 --- a/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs +++ b/src/Merge.Client/Hris/BankInfo/BankInfoClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class BankInfoClient @@ -24,7 +22,7 @@ internal BankInfoClient(RawClient client) /// await client.Hris.BankInfo.ListAsync(new BankInfoListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( BankInfoListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,15 +61,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -91,7 +89,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -105,17 +103,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/bank-info", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/bank-info", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,7 +144,7 @@ public async Task ListAsync( /// await client.Hris.BankInfo.RetrieveAsync("id", new BankInfoRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, BankInfoRetrieveRequest request, RequestOptions? options = null, @@ -158,7 +158,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -168,17 +168,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/bank-info/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/bank-info/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/BankInfo/Requests/BankInfoListRequest.cs b/src/Merge.Client/Hris/BankInfo/Requests/BankInfoListRequest.cs index 72e9fc35..262d4d16 100644 --- a/src/Merge.Client/Hris/BankInfo/Requests/BankInfoListRequest.cs +++ b/src/Merge.Client/Hris/BankInfo/Requests/BankInfoListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record BankInfoListRequest diff --git a/src/Merge.Client/Hris/BankInfo/Requests/BankInfoRetrieveRequest.cs b/src/Merge.Client/Hris/BankInfo/Requests/BankInfoRetrieveRequest.cs index b9505cb2..3836ae02 100644 --- a/src/Merge.Client/Hris/BankInfo/Requests/BankInfoRetrieveRequest.cs +++ b/src/Merge.Client/Hris/BankInfo/Requests/BankInfoRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record BankInfoRetrieveRequest diff --git a/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestAccountType.cs b/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestAccountType.cs index e00f5ea7..9c13907c 100644 --- a/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestAccountType.cs +++ b/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestAccountType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum BankInfoListRequestAccountType { [EnumMember(Value = "CHECKING")] diff --git a/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestOrderBy.cs b/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestOrderBy.cs index a7182e74..a33d37e5 100644 --- a/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestOrderBy.cs +++ b/src/Merge.Client/Hris/BankInfo/Types/BankInfoListRequestOrderBy.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum BankInfoListRequestOrderBy { [EnumMember(Value = "-remote_created_at")] diff --git a/src/Merge.Client/Hris/Benefits/BenefitsClient.cs b/src/Merge.Client/Hris/Benefits/BenefitsClient.cs index 287f0992..c6fdfaaa 100644 --- a/src/Merge.Client/Hris/Benefits/BenefitsClient.cs +++ b/src/Merge.Client/Hris/Benefits/BenefitsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class BenefitsClient @@ -24,7 +22,7 @@ internal BenefitsClient(RawClient client) /// await client.Hris.Benefits.ListAsync(new BenefitsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( BenefitsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/benefits", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/benefits", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Hris.Benefits.RetrieveAsync("id", new BenefitsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, BenefitsRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/benefits/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/benefits/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Benefits/Requests/BenefitsListRequest.cs b/src/Merge.Client/Hris/Benefits/Requests/BenefitsListRequest.cs index 5445aa4d..b724cefc 100644 --- a/src/Merge.Client/Hris/Benefits/Requests/BenefitsListRequest.cs +++ b/src/Merge.Client/Hris/Benefits/Requests/BenefitsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record BenefitsListRequest diff --git a/src/Merge.Client/Hris/Benefits/Requests/BenefitsRetrieveRequest.cs b/src/Merge.Client/Hris/Benefits/Requests/BenefitsRetrieveRequest.cs index 68f8c58b..3457c6ff 100644 --- a/src/Merge.Client/Hris/Benefits/Requests/BenefitsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Benefits/Requests/BenefitsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record BenefitsRetrieveRequest diff --git a/src/Merge.Client/Hris/Companies/CompaniesClient.cs b/src/Merge.Client/Hris/Companies/CompaniesClient.cs index 706e454a..6432e4ef 100644 --- a/src/Merge.Client/Hris/Companies/CompaniesClient.cs +++ b/src/Merge.Client/Hris/Companies/CompaniesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class CompaniesClient @@ -24,7 +22,7 @@ internal CompaniesClient(RawClient client) /// await client.Hris.Companies.ListAsync(new CompaniesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CompaniesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/companies", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/companies", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Hris.Companies.RetrieveAsync("id", new CompaniesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CompaniesRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/companies/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/companies/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Companies/Requests/CompaniesListRequest.cs b/src/Merge.Client/Hris/Companies/Requests/CompaniesListRequest.cs index 4fd602bb..4216f32c 100644 --- a/src/Merge.Client/Hris/Companies/Requests/CompaniesListRequest.cs +++ b/src/Merge.Client/Hris/Companies/Requests/CompaniesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record CompaniesListRequest diff --git a/src/Merge.Client/Hris/Companies/Requests/CompaniesRetrieveRequest.cs b/src/Merge.Client/Hris/Companies/Requests/CompaniesRetrieveRequest.cs index 372d19b6..8cc4ec78 100644 --- a/src/Merge.Client/Hris/Companies/Requests/CompaniesRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Companies/Requests/CompaniesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record CompaniesRetrieveRequest diff --git a/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs index 6655e13f..b375a099 100644 --- a/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Hris/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Hris/Dependents/DependentsClient.cs b/src/Merge.Client/Hris/Dependents/DependentsClient.cs index 10887e13..ae213df4 100644 --- a/src/Merge.Client/Hris/Dependents/DependentsClient.cs +++ b/src/Merge.Client/Hris/Dependents/DependentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class DependentsClient @@ -24,7 +22,7 @@ internal DependentsClient(RawClient client) /// await client.Hris.Dependents.ListAsync(new DependentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( DependentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,19 +45,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeSensitiveFields != null) { - _query["include_sensitive_fields"] = request.IncludeSensitiveFields.ToString(); + _query["include_sensitive_fields"] = JsonUtils.Serialize( + request.IncludeSensitiveFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/dependents", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/dependents", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -120,7 +122,7 @@ public async Task ListAsync( /// await client.Hris.Dependents.RetrieveAsync("id", new DependentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, DependentsRetrieveRequest request, RequestOptions? options = null, @@ -130,23 +132,27 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeSensitiveFields != null) { - _query["include_sensitive_fields"] = request.IncludeSensitiveFields.ToString(); + _query["include_sensitive_fields"] = JsonUtils.Serialize( + request.IncludeSensitiveFields.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/dependents/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/dependents/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Dependents/Requests/DependentsListRequest.cs b/src/Merge.Client/Hris/Dependents/Requests/DependentsListRequest.cs index 02885324..a9c5319c 100644 --- a/src/Merge.Client/Hris/Dependents/Requests/DependentsListRequest.cs +++ b/src/Merge.Client/Hris/Dependents/Requests/DependentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record DependentsListRequest diff --git a/src/Merge.Client/Hris/Dependents/Requests/DependentsRetrieveRequest.cs b/src/Merge.Client/Hris/Dependents/Requests/DependentsRetrieveRequest.cs index 6e4df830..55997cf8 100644 --- a/src/Merge.Client/Hris/Dependents/Requests/DependentsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Dependents/Requests/DependentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record DependentsRetrieveRequest diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs index 75edcf7b..ee15d255 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/EmployeePayrollRunsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class EmployeePayrollRunsClient @@ -24,7 +22,7 @@ internal EmployeePayrollRunsClient(RawClient client) /// await client.Hris.EmployeePayrollRuns.ListAsync(new EmployeePayrollRunsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EmployeePayrollRunsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,15 +61,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -87,7 +85,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PayrollRunId != null) { @@ -107,17 +105,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/employee-payroll-runs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/employee-payroll-runs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -146,7 +146,7 @@ public async Task ListAsync( /// await client.Hris.EmployeePayrollRuns.RetrieveAsync("id", new EmployeePayrollRunsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EmployeePayrollRunsRetrieveRequest request, RequestOptions? options = null, @@ -160,19 +160,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/employee-payroll-runs/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/employee-payroll-runs/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsListRequest.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsListRequest.cs index 00f8f7bd..6a0a8d28 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsListRequest.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeePayrollRunsListRequest diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsRetrieveRequest.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsRetrieveRequest.cs index a9d01728..de354b67 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/Requests/EmployeePayrollRunsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeePayrollRunsRetrieveRequest diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsListRequestExpand.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsListRequestExpand.cs index 7ff7c157..b44a5379 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsListRequestExpand.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeePayrollRunsListRequestExpand { [EnumMember(Value = "employee")] diff --git a/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsRetrieveRequestExpand.cs b/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsRetrieveRequestExpand.cs index 2f5184c9..ae9e6bf5 100644 --- a/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Hris/EmployeePayrollRuns/Types/EmployeePayrollRunsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeePayrollRunsRetrieveRequestExpand { [EnumMember(Value = "employee")] diff --git a/src/Merge.Client/Hris/Employees/EmployeesClient.cs b/src/Merge.Client/Hris/Employees/EmployeesClient.cs index 36310cb1..ad0723f7 100644 --- a/src/Merge.Client/Hris/Employees/EmployeesClient.cs +++ b/src/Merge.Client/Hris/Employees/EmployeesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class EmployeesClient @@ -24,7 +22,7 @@ internal EmployeesClient(RawClient client) /// await client.Hris.Employees.ListAsync(new EmployeesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EmployeesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -79,19 +77,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeSensitiveFields != null) { - _query["include_sensitive_fields"] = request.IncludeSensitiveFields.ToString(); + _query["include_sensitive_fields"] = JsonUtils.Serialize( + request.IncludeSensitiveFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.JobTitle != null) { @@ -119,7 +119,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PayGroupId != null) { @@ -175,17 +175,19 @@ public async Task ListAsync( { _query["work_location_id"] = request.WorkLocationId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/employees", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/employees", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -216,7 +218,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EmployeeEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -225,25 +227,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/employees", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/employees", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -272,7 +277,7 @@ public async Task CreateAsync( /// await client.Hris.Employees.RetrieveAsync("id", new EmployeesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EmployeesRetrieveRequest request, RequestOptions? options = null, @@ -286,11 +291,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeSensitiveFields != null) { - _query["include_sensitive_fields"] = request.IncludeSensitiveFields.ToString(); + _query["include_sensitive_fields"] = JsonUtils.Serialize( + request.IncludeSensitiveFields.Value + ); } if (request.RemoteFields != null) { @@ -300,17 +307,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/employees/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/employees/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -352,17 +361,20 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = $"hris/v1/employees/ignore/{modelId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"hris/v1/employees/ignore/{modelId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; @@ -383,21 +395,23 @@ public async System.Threading.Tasks.Task IgnoreCreateAsync( /// await client.Hris.Employees.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/employees/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/employees/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Employees/Requests/EmployeeEndpointRequest.cs b/src/Merge.Client/Hris/Employees/Requests/EmployeeEndpointRequest.cs index 545ddef1..87c33b47 100644 --- a/src/Merge.Client/Hris/Employees/Requests/EmployeeEndpointRequest.cs +++ b/src/Merge.Client/Hris/Employees/Requests/EmployeeEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeeEndpointRequest diff --git a/src/Merge.Client/Hris/Employees/Requests/EmployeesListRequest.cs b/src/Merge.Client/Hris/Employees/Requests/EmployeesListRequest.cs index 62ea2949..fdf1d896 100644 --- a/src/Merge.Client/Hris/Employees/Requests/EmployeesListRequest.cs +++ b/src/Merge.Client/Hris/Employees/Requests/EmployeesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeesListRequest diff --git a/src/Merge.Client/Hris/Employees/Requests/EmployeesRetrieveRequest.cs b/src/Merge.Client/Hris/Employees/Requests/EmployeesRetrieveRequest.cs index 659e779f..8bc7f596 100644 --- a/src/Merge.Client/Hris/Employees/Requests/EmployeesRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Employees/Requests/EmployeesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeesRetrieveRequest diff --git a/src/Merge.Client/Hris/Employees/Requests/IgnoreCommonModelRequest.cs b/src/Merge.Client/Hris/Employees/Requests/IgnoreCommonModelRequest.cs index b24a7072..2d1f4c27 100644 --- a/src/Merge.Client/Hris/Employees/Requests/IgnoreCommonModelRequest.cs +++ b/src/Merge.Client/Hris/Employees/Requests/IgnoreCommonModelRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record IgnoreCommonModelRequest diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestEmploymentStatus.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestEmploymentStatus.cs index b8b13421..ddc3aa13 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestEmploymentStatus.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestEmploymentStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesListRequestEmploymentStatus { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestExpand.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestExpand.cs index c15c0337..a8df30ee 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestExpand.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesListRequestExpand { [EnumMember(Value = "company")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestRemoteFields.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestRemoteFields.cs index eed6a06f..cbabc648 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesListRequestRemoteFields { [EnumMember(Value = "employment_status")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestShowEnumOrigins.cs index 0d3824f0..c696be15 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesListRequestShowEnumOrigins { [EnumMember(Value = "employment_status")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestExpand.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestExpand.cs index 80093935..5f1b63fc 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestExpand.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesRetrieveRequestExpand { [EnumMember(Value = "company")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestRemoteFields.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestRemoteFields.cs index 5ce30712..fac51b19 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesRetrieveRequestRemoteFields { [EnumMember(Value = "employment_status")] diff --git a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestShowEnumOrigins.cs index 0f4e4fab..63575641 100644 --- a/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Employees/Types/EmployeesRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmployeesRetrieveRequestShowEnumOrigins { [EnumMember(Value = "employment_status")] diff --git a/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs b/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs index 864c10a4..a666f1a1 100644 --- a/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs +++ b/src/Merge.Client/Hris/EmployerBenefits/EmployerBenefitsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class EmployerBenefitsClient @@ -24,7 +22,7 @@ internal EmployerBenefitsClient(RawClient client) /// await client.Hris.EmployerBenefits.ListAsync(new EmployerBenefitsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EmployerBenefitsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/employer-benefits", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/employer-benefits", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Hris.EmployerBenefits.RetrieveAsync("id", new EmployerBenefitsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EmployerBenefitsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/employer-benefits/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/employer-benefits/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsListRequest.cs b/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsListRequest.cs index dda3894e..bce5de23 100644 --- a/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsListRequest.cs +++ b/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployerBenefitsListRequest diff --git a/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsRetrieveRequest.cs b/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsRetrieveRequest.cs index e5831bf4..9042819d 100644 --- a/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/EmployerBenefits/Requests/EmployerBenefitsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployerBenefitsRetrieveRequest diff --git a/src/Merge.Client/Hris/Employments/EmploymentsClient.cs b/src/Merge.Client/Hris/Employments/EmploymentsClient.cs index 49ec1883..e243ff4e 100644 --- a/src/Merge.Client/Hris/Employments/EmploymentsClient.cs +++ b/src/Merge.Client/Hris/Employments/EmploymentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class EmploymentsClient @@ -24,7 +22,7 @@ internal EmploymentsClient(RawClient client) /// await client.Hris.Employments.ListAsync(new EmploymentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( EmploymentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -83,7 +81,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/employments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/employments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Hris.Employments.RetrieveAsync("id", new EmploymentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, EmploymentsRetrieveRequest request, RequestOptions? options = null, @@ -150,7 +150,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -160,17 +160,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/employments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/employments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Employments/Requests/EmploymentsListRequest.cs b/src/Merge.Client/Hris/Employments/Requests/EmploymentsListRequest.cs index 6eecfaa8..df1a398d 100644 --- a/src/Merge.Client/Hris/Employments/Requests/EmploymentsListRequest.cs +++ b/src/Merge.Client/Hris/Employments/Requests/EmploymentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmploymentsListRequest diff --git a/src/Merge.Client/Hris/Employments/Requests/EmploymentsRetrieveRequest.cs b/src/Merge.Client/Hris/Employments/Requests/EmploymentsRetrieveRequest.cs index 9cf710d9..75b48342 100644 --- a/src/Merge.Client/Hris/Employments/Requests/EmploymentsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Employments/Requests/EmploymentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmploymentsRetrieveRequest diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestExpand.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestExpand.cs index 1a24723d..ae8d94e7 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestExpand.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsListRequestExpand { [EnumMember(Value = "employee")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestOrderBy.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestOrderBy.cs index bb45c05d..f6061c19 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestOrderBy.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestOrderBy.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsListRequestOrderBy { [EnumMember(Value = "-effective_date")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestRemoteFields.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestRemoteFields.cs index 187b4b38..fa3fa96a 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsListRequestRemoteFields { [EnumMember(Value = "employment_type")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestShowEnumOrigins.cs index e0fe16cd..d56437ce 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsListRequestShowEnumOrigins { [EnumMember(Value = "employment_type")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestExpand.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestExpand.cs index ff6742d3..52639f17 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsRetrieveRequestExpand { [EnumMember(Value = "employee")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestRemoteFields.cs index bd2fa47e..dd669744 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsRetrieveRequestRemoteFields { [EnumMember(Value = "employment_type")] diff --git a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestShowEnumOrigins.cs index aefc88f8..8b4ffaf5 100644 --- a/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Employments/Types/EmploymentsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "employment_type")] diff --git a/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs index 71172240..f8d4c87b 100644 --- a/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Hris/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class FieldMappingClient @@ -24,7 +22,7 @@ internal FieldMappingClient(RawClient client) /// await client.Hris.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -33,19 +31,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,7 +78,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -84,7 +86,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -93,7 +95,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -104,18 +108,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,22 +151,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Hris.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"hris/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"hris/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,24 +200,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"hris/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"hris/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -237,7 +249,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Hris.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -252,17 +264,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -291,21 +305,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Hris.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Hris/FieldMapping/Requests/CreateFieldMappingRequest.cs index dc956f5e..82046b01 100644 --- a/src/Merge.Client/Hris/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Hris/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Hris/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Hris/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index c95d40b0..f797d72e 100644 --- a/src/Merge.Client/Hris/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Hris/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Hris/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index 8253644d..66e13ad3 100644 --- a/src/Merge.Client/Hris/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Hris/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Hris/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Hris/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index 17714a93..efe08f09 100644 --- a/src/Merge.Client/Hris/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs index d18e9d09..e5c249b1 100644 --- a/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Hris/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Hris.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs index 2d142582..6f4555ce 100644 --- a/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Hris/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Hris/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index 48b87add..15c089e2 100644 --- a/src/Merge.Client/Hris/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Hris/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Hris/Groups/GroupsClient.cs b/src/Merge.Client/Hris/Groups/GroupsClient.cs index cbfa51ec..a637e105 100644 --- a/src/Merge.Client/Hris/Groups/GroupsClient.cs +++ b/src/Merge.Client/Hris/Groups/GroupsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class GroupsClient @@ -24,7 +22,7 @@ internal GroupsClient(RawClient client) /// await client.Hris.Groups.ListAsync(new GroupsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( GroupsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonlyUsedAsTeam != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["types"] = request.Types; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/groups", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/groups", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Hris.Groups.RetrieveAsync("id", new GroupsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, GroupsRetrieveRequest request, RequestOptions? options = null, @@ -146,7 +146,7 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -156,17 +156,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/groups/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/groups/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Groups/Requests/GroupsListRequest.cs b/src/Merge.Client/Hris/Groups/Requests/GroupsListRequest.cs index 40e69938..79ff1a63 100644 --- a/src/Merge.Client/Hris/Groups/Requests/GroupsListRequest.cs +++ b/src/Merge.Client/Hris/Groups/Requests/GroupsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record GroupsListRequest diff --git a/src/Merge.Client/Hris/Groups/Requests/GroupsRetrieveRequest.cs b/src/Merge.Client/Hris/Groups/Requests/GroupsRetrieveRequest.cs index a513fd59..f5f987d2 100644 --- a/src/Merge.Client/Hris/Groups/Requests/GroupsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Groups/Requests/GroupsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record GroupsRetrieveRequest diff --git a/src/Merge.Client/Hris/HrisClient.cs b/src/Merge.Client/Hris/HrisClient.cs index b76c32f6..c8941203 100644 --- a/src/Merge.Client/Hris/HrisClient.cs +++ b/src/Merge.Client/Hris/HrisClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class HrisClient diff --git a/src/Merge.Client/Hris/Issues/IssuesClient.cs b/src/Merge.Client/Hris/Issues/IssuesClient.cs index 4a16357f..97e5e5ce 100644 --- a/src/Merge.Client/Hris/Issues/IssuesClient.cs +++ b/src/Merge.Client/Hris/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Hris.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Hris.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Hris/Issues/Requests/IssuesListRequest.cs index cc2cd55c..fa6e3cf9 100644 --- a/src/Merge.Client/Hris/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Hris/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record IssuesListRequest diff --git a/src/Merge.Client/Hris/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Hris/Issues/Types/IssuesListRequestStatus.cs index 6e0e8f45..20fef6e3 100644 --- a/src/Merge.Client/Hris/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Hris/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs index 6a4a8c30..7a5efe25 100644 --- a/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Hris/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Hris.CategoriesEnum>() /// { /// Merge.Client.Hris.CategoriesEnum.Hris, /// Merge.Client.Hris.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Hris/LinkToken/Requests/EndUserDetailsRequest.cs index de3d87a6..32115038 100644 --- a/src/Merge.Client/Hris/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Hris/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs index a0644fde..b56c7c59 100644 --- a/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Hris/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Hris.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Hris/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index eb281725..a63ccb36 100644 --- a/src/Merge.Client/Hris/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Hris/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Hris/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Hris/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index 4e6a7054..b9fde8e7 100644 --- a/src/Merge.Client/Hris/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Hris/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Hris/Locations/LocationsClient.cs b/src/Merge.Client/Hris/Locations/LocationsClient.cs index 412cc5e2..ff289f3c 100644 --- a/src/Merge.Client/Hris/Locations/LocationsClient.cs +++ b/src/Merge.Client/Hris/Locations/LocationsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class LocationsClient @@ -24,7 +22,7 @@ internal LocationsClient(RawClient client) /// await client.Hris.Locations.ListAsync(new LocationsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LocationsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.LocationType != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -89,17 +87,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/locations", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/locations", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -128,7 +128,7 @@ public async Task ListAsync( /// await client.Hris.Locations.RetrieveAsync("id", new LocationsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, LocationsRetrieveRequest request, RequestOptions? options = null, @@ -138,7 +138,7 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -148,17 +148,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/locations/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/locations/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Locations/Requests/LocationsListRequest.cs b/src/Merge.Client/Hris/Locations/Requests/LocationsListRequest.cs index 43a85664..dd79304c 100644 --- a/src/Merge.Client/Hris/Locations/Requests/LocationsListRequest.cs +++ b/src/Merge.Client/Hris/Locations/Requests/LocationsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LocationsListRequest diff --git a/src/Merge.Client/Hris/Locations/Requests/LocationsRetrieveRequest.cs b/src/Merge.Client/Hris/Locations/Requests/LocationsRetrieveRequest.cs index 61821a00..9af22b16 100644 --- a/src/Merge.Client/Hris/Locations/Requests/LocationsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Locations/Requests/LocationsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LocationsRetrieveRequest diff --git a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestLocationType.cs b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestLocationType.cs index 405a442c..3bb72bcc 100644 --- a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestLocationType.cs +++ b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestLocationType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationsListRequestLocationType { [EnumMember(Value = "HOME")] diff --git a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestRemoteFields.cs b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestRemoteFields.cs index dee5e521..2d170cdc 100644 --- a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationsListRequestRemoteFields { [EnumMember(Value = "country")] diff --git a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestShowEnumOrigins.cs index a3cc35a8..42b92744 100644 --- a/src/Merge.Client/Hris/Locations/Types/LocationsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Locations/Types/LocationsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationsListRequestShowEnumOrigins { [EnumMember(Value = "country")] diff --git a/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestRemoteFields.cs index 9d9ecce4..2fe30bfb 100644 --- a/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationsRetrieveRequestRemoteFields { [EnumMember(Value = "country")] diff --git a/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestShowEnumOrigins.cs index 5e2d88ae..6cf04c92 100644 --- a/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/Locations/Types/LocationsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "country")] diff --git a/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs b/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs index 77eddea7..c4e7ba88 100644 --- a/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Hris/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs b/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs index 8e237bec..2ef21bb9 100644 --- a/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs +++ b/src/Merge.Client/Hris/PayGroups/PayGroupsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class PayGroupsClient @@ -24,7 +22,7 @@ internal PayGroupsClient(RawClient client) /// await client.Hris.PayGroups.ListAsync(new PayGroupsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( PayGroupsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/pay-groups", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/pay-groups", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Hris.PayGroups.RetrieveAsync("id", new PayGroupsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, PayGroupsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/pay-groups/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/pay-groups/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsListRequest.cs b/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsListRequest.cs index ef57d225..31312a1d 100644 --- a/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsListRequest.cs +++ b/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayGroupsListRequest diff --git a/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsRetrieveRequest.cs b/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsRetrieveRequest.cs index 765f0695..09030010 100644 --- a/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/PayGroups/Requests/PayGroupsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayGroupsRetrieveRequest diff --git a/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs b/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs index c7623eea..b636d676 100644 --- a/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs +++ b/src/Merge.Client/Hris/PayrollRuns/PayrollRunsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class PayrollRunsClient @@ -24,7 +22,7 @@ internal PayrollRunsClient(RawClient client) /// await client.Hris.PayrollRuns.ListAsync(new PayrollRunsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( PayrollRunsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -107,17 +105,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/payroll-runs", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/payroll-runs", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -146,7 +146,7 @@ public async Task ListAsync( /// await client.Hris.PayrollRuns.RetrieveAsync("id", new PayrollRunsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, PayrollRunsRetrieveRequest request, RequestOptions? options = null, @@ -156,7 +156,7 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -166,17 +166,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/payroll-runs/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/payroll-runs/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsListRequest.cs b/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsListRequest.cs index edf812fa..a485f5a8 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsListRequest.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayrollRunsListRequest diff --git a/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsRetrieveRequest.cs b/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsRetrieveRequest.cs index a03ac428..b530783d 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Requests/PayrollRunsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayrollRunsRetrieveRequest diff --git a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRemoteFields.cs b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRemoteFields.cs index 8570865e..0212412e 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayrollRunsListRequestRemoteFields { [EnumMember(Value = "run_state")] diff --git a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRunType.cs b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRunType.cs index 52210604..8b83a14f 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRunType.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestRunType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayrollRunsListRequestRunType { [EnumMember(Value = "CORRECTION")] diff --git a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestShowEnumOrigins.cs index 497cecac..fa114d54 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayrollRunsListRequestShowEnumOrigins { [EnumMember(Value = "run_state")] diff --git a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestRemoteFields.cs index 83c917ea..6b457fcc 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayrollRunsRetrieveRequestRemoteFields { [EnumMember(Value = "run_state")] diff --git a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestShowEnumOrigins.cs index d71e3a6f..8fcab45b 100644 --- a/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/PayrollRuns/Types/PayrollRunsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayrollRunsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "run_state")] diff --git a/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs index e79da258..3bde9ca4 100644 --- a/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Hris/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Hris/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index fcf1b48e..2dc55cd3 100644 --- a/src/Merge.Client/Hris/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Hris/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Hris/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Hris/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index 2b605e82..8fad5535 100644 --- a/src/Merge.Client/Hris/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Hris/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Hris/Scopes/ScopesClient.cs b/src/Merge.Client/Hris/Scopes/ScopesClient.cs index 9d68eb5f..bd29e931 100644 --- a/src/Merge.Client/Hris/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Hris/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Hris.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Hris.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -110,15 +112,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// await client.Hris.Scopes.LinkedAccountScopesCreateAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { - /// CommonModels = new List() + /// CommonModels = new List<Merge.Client.Hris.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Hris.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Hris.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -137,17 +139,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// }, /// FieldPermissions = new Merge.Client.Hris.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Hris.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Hris.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -163,23 +165,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Hris/SyncStatus/Requests/SyncStatusListRequest.cs index 11def045..b1289107 100644 --- a/src/Merge.Client/Hris/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Hris/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record SyncStatusListRequest diff --git a/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs index 2e2fb272..967d49c6 100644 --- a/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Hris/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Hris.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/Teams/Requests/TeamsListRequest.cs b/src/Merge.Client/Hris/Teams/Requests/TeamsListRequest.cs index cbedb6d5..d25f1b2b 100644 --- a/src/Merge.Client/Hris/Teams/Requests/TeamsListRequest.cs +++ b/src/Merge.Client/Hris/Teams/Requests/TeamsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TeamsListRequest diff --git a/src/Merge.Client/Hris/Teams/Requests/TeamsRetrieveRequest.cs b/src/Merge.Client/Hris/Teams/Requests/TeamsRetrieveRequest.cs index 00e6c2f2..9129f251 100644 --- a/src/Merge.Client/Hris/Teams/Requests/TeamsRetrieveRequest.cs +++ b/src/Merge.Client/Hris/Teams/Requests/TeamsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TeamsRetrieveRequest diff --git a/src/Merge.Client/Hris/Teams/TeamsClient.cs b/src/Merge.Client/Hris/Teams/TeamsClient.cs index d6924041..b7121ca2 100644 --- a/src/Merge.Client/Hris/Teams/TeamsClient.cs +++ b/src/Merge.Client/Hris/Teams/TeamsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class TeamsClient @@ -24,7 +22,7 @@ internal TeamsClient(RawClient client) /// await client.Hris.Teams.ListAsync(new TeamsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TeamsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.ParentTeamId != null) { @@ -85,17 +83,19 @@ public async Task ListAsync( { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/teams", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/teams", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Hris.Teams.RetrieveAsync("id", new TeamsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TeamsRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/teams/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/teams/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffEndpointRequest.cs b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffEndpointRequest.cs index 56b8edf6..89c99a9c 100644 --- a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffEndpointRequest.cs +++ b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffEndpointRequest diff --git a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffListRequest.cs b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffListRequest.cs index eea12592..35aa0722 100644 --- a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffListRequest.cs +++ b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffListRequest diff --git a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffRetrieveRequest.cs b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffRetrieveRequest.cs index a63981cb..2828f2a0 100644 --- a/src/Merge.Client/Hris/TimeOff/Requests/TimeOffRetrieveRequest.cs +++ b/src/Merge.Client/Hris/TimeOff/Requests/TimeOffRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffRetrieveRequest diff --git a/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs b/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs index 351fcf02..4a0f13b7 100644 --- a/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs +++ b/src/Merge.Client/Hris/TimeOff/TimeOffClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class TimeOffClient @@ -24,7 +22,7 @@ internal TimeOffClient(RawClient client) /// await client.Hris.TimeOff.ListAsync(new TimeOffListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TimeOffListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -67,15 +65,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -91,7 +89,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteFields != null) { @@ -123,17 +121,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/time-off", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/time-off", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -162,7 +162,7 @@ public async Task ListAsync( /// await client.Hris.TimeOff.CreateAsync(new TimeOffEndpointRequest { Model = new TimeOffRequest() }); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TimeOffEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -171,25 +171,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/time-off", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/time-off", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -218,7 +221,7 @@ public async Task CreateAsync( /// await client.Hris.TimeOff.RetrieveAsync("id", new TimeOffRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TimeOffRetrieveRequest request, RequestOptions? options = null, @@ -232,7 +235,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -242,17 +245,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/time-off/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/time-off/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -281,21 +286,23 @@ public async Task RetrieveAsync( /// await client.Hris.TimeOff.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/time-off/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/time-off/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestExpand.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestExpand.cs index 8a8a08e7..5c5a9a09 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestExpand.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffListRequestExpand { [EnumMember(Value = "approver")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRemoteFields.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRemoteFields.cs index a42cba5f..3a253f07 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffListRequestRemoteFields { [EnumMember(Value = "request_type")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRequestType.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRequestType.cs index 1c3422ee..95f7b631 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRequestType.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestRequestType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffListRequestRequestType { [EnumMember(Value = "BEREAVEMENT")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestShowEnumOrigins.cs index b75d4494..de814025 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffListRequestShowEnumOrigins { [EnumMember(Value = "request_type")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestStatus.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestStatus.cs index 78e4c3d3..7a15cb9f 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestStatus.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffListRequestStatus { [EnumMember(Value = "APPROVED")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestExpand.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestExpand.cs index 284d564c..ccf930da 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestExpand.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffRetrieveRequestExpand { [EnumMember(Value = "approver")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestRemoteFields.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestRemoteFields.cs index 20b4f54b..6025e112 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffRetrieveRequestRemoteFields { [EnumMember(Value = "request_type")] diff --git a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestShowEnumOrigins.cs index 2892bd2a..a54add43 100644 --- a/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Hris/TimeOff/Types/TimeOffRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffRetrieveRequestShowEnumOrigins { [EnumMember(Value = "request_type")] diff --git a/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesListRequest.cs b/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesListRequest.cs index 70641d4a..5a45ce38 100644 --- a/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesListRequest.cs +++ b/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffBalancesListRequest diff --git a/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesRetrieveRequest.cs b/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesRetrieveRequest.cs index 30c8ef61..585f94d9 100644 --- a/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesRetrieveRequest.cs +++ b/src/Merge.Client/Hris/TimeOffBalances/Requests/TimeOffBalancesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffBalancesRetrieveRequest diff --git a/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs b/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs index 31541632..ee6e03b7 100644 --- a/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs +++ b/src/Merge.Client/Hris/TimeOffBalances/TimeOffBalancesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class TimeOffBalancesClient @@ -24,7 +22,7 @@ internal TimeOffBalancesClient(RawClient client) /// await client.Hris.TimeOffBalances.ListAsync(new TimeOffBalancesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TimeOffBalancesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.PolicyType != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/time-off-balances", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/time-off-balances", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Hris.TimeOffBalances.RetrieveAsync("id", new TimeOffBalancesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TimeOffBalancesRetrieveRequest request, RequestOptions? options = null, @@ -150,7 +150,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -160,17 +160,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/time-off-balances/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/time-off-balances/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/TimeOffBalances/Types/TimeOffBalancesListRequestPolicyType.cs b/src/Merge.Client/Hris/TimeOffBalances/Types/TimeOffBalancesListRequestPolicyType.cs index 77630bcd..ddc4c719 100644 --- a/src/Merge.Client/Hris/TimeOffBalances/Types/TimeOffBalancesListRequestPolicyType.cs +++ b/src/Merge.Client/Hris/TimeOffBalances/Types/TimeOffBalancesListRequestPolicyType.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffBalancesListRequestPolicyType { [EnumMember(Value = "BEREAVEMENT")] diff --git a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesListRequest.cs b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesListRequest.cs index 29117fbd..dc90c56f 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesListRequest.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntriesListRequest diff --git a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesRetrieveRequest.cs b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesRetrieveRequest.cs index f3e053fa..915fc818 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesRetrieveRequest.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntriesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntriesRetrieveRequest diff --git a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntryEndpointRequest.cs b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntryEndpointRequest.cs index a9b7319e..6a317a18 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntryEndpointRequest.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/Requests/TimesheetEntryEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntryEndpointRequest diff --git a/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs b/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs index be07ad0b..350fe1ad 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/TimesheetEntriesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class TimesheetEntriesClient @@ -24,7 +22,7 @@ internal TimesheetEntriesClient(RawClient client) /// await client.Hris.TimesheetEntries.ListAsync(new TimesheetEntriesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TimesheetEntriesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -63,15 +61,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -91,7 +89,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { @@ -107,17 +105,19 @@ public async Task ListAsync( Constants.DateTimeFormat ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/timesheet-entries", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/timesheet-entries", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -148,7 +148,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TimesheetEntryEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -157,25 +157,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/timesheet-entries", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/timesheet-entries", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -204,7 +207,7 @@ public async Task CreateAsync( /// await client.Hris.TimesheetEntries.RetrieveAsync("id", new TimesheetEntriesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TimesheetEntriesRetrieveRequest request, RequestOptions? options = null, @@ -218,19 +221,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"hris/v1/timesheet-entries/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"hris/v1/timesheet-entries/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -259,21 +264,23 @@ public async Task RetrieveAsync( /// await client.Hris.TimesheetEntries.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/timesheet-entries/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/timesheet-entries/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Hris/TimesheetEntries/Types/TimesheetEntriesListRequestOrderBy.cs b/src/Merge.Client/Hris/TimesheetEntries/Types/TimesheetEntriesListRequestOrderBy.cs index 24bdf73c..16d8de41 100644 --- a/src/Merge.Client/Hris/TimesheetEntries/Types/TimesheetEntriesListRequestOrderBy.cs +++ b/src/Merge.Client/Hris/TimesheetEntries/Types/TimesheetEntriesListRequestOrderBy.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimesheetEntriesListRequestOrderBy { [EnumMember(Value = "-start_time")] diff --git a/src/Merge.Client/Hris/Types/AccountDetails.cs b/src/Merge.Client/Hris/Types/AccountDetails.cs index 26a96edd..475728b6 100644 --- a/src/Merge.Client/Hris/Types/AccountDetails.cs +++ b/src/Merge.Client/Hris/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AccountDetails diff --git a/src/Merge.Client/Hris/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Hris/Types/AccountDetailsAndActions.cs index 16ed88c4..4f2c5db2 100644 --- a/src/Merge.Client/Hris/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Hris/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Hris/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Hris/Types/AccountDetailsAndActionsIntegration.cs index e7802f72..12c1bb5e 100644 --- a/src/Merge.Client/Hris/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Hris/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Hris/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Hris/Types/AccountDetailsAndActionsStatusEnum.cs index 91524d62..d69bc26f 100644 --- a/src/Merge.Client/Hris/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Hris/Types/AccountIntegration.cs b/src/Merge.Client/Hris/Types/AccountIntegration.cs index dac100b7..4605f22f 100644 --- a/src/Merge.Client/Hris/Types/AccountIntegration.cs +++ b/src/Merge.Client/Hris/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Hris/Types/AccountToken.cs b/src/Merge.Client/Hris/Types/AccountToken.cs index a1904a77..7f989621 100644 --- a/src/Merge.Client/Hris/Types/AccountToken.cs +++ b/src/Merge.Client/Hris/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AccountToken diff --git a/src/Merge.Client/Hris/Types/AccountTypeEnum.cs b/src/Merge.Client/Hris/Types/AccountTypeEnum.cs index 405aea21..6377d84a 100644 --- a/src/Merge.Client/Hris/Types/AccountTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/AccountTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountTypeEnum { [EnumMember(Value = "SAVINGS")] diff --git a/src/Merge.Client/Hris/Types/AdvancedMetadata.cs b/src/Merge.Client/Hris/Types/AdvancedMetadata.cs index 563bc797..27713c37 100644 --- a/src/Merge.Client/Hris/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Hris/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AdvancedMetadata diff --git a/src/Merge.Client/Hris/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Hris/Types/AsyncPassthroughReciept.cs index e621a092..9021a4c2 100644 --- a/src/Merge.Client/Hris/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Hris/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Hris/Types/AuditLogEvent.cs b/src/Merge.Client/Hris/Types/AuditLogEvent.cs index e4018513..912cc139 100644 --- a/src/Merge.Client/Hris/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Hris/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AuditLogEvent diff --git a/src/Merge.Client/Hris/Types/AvailableActions.cs b/src/Merge.Client/Hris/Types/AvailableActions.cs index 9e77a992..aa82d588 100644 --- a/src/Merge.Client/Hris/Types/AvailableActions.cs +++ b/src/Merge.Client/Hris/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record AvailableActions diff --git a/src/Merge.Client/Hris/Types/BankInfo.cs b/src/Merge.Client/Hris/Types/BankInfo.cs index 50f58719..fa080dde 100644 --- a/src/Merge.Client/Hris/Types/BankInfo.cs +++ b/src/Merge.Client/Hris/Types/BankInfo.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record BankInfo diff --git a/src/Merge.Client/Hris/Types/Benefit.cs b/src/Merge.Client/Hris/Types/Benefit.cs index a207fbfe..7137ad65 100644 --- a/src/Merge.Client/Hris/Types/Benefit.cs +++ b/src/Merge.Client/Hris/Types/Benefit.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record Benefit diff --git a/src/Merge.Client/Hris/Types/BenefitPlanTypeEnum.cs b/src/Merge.Client/Hris/Types/BenefitPlanTypeEnum.cs index 9a441711..11303ce1 100644 --- a/src/Merge.Client/Hris/Types/BenefitPlanTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/BenefitPlanTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum BenefitPlanTypeEnum { [EnumMember(Value = "MEDICAL")] diff --git a/src/Merge.Client/Hris/Types/CategoriesEnum.cs b/src/Merge.Client/Hris/Types/CategoriesEnum.cs index 209590d9..54711868 100644 --- a/src/Merge.Client/Hris/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Hris/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Hris/Types/CategoryEnum.cs b/src/Merge.Client/Hris/Types/CategoryEnum.cs index c0691582..2542fee7 100644 --- a/src/Merge.Client/Hris/Types/CategoryEnum.cs +++ b/src/Merge.Client/Hris/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Hris/Types/CommonModelScopeApi.cs b/src/Merge.Client/Hris/Types/CommonModelScopeApi.cs index 076599c3..9652f257 100644 --- a/src/Merge.Client/Hris/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Hris/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record CommonModelScopeApi diff --git a/src/Merge.Client/Hris/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Hris/Types/CommonModelScopesBodyRequest.cs index 53196572..d53376c3 100644 --- a/src/Merge.Client/Hris/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Hris/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Hris/Types/Company.cs b/src/Merge.Client/Hris/Types/Company.cs index 7b957c81..463b1620 100644 --- a/src/Merge.Client/Hris/Types/Company.cs +++ b/src/Merge.Client/Hris/Types/Company.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Company diff --git a/src/Merge.Client/Hris/Types/CountryEnum.cs b/src/Merge.Client/Hris/Types/CountryEnum.cs index be5e9801..09285ad0 100644 --- a/src/Merge.Client/Hris/Types/CountryEnum.cs +++ b/src/Merge.Client/Hris/Types/CountryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CountryEnum { [EnumMember(Value = "AF")] diff --git a/src/Merge.Client/Hris/Types/DataPassthroughRequest.cs b/src/Merge.Client/Hris/Types/DataPassthroughRequest.cs index e4801bf7..8886b033 100644 --- a/src/Merge.Client/Hris/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Hris/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record DataPassthroughRequest diff --git a/src/Merge.Client/Hris/Types/DebugModeLog.cs b/src/Merge.Client/Hris/Types/DebugModeLog.cs index 9b3a3e06..e4d4fbf0 100644 --- a/src/Merge.Client/Hris/Types/DebugModeLog.cs +++ b/src/Merge.Client/Hris/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record DebugModeLog diff --git a/src/Merge.Client/Hris/Types/DebugModelLogSummary.cs b/src/Merge.Client/Hris/Types/DebugModelLogSummary.cs index 46fb7e7a..085938b0 100644 --- a/src/Merge.Client/Hris/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Hris/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record DebugModelLogSummary diff --git a/src/Merge.Client/Hris/Types/Deduction.cs b/src/Merge.Client/Hris/Types/Deduction.cs index 24eba994..60ffd710 100644 --- a/src/Merge.Client/Hris/Types/Deduction.cs +++ b/src/Merge.Client/Hris/Types/Deduction.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Deduction diff --git a/src/Merge.Client/Hris/Types/Dependent.cs b/src/Merge.Client/Hris/Types/Dependent.cs index 10fdf7c8..cd52c884 100644 --- a/src/Merge.Client/Hris/Types/Dependent.cs +++ b/src/Merge.Client/Hris/Types/Dependent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Dependent diff --git a/src/Merge.Client/Hris/Types/Earning.cs b/src/Merge.Client/Hris/Types/Earning.cs index dfef7a16..4a8536a4 100644 --- a/src/Merge.Client/Hris/Types/Earning.cs +++ b/src/Merge.Client/Hris/Types/Earning.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Earning diff --git a/src/Merge.Client/Hris/Types/EarningTypeEnum.cs b/src/Merge.Client/Hris/Types/EarningTypeEnum.cs index 93108219..7d77e6ef 100644 --- a/src/Merge.Client/Hris/Types/EarningTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/EarningTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EarningTypeEnum { [EnumMember(Value = "SALARY")] diff --git a/src/Merge.Client/Hris/Types/Employee.cs b/src/Merge.Client/Hris/Types/Employee.cs index ce2b198c..a3b046bb 100644 --- a/src/Merge.Client/Hris/Types/Employee.cs +++ b/src/Merge.Client/Hris/Types/Employee.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record Employee diff --git a/src/Merge.Client/Hris/Types/EmployeePayrollRun.cs b/src/Merge.Client/Hris/Types/EmployeePayrollRun.cs index 81ea1fcd..98c21840 100644 --- a/src/Merge.Client/Hris/Types/EmployeePayrollRun.cs +++ b/src/Merge.Client/Hris/Types/EmployeePayrollRun.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record EmployeePayrollRun diff --git a/src/Merge.Client/Hris/Types/EmployeeRequest.cs b/src/Merge.Client/Hris/Types/EmployeeRequest.cs index 32fccd49..eb46475e 100644 --- a/src/Merge.Client/Hris/Types/EmployeeRequest.cs +++ b/src/Merge.Client/Hris/Types/EmployeeRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record EmployeeRequest diff --git a/src/Merge.Client/Hris/Types/EmployeeResponse.cs b/src/Merge.Client/Hris/Types/EmployeeResponse.cs index 39fd423a..e15a5fea 100644 --- a/src/Merge.Client/Hris/Types/EmployeeResponse.cs +++ b/src/Merge.Client/Hris/Types/EmployeeResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployeeResponse diff --git a/src/Merge.Client/Hris/Types/EmployerBenefit.cs b/src/Merge.Client/Hris/Types/EmployerBenefit.cs index 857e8eec..b1757e49 100644 --- a/src/Merge.Client/Hris/Types/EmployerBenefit.cs +++ b/src/Merge.Client/Hris/Types/EmployerBenefit.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record EmployerBenefit diff --git a/src/Merge.Client/Hris/Types/Employment.cs b/src/Merge.Client/Hris/Types/Employment.cs index 518041f2..5b02fe2c 100644 --- a/src/Merge.Client/Hris/Types/Employment.cs +++ b/src/Merge.Client/Hris/Types/Employment.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record Employment diff --git a/src/Merge.Client/Hris/Types/EmploymentStatusEnum.cs b/src/Merge.Client/Hris/Types/EmploymentStatusEnum.cs index 30604bee..5d193c27 100644 --- a/src/Merge.Client/Hris/Types/EmploymentStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/EmploymentStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentStatusEnum { [EnumMember(Value = "ACTIVE")] diff --git a/src/Merge.Client/Hris/Types/EmploymentTypeEnum.cs b/src/Merge.Client/Hris/Types/EmploymentTypeEnum.cs index 54b2de9b..66c138c7 100644 --- a/src/Merge.Client/Hris/Types/EmploymentTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/EmploymentTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EmploymentTypeEnum { [EnumMember(Value = "FULL_TIME")] diff --git a/src/Merge.Client/Hris/Types/EnabledActionsEnum.cs b/src/Merge.Client/Hris/Types/EnabledActionsEnum.cs index cea33b11..f33631ae 100644 --- a/src/Merge.Client/Hris/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Hris/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Hris/Types/EncodingEnum.cs b/src/Merge.Client/Hris/Types/EncodingEnum.cs index 35adac4d..11daa086 100644 --- a/src/Merge.Client/Hris/Types/EncodingEnum.cs +++ b/src/Merge.Client/Hris/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Hris/Types/ErrorValidationProblem.cs b/src/Merge.Client/Hris/Types/ErrorValidationProblem.cs index 0ee4b2d2..eaf3f723 100644 --- a/src/Merge.Client/Hris/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Hris/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ErrorValidationProblem diff --git a/src/Merge.Client/Hris/Types/EthnicityEnum.cs b/src/Merge.Client/Hris/Types/EthnicityEnum.cs index e993506e..7782e64b 100644 --- a/src/Merge.Client/Hris/Types/EthnicityEnum.cs +++ b/src/Merge.Client/Hris/Types/EthnicityEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EthnicityEnum { [EnumMember(Value = "AMERICAN_INDIAN_OR_ALASKA_NATIVE")] diff --git a/src/Merge.Client/Hris/Types/EventTypeEnum.cs b/src/Merge.Client/Hris/Types/EventTypeEnum.cs index fdf03c29..49c7a381 100644 --- a/src/Merge.Client/Hris/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Hris/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Hris/Types/ExternalTargetFieldApi.cs index f9e8053f..9220e566 100644 --- a/src/Merge.Client/Hris/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Hris/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Hris/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Hris/Types/ExternalTargetFieldApiResponse.cs index 5d200629..de487b22 100644 --- a/src/Merge.Client/Hris/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Hris/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Hris/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Hris/Types/FieldMappingApiInstance.cs index e8083c4b..91e0e5c1 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteField.cs index 8d580865..8ad8bdf1 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index acd3ab85..9181b128 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceResponse.cs index ad38d044..38b0a6fb 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceTargetField.cs index 4dc82af1..6bf1795d 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Hris/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Hris/Types/FieldMappingInstanceResponse.cs index c551d900..6f110e3d 100644 --- a/src/Merge.Client/Hris/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Hris/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Hris/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Hris/Types/FieldPermissionDeserializer.cs index f20d7e5b..dcbe5b84 100644 --- a/src/Merge.Client/Hris/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Hris/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Hris/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Hris/Types/FieldPermissionDeserializerRequest.cs index fddfd159..2c6d8473 100644 --- a/src/Merge.Client/Hris/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Hris/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Hris/Types/FlsaStatusEnum.cs b/src/Merge.Client/Hris/Types/FlsaStatusEnum.cs index 6fc66305..658e92e4 100644 --- a/src/Merge.Client/Hris/Types/FlsaStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/FlsaStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FlsaStatusEnum { [EnumMember(Value = "EXEMPT")] diff --git a/src/Merge.Client/Hris/Types/GenderEnum.cs b/src/Merge.Client/Hris/Types/GenderEnum.cs index 832d6e48..1fcf1e5d 100644 --- a/src/Merge.Client/Hris/Types/GenderEnum.cs +++ b/src/Merge.Client/Hris/Types/GenderEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum GenderEnum { [EnumMember(Value = "MALE")] diff --git a/src/Merge.Client/Hris/Types/Group.cs b/src/Merge.Client/Hris/Types/Group.cs index 85bbdc9d..1984e5a8 100644 --- a/src/Merge.Client/Hris/Types/Group.cs +++ b/src/Merge.Client/Hris/Types/Group.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Group diff --git a/src/Merge.Client/Hris/Types/GroupTypeEnum.cs b/src/Merge.Client/Hris/Types/GroupTypeEnum.cs index 525a5643..f946d6af 100644 --- a/src/Merge.Client/Hris/Types/GroupTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/GroupTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum GroupTypeEnum { [EnumMember(Value = "TEAM")] diff --git a/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializer.cs index 925f3a72..3000795c 100644 --- a/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializerRequest.cs index 284e3263..d99e2008 100644 --- a/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Hris/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Hris/Types/Issue.cs b/src/Merge.Client/Hris/Types/Issue.cs index 4b5167bf..559049c7 100644 --- a/src/Merge.Client/Hris/Types/Issue.cs +++ b/src/Merge.Client/Hris/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Issue diff --git a/src/Merge.Client/Hris/Types/IssueStatusEnum.cs b/src/Merge.Client/Hris/Types/IssueStatusEnum.cs index 37cbdc5e..22f898de 100644 --- a/src/Merge.Client/Hris/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Hris/Types/LanguageEnum.cs b/src/Merge.Client/Hris/Types/LanguageEnum.cs index 87a3d0ed..a85e0300 100644 --- a/src/Merge.Client/Hris/Types/LanguageEnum.cs +++ b/src/Merge.Client/Hris/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Hris/Types/LinkToken.cs b/src/Merge.Client/Hris/Types/LinkToken.cs index 0c6755b9..d3a0fe3c 100644 --- a/src/Merge.Client/Hris/Types/LinkToken.cs +++ b/src/Merge.Client/Hris/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LinkToken diff --git a/src/Merge.Client/Hris/Types/LinkedAccountStatus.cs b/src/Merge.Client/Hris/Types/LinkedAccountStatus.cs index a8f9ee15..5650b640 100644 --- a/src/Merge.Client/Hris/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Hris/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record LinkedAccountStatus diff --git a/src/Merge.Client/Hris/Types/Location.cs b/src/Merge.Client/Hris/Types/Location.cs index e22add5f..a9c060df 100644 --- a/src/Merge.Client/Hris/Types/Location.cs +++ b/src/Merge.Client/Hris/Types/Location.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Location diff --git a/src/Merge.Client/Hris/Types/LocationTypeEnum.cs b/src/Merge.Client/Hris/Types/LocationTypeEnum.cs index ce610b87..64f756f6 100644 --- a/src/Merge.Client/Hris/Types/LocationTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/LocationTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LocationTypeEnum { [EnumMember(Value = "HOME")] diff --git a/src/Merge.Client/Hris/Types/MaritalStatusEnum.cs b/src/Merge.Client/Hris/Types/MaritalStatusEnum.cs index 449c9b4b..92f238af 100644 --- a/src/Merge.Client/Hris/Types/MaritalStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/MaritalStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MaritalStatusEnum { [EnumMember(Value = "SINGLE")] diff --git a/src/Merge.Client/Hris/Types/MetaResponse.cs b/src/Merge.Client/Hris/Types/MetaResponse.cs index 440745b9..a83d5a4c 100644 --- a/src/Merge.Client/Hris/Types/MetaResponse.cs +++ b/src/Merge.Client/Hris/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record MetaResponse diff --git a/src/Merge.Client/Hris/Types/MethodEnum.cs b/src/Merge.Client/Hris/Types/MethodEnum.cs index d6479958..63c698e7 100644 --- a/src/Merge.Client/Hris/Types/MethodEnum.cs +++ b/src/Merge.Client/Hris/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Hris/Types/ModelOperation.cs b/src/Merge.Client/Hris/Types/ModelOperation.cs index 25c51756..52ca9bd1 100644 --- a/src/Merge.Client/Hris/Types/ModelOperation.cs +++ b/src/Merge.Client/Hris/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ModelOperation diff --git a/src/Merge.Client/Hris/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Hris/Types/ModelPermissionDeserializer.cs index 1f50b170..e7aee036 100644 --- a/src/Merge.Client/Hris/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Hris/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Hris/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Hris/Types/ModelPermissionDeserializerRequest.cs index d0891091..70f7b7bf 100644 --- a/src/Merge.Client/Hris/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Hris/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Hris/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Hris/Types/MultipartFormFieldRequest.cs index c1a3c2e7..61496b00 100644 --- a/src/Merge.Client/Hris/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Hris/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Hris/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Hris/Types/PaginatedAccountDetailsAndActionsList.cs index 31a5b3eb..83218a9b 100644 --- a/src/Merge.Client/Hris/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Hris/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Hris/Types/PaginatedAuditLogEventList.cs index 531c48c1..60fa78f1 100644 --- a/src/Merge.Client/Hris/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Hris/Types/PaginatedBankInfoList.cs b/src/Merge.Client/Hris/Types/PaginatedBankInfoList.cs index 4aa695c7..4d351be3 100644 --- a/src/Merge.Client/Hris/Types/PaginatedBankInfoList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedBankInfoList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedBankInfoList diff --git a/src/Merge.Client/Hris/Types/PaginatedBenefitList.cs b/src/Merge.Client/Hris/Types/PaginatedBenefitList.cs index de7de322..71ab358e 100644 --- a/src/Merge.Client/Hris/Types/PaginatedBenefitList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedBenefitList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedBenefitList diff --git a/src/Merge.Client/Hris/Types/PaginatedCompanyList.cs b/src/Merge.Client/Hris/Types/PaginatedCompanyList.cs index a5ae92f6..de7edadf 100644 --- a/src/Merge.Client/Hris/Types/PaginatedCompanyList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedCompanyList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedCompanyList diff --git a/src/Merge.Client/Hris/Types/PaginatedDependentList.cs b/src/Merge.Client/Hris/Types/PaginatedDependentList.cs index e11e50ca..27532a57 100644 --- a/src/Merge.Client/Hris/Types/PaginatedDependentList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedDependentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedDependentList diff --git a/src/Merge.Client/Hris/Types/PaginatedEmployeeList.cs b/src/Merge.Client/Hris/Types/PaginatedEmployeeList.cs index 6aa4337b..0bea2dfb 100644 --- a/src/Merge.Client/Hris/Types/PaginatedEmployeeList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedEmployeeList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedEmployeeList diff --git a/src/Merge.Client/Hris/Types/PaginatedEmployeePayrollRunList.cs b/src/Merge.Client/Hris/Types/PaginatedEmployeePayrollRunList.cs index f9bd5431..12de6ed7 100644 --- a/src/Merge.Client/Hris/Types/PaginatedEmployeePayrollRunList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedEmployeePayrollRunList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedEmployeePayrollRunList diff --git a/src/Merge.Client/Hris/Types/PaginatedEmployerBenefitList.cs b/src/Merge.Client/Hris/Types/PaginatedEmployerBenefitList.cs index dda69415..d3b2ddd9 100644 --- a/src/Merge.Client/Hris/Types/PaginatedEmployerBenefitList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedEmployerBenefitList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedEmployerBenefitList diff --git a/src/Merge.Client/Hris/Types/PaginatedEmploymentList.cs b/src/Merge.Client/Hris/Types/PaginatedEmploymentList.cs index 7206f7d0..dfe77d68 100644 --- a/src/Merge.Client/Hris/Types/PaginatedEmploymentList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedEmploymentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedEmploymentList diff --git a/src/Merge.Client/Hris/Types/PaginatedGroupList.cs b/src/Merge.Client/Hris/Types/PaginatedGroupList.cs index ef9021ad..48751e22 100644 --- a/src/Merge.Client/Hris/Types/PaginatedGroupList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedGroupList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedGroupList diff --git a/src/Merge.Client/Hris/Types/PaginatedIssueList.cs b/src/Merge.Client/Hris/Types/PaginatedIssueList.cs index bce18713..1fb5a8e6 100644 --- a/src/Merge.Client/Hris/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedIssueList diff --git a/src/Merge.Client/Hris/Types/PaginatedLocationList.cs b/src/Merge.Client/Hris/Types/PaginatedLocationList.cs index f9f4b151..d0eafe3a 100644 --- a/src/Merge.Client/Hris/Types/PaginatedLocationList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedLocationList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedLocationList diff --git a/src/Merge.Client/Hris/Types/PaginatedPayGroupList.cs b/src/Merge.Client/Hris/Types/PaginatedPayGroupList.cs index 3e0319f4..47819117 100644 --- a/src/Merge.Client/Hris/Types/PaginatedPayGroupList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedPayGroupList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedPayGroupList diff --git a/src/Merge.Client/Hris/Types/PaginatedPayrollRunList.cs b/src/Merge.Client/Hris/Types/PaginatedPayrollRunList.cs index b0bb2b9a..8601ed66 100644 --- a/src/Merge.Client/Hris/Types/PaginatedPayrollRunList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedPayrollRunList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedPayrollRunList diff --git a/src/Merge.Client/Hris/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Hris/Types/PaginatedSyncStatusList.cs index 626e2e1c..2f2ad82f 100644 --- a/src/Merge.Client/Hris/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Hris/Types/PaginatedTeamList.cs b/src/Merge.Client/Hris/Types/PaginatedTeamList.cs index 03effefa..c1967137 100644 --- a/src/Merge.Client/Hris/Types/PaginatedTeamList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedTeamList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedTeamList diff --git a/src/Merge.Client/Hris/Types/PaginatedTimeOffBalanceList.cs b/src/Merge.Client/Hris/Types/PaginatedTimeOffBalanceList.cs index 316801e4..bbe14de9 100644 --- a/src/Merge.Client/Hris/Types/PaginatedTimeOffBalanceList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedTimeOffBalanceList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedTimeOffBalanceList diff --git a/src/Merge.Client/Hris/Types/PaginatedTimeOffList.cs b/src/Merge.Client/Hris/Types/PaginatedTimeOffList.cs index a888eb3c..134dc909 100644 --- a/src/Merge.Client/Hris/Types/PaginatedTimeOffList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedTimeOffList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedTimeOffList diff --git a/src/Merge.Client/Hris/Types/PaginatedTimesheetEntryList.cs b/src/Merge.Client/Hris/Types/PaginatedTimesheetEntryList.cs index 107cd83c..cab1db3e 100644 --- a/src/Merge.Client/Hris/Types/PaginatedTimesheetEntryList.cs +++ b/src/Merge.Client/Hris/Types/PaginatedTimesheetEntryList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PaginatedTimesheetEntryList diff --git a/src/Merge.Client/Hris/Types/PayCurrencyEnum.cs b/src/Merge.Client/Hris/Types/PayCurrencyEnum.cs index 657c38b3..e6afd791 100644 --- a/src/Merge.Client/Hris/Types/PayCurrencyEnum.cs +++ b/src/Merge.Client/Hris/Types/PayCurrencyEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayCurrencyEnum { [EnumMember(Value = "XUA")] diff --git a/src/Merge.Client/Hris/Types/PayFrequencyEnum.cs b/src/Merge.Client/Hris/Types/PayFrequencyEnum.cs index 1125c55e..c998f082 100644 --- a/src/Merge.Client/Hris/Types/PayFrequencyEnum.cs +++ b/src/Merge.Client/Hris/Types/PayFrequencyEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayFrequencyEnum { [EnumMember(Value = "WEEKLY")] diff --git a/src/Merge.Client/Hris/Types/PayGroup.cs b/src/Merge.Client/Hris/Types/PayGroup.cs index 53618e57..fc8dbb09 100644 --- a/src/Merge.Client/Hris/Types/PayGroup.cs +++ b/src/Merge.Client/Hris/Types/PayGroup.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayGroup diff --git a/src/Merge.Client/Hris/Types/PayPeriodEnum.cs b/src/Merge.Client/Hris/Types/PayPeriodEnum.cs index f85ae870..c1764350 100644 --- a/src/Merge.Client/Hris/Types/PayPeriodEnum.cs +++ b/src/Merge.Client/Hris/Types/PayPeriodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PayPeriodEnum { [EnumMember(Value = "HOUR")] diff --git a/src/Merge.Client/Hris/Types/PayrollRun.cs b/src/Merge.Client/Hris/Types/PayrollRun.cs index f29ada16..5984b042 100644 --- a/src/Merge.Client/Hris/Types/PayrollRun.cs +++ b/src/Merge.Client/Hris/Types/PayrollRun.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record PayrollRun diff --git a/src/Merge.Client/Hris/Types/PolicyTypeEnum.cs b/src/Merge.Client/Hris/Types/PolicyTypeEnum.cs index 3a8c80f2..a10ed32a 100644 --- a/src/Merge.Client/Hris/Types/PolicyTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/PolicyTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PolicyTypeEnum { [EnumMember(Value = "VACATION")] diff --git a/src/Merge.Client/Hris/Types/ReasonEnum.cs b/src/Merge.Client/Hris/Types/ReasonEnum.cs index bd25f263..e2a36e56 100644 --- a/src/Merge.Client/Hris/Types/ReasonEnum.cs +++ b/src/Merge.Client/Hris/Types/ReasonEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ReasonEnum { [EnumMember(Value = "GENERAL_CUSTOMER_REQUEST")] diff --git a/src/Merge.Client/Hris/Types/RelationshipEnum.cs b/src/Merge.Client/Hris/Types/RelationshipEnum.cs index 943225e2..86c3f321 100644 --- a/src/Merge.Client/Hris/Types/RelationshipEnum.cs +++ b/src/Merge.Client/Hris/Types/RelationshipEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RelationshipEnum { [EnumMember(Value = "CHILD")] diff --git a/src/Merge.Client/Hris/Types/RemoteData.cs b/src/Merge.Client/Hris/Types/RemoteData.cs index 2f0109fd..1df174a3 100644 --- a/src/Merge.Client/Hris/Types/RemoteData.cs +++ b/src/Merge.Client/Hris/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteData diff --git a/src/Merge.Client/Hris/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Hris/Types/RemoteEndpointInfo.cs index 95c524e7..7dc1f537 100644 --- a/src/Merge.Client/Hris/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Hris/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Hris/Types/RemoteFieldApi.cs b/src/Merge.Client/Hris/Types/RemoteFieldApi.cs index 5f10f7ba..c6b393e4 100644 --- a/src/Merge.Client/Hris/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Hris/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record RemoteFieldApi diff --git a/src/Merge.Client/Hris/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Hris/Types/RemoteFieldApiResponse.cs index c482c8c4..9045b59b 100644 --- a/src/Merge.Client/Hris/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Hris/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Hris/Types/RemoteKey.cs b/src/Merge.Client/Hris/Types/RemoteKey.cs index e9e7a018..bf87f691 100644 --- a/src/Merge.Client/Hris/Types/RemoteKey.cs +++ b/src/Merge.Client/Hris/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteKey diff --git a/src/Merge.Client/Hris/Types/RemoteResponse.cs b/src/Merge.Client/Hris/Types/RemoteResponse.cs index 41639ed5..01f48ae7 100644 --- a/src/Merge.Client/Hris/Types/RemoteResponse.cs +++ b/src/Merge.Client/Hris/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record RemoteResponse diff --git a/src/Merge.Client/Hris/Types/RequestFormatEnum.cs b/src/Merge.Client/Hris/Types/RequestFormatEnum.cs index 749dd268..bcac941e 100644 --- a/src/Merge.Client/Hris/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Hris/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Hris/Types/RequestTypeEnum.cs b/src/Merge.Client/Hris/Types/RequestTypeEnum.cs index 3437872e..4b65aa5f 100644 --- a/src/Merge.Client/Hris/Types/RequestTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/RequestTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestTypeEnum { [EnumMember(Value = "VACATION")] diff --git a/src/Merge.Client/Hris/Types/ResponseTypeEnum.cs b/src/Merge.Client/Hris/Types/ResponseTypeEnum.cs index 9acb80a1..e6dbbaf6 100644 --- a/src/Merge.Client/Hris/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Hris/Types/RoleEnum.cs b/src/Merge.Client/Hris/Types/RoleEnum.cs index 1b376724..ead49a06 100644 --- a/src/Merge.Client/Hris/Types/RoleEnum.cs +++ b/src/Merge.Client/Hris/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Hris/Types/RunStateEnum.cs b/src/Merge.Client/Hris/Types/RunStateEnum.cs index 575cb2e3..98dbb4b1 100644 --- a/src/Merge.Client/Hris/Types/RunStateEnum.cs +++ b/src/Merge.Client/Hris/Types/RunStateEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RunStateEnum { [EnumMember(Value = "PAID")] diff --git a/src/Merge.Client/Hris/Types/RunTypeEnum.cs b/src/Merge.Client/Hris/Types/RunTypeEnum.cs index e4bd245e..47f74361 100644 --- a/src/Merge.Client/Hris/Types/RunTypeEnum.cs +++ b/src/Merge.Client/Hris/Types/RunTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RunTypeEnum { [EnumMember(Value = "REGULAR")] diff --git a/src/Merge.Client/Hris/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Hris/Types/SelectiveSyncConfigurationsUsageEnum.cs index 330fe510..f7388083 100644 --- a/src/Merge.Client/Hris/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Hris/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Hris/Types/SyncStatus.cs b/src/Merge.Client/Hris/Types/SyncStatus.cs index 0b09453c..073cfe2a 100644 --- a/src/Merge.Client/Hris/Types/SyncStatus.cs +++ b/src/Merge.Client/Hris/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record SyncStatus diff --git a/src/Merge.Client/Hris/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Hris/Types/SyncStatusStatusEnum.cs index cd12f439..0edcfce2 100644 --- a/src/Merge.Client/Hris/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Hris/Types/Tax.cs b/src/Merge.Client/Hris/Types/Tax.cs index 7c33dc35..0a439c8a 100644 --- a/src/Merge.Client/Hris/Types/Tax.cs +++ b/src/Merge.Client/Hris/Types/Tax.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record Tax diff --git a/src/Merge.Client/Hris/Types/Team.cs b/src/Merge.Client/Hris/Types/Team.cs index fd318aa8..45aa7c40 100644 --- a/src/Merge.Client/Hris/Types/Team.cs +++ b/src/Merge.Client/Hris/Types/Team.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record Team diff --git a/src/Merge.Client/Hris/Types/TimeOff.cs b/src/Merge.Client/Hris/Types/TimeOff.cs index 9903e970..eba93272 100644 --- a/src/Merge.Client/Hris/Types/TimeOff.cs +++ b/src/Merge.Client/Hris/Types/TimeOff.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record TimeOff diff --git a/src/Merge.Client/Hris/Types/TimeOffBalance.cs b/src/Merge.Client/Hris/Types/TimeOffBalance.cs index eb4b0b2e..22cfd56a 100644 --- a/src/Merge.Client/Hris/Types/TimeOffBalance.cs +++ b/src/Merge.Client/Hris/Types/TimeOffBalance.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffBalance diff --git a/src/Merge.Client/Hris/Types/TimeOffRequest.cs b/src/Merge.Client/Hris/Types/TimeOffRequest.cs index 21bfafe0..57f7ca4c 100644 --- a/src/Merge.Client/Hris/Types/TimeOffRequest.cs +++ b/src/Merge.Client/Hris/Types/TimeOffRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffRequest diff --git a/src/Merge.Client/Hris/Types/TimeOffResponse.cs b/src/Merge.Client/Hris/Types/TimeOffResponse.cs index f3d82bee..635594b5 100644 --- a/src/Merge.Client/Hris/Types/TimeOffResponse.cs +++ b/src/Merge.Client/Hris/Types/TimeOffResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimeOffResponse diff --git a/src/Merge.Client/Hris/Types/TimeOffStatusEnum.cs b/src/Merge.Client/Hris/Types/TimeOffStatusEnum.cs index 9fc9cdb3..1f50cff2 100644 --- a/src/Merge.Client/Hris/Types/TimeOffStatusEnum.cs +++ b/src/Merge.Client/Hris/Types/TimeOffStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TimeOffStatusEnum { [EnumMember(Value = "REQUESTED")] diff --git a/src/Merge.Client/Hris/Types/TimesheetEntry.cs b/src/Merge.Client/Hris/Types/TimesheetEntry.cs index faaf84ec..520e65e6 100644 --- a/src/Merge.Client/Hris/Types/TimesheetEntry.cs +++ b/src/Merge.Client/Hris/Types/TimesheetEntry.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntry diff --git a/src/Merge.Client/Hris/Types/TimesheetEntryRequest.cs b/src/Merge.Client/Hris/Types/TimesheetEntryRequest.cs index 3321f9c0..9f0fa1bb 100644 --- a/src/Merge.Client/Hris/Types/TimesheetEntryRequest.cs +++ b/src/Merge.Client/Hris/Types/TimesheetEntryRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntryRequest diff --git a/src/Merge.Client/Hris/Types/TimesheetEntryResponse.cs b/src/Merge.Client/Hris/Types/TimesheetEntryResponse.cs index 59b3241b..ac199605 100644 --- a/src/Merge.Client/Hris/Types/TimesheetEntryResponse.cs +++ b/src/Merge.Client/Hris/Types/TimesheetEntryResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record TimesheetEntryResponse diff --git a/src/Merge.Client/Hris/Types/UnitsEnum.cs b/src/Merge.Client/Hris/Types/UnitsEnum.cs index 7e3d05ce..9494af6d 100644 --- a/src/Merge.Client/Hris/Types/UnitsEnum.cs +++ b/src/Merge.Client/Hris/Types/UnitsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum UnitsEnum { [EnumMember(Value = "HOURS")] diff --git a/src/Merge.Client/Hris/Types/ValidationProblemSource.cs b/src/Merge.Client/Hris/Types/ValidationProblemSource.cs index f8666f71..45b845e1 100644 --- a/src/Merge.Client/Hris/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Hris/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record ValidationProblemSource diff --git a/src/Merge.Client/Hris/Types/WarningValidationProblem.cs b/src/Merge.Client/Hris/Types/WarningValidationProblem.cs index be277d42..8e96872f 100644 --- a/src/Merge.Client/Hris/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Hris/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record WarningValidationProblem diff --git a/src/Merge.Client/Hris/Types/WebhookReceiver.cs b/src/Merge.Client/Hris/Types/WebhookReceiver.cs index c462b4f9..c731f29b 100644 --- a/src/Merge.Client/Hris/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Hris/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record WebhookReceiver diff --git a/src/Merge.Client/Hris/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Hris/WebhookReceivers/Requests/WebhookReceiverRequest.cs index b43b3790..0bf1beb1 100644 --- a/src/Merge.Client/Hris/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Hris/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs index 611eae1d..18508684 100644 --- a/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Hris/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Hris; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Hris.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "hris/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "hris/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "hris/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "hris/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Merge.Client.Custom.props b/src/Merge.Client/Merge.Client.Custom.props new file mode 100644 index 00000000..70df2849 --- /dev/null +++ b/src/Merge.Client/Merge.Client.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/src/Merge.Client/Merge.Client.csproj b/src/Merge.Client/Merge.Client.csproj index fc14d0d8..17521fe5 100644 --- a/src/Merge.Client/Merge.Client.csproj +++ b/src/Merge.Client/Merge.Client.csproj @@ -1,55 +1,49 @@ - + net462;net8.0;net7.0;net6.0;netstandard2.0 enable - false 12 enable - 1.0.0 + 1.0.1 + $(Version) + $(Version) README.md LICENSE https://github.com/merge-api/merge-csharp-client - - - true - + - - - - - + - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all + + + + + - - - + - + - - - - <_Parameter1>Merge.Client.Test + diff --git a/src/Merge.Client/Merge.cs b/src/Merge.Client/Merge.cs index ea7057b7..511bc008 100644 --- a/src/Merge.Client/Merge.cs +++ b/src/Merge.Client/Merge.cs @@ -6,13 +6,11 @@ using Merge.Client.Hris; using Merge.Client.Ticketing; -#nullable enable - namespace Merge.Client; public partial class Merge { - private RawClient _client; + private readonly RawClient _client; public Merge( string? apiKey = null, @@ -28,7 +26,7 @@ public Merge( { "X-Fern-Language", "C#" }, { "X-Fern-SDK-Name", "Merge.Client" }, { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Merge.Client/1.0.0" }, + { "User-Agent", "Merge.Client/1.0.1" }, } ); clientOptions ??= new ClientOptions(); diff --git a/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs b/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs index 15c1af37..46e9e2b3 100644 --- a/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs +++ b/src/Merge.Client/Ticketing/AccountDetails/AccountDetailsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AccountDetailsClient @@ -24,21 +22,23 @@ internal AccountDetailsClient(RawClient client) /// await client.Ticketing.AccountDetails.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/account-details", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/account-details", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs b/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs index fc64a90e..554001ab 100644 --- a/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs +++ b/src/Merge.Client/Ticketing/AccountToken/AccountTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AccountTokenClient @@ -24,22 +22,24 @@ internal AccountTokenClient(RawClient client) /// await client.Ticketing.AccountToken.RetrieveAsync("public_token"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string publicToken, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/account-token/{publicToken}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/account-token/{publicToken}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs b/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs index db78572d..f8d38173 100644 --- a/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs +++ b/src/Merge.Client/Ticketing/Accounts/AccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AccountsClient @@ -24,7 +22,7 @@ internal AccountsClient(RawClient client) /// await client.Ticketing.Accounts.ListAsync(new AccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ticketing.Accounts.RetrieveAsync("id", new AccountsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AccountsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/accounts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/accounts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Accounts/Requests/AccountsListRequest.cs b/src/Merge.Client/Ticketing/Accounts/Requests/AccountsListRequest.cs index b21fb7e8..ac4c3a5d 100644 --- a/src/Merge.Client/Ticketing/Accounts/Requests/AccountsListRequest.cs +++ b/src/Merge.Client/Ticketing/Accounts/Requests/AccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountsListRequest diff --git a/src/Merge.Client/Ticketing/Accounts/Requests/AccountsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Accounts/Requests/AccountsRetrieveRequest.cs index d4855252..e2b2ed48 100644 --- a/src/Merge.Client/Ticketing/Accounts/Requests/AccountsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Accounts/Requests/AccountsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs b/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs index 381e043f..e082246b 100644 --- a/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs +++ b/src/Merge.Client/Ticketing/AsyncPassthrough/AsyncPassthroughClient.cs @@ -4,8 +4,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AsyncPassthroughClient @@ -31,23 +29,26 @@ internal AsyncPassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/async-passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/async-passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,22 +77,24 @@ public async Task CreateAsync( /// await client.Ticketing.AsyncPassthrough.RetrieveAsync("async_passthrough_receipt_id"); /// /// - public async Task> RetrieveAsync( + public async System.Threading.Tasks.Task> RetrieveAsync( string asyncPassthroughReceiptId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/async-passthrough/{asyncPassthroughReceiptId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/async-passthrough/{asyncPassthroughReceiptId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs b/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs index 210a6bc0..a34b5901 100644 --- a/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs +++ b/src/Merge.Client/Ticketing/Attachments/AttachmentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AttachmentsClient @@ -24,7 +22,7 @@ internal AttachmentsClient(RawClient client) /// await client.Ticketing.Attachments.ListAsync(new AttachmentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AttachmentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteCreatedAfter != null) { @@ -91,17 +89,19 @@ public async Task ListAsync( { _query["ticket_id"] = request.TicketId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/attachments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/attachments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -135,7 +135,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TicketingAttachmentEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -144,25 +144,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/attachments", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/attachments", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,7 +194,7 @@ public async Task CreateAsync( /// await client.Ticketing.Attachments.RetrieveAsync("id", new AttachmentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, AttachmentsRetrieveRequest request, RequestOptions? options = null, @@ -205,19 +208,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/attachments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/attachments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -261,17 +266,19 @@ public async System.Threading.Tasks.Task DownloadRetrieveAsync( { _query["mime_type"] = request.MimeType; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/attachments/{id}/download", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/attachments/{id}/download", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); throw new MergeApiException( $"Error with status code {response.StatusCode}", @@ -288,21 +295,23 @@ public async System.Threading.Tasks.Task DownloadRetrieveAsync( /// await client.Ticketing.Attachments.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/attachments/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/attachments/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsDownloadRetrieveRequest.cs b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsDownloadRetrieveRequest.cs index 6f48c58f..8f3160b4 100644 --- a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsDownloadRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsDownloadRetrieveRequest.cs @@ -1,13 +1,11 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AttachmentsDownloadRetrieveRequest { /// - /// If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our export format help center article. + /// If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. /// public string? MimeType { get; set; } diff --git a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsListRequest.cs b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsListRequest.cs index c3005f9a..42b39695 100644 --- a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsListRequest.cs +++ b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AttachmentsListRequest diff --git a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsRetrieveRequest.cs index e4eb3271..9dd26d15 100644 --- a/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Attachments/Requests/AttachmentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AttachmentsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Attachments/Requests/TicketingAttachmentEndpointRequest.cs b/src/Merge.Client/Ticketing/Attachments/Requests/TicketingAttachmentEndpointRequest.cs index f5225ba4..f716f4aa 100644 --- a/src/Merge.Client/Ticketing/Attachments/Requests/TicketingAttachmentEndpointRequest.cs +++ b/src/Merge.Client/Ticketing/Attachments/Requests/TicketingAttachmentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketingAttachmentEndpointRequest diff --git a/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs b/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs index 4f0bba02..3f721a14 100644 --- a/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs +++ b/src/Merge.Client/Ticketing/AuditTrail/AuditTrailClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AuditTrailClient @@ -24,7 +22,7 @@ internal AuditTrailClient(RawClient client) /// await client.Ticketing.AuditTrail.ListAsync(new AuditTrailListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( AuditTrailListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -45,7 +43,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -55,17 +53,19 @@ public async Task ListAsync( { _query["user_email"] = request.UserEmail; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/audit-trail", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/audit-trail", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/AuditTrail/Requests/AuditTrailListRequest.cs b/src/Merge.Client/Ticketing/AuditTrail/Requests/AuditTrailListRequest.cs index 9cc7fb63..147d4939 100644 --- a/src/Merge.Client/Ticketing/AuditTrail/Requests/AuditTrailListRequest.cs +++ b/src/Merge.Client/Ticketing/AuditTrail/Requests/AuditTrailListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AuditTrailListRequest diff --git a/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs b/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs index 27f6e1a5..07541d3f 100644 --- a/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs +++ b/src/Merge.Client/Ticketing/AvailableActions/AvailableActionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class AvailableActionsClient @@ -24,21 +22,23 @@ internal AvailableActionsClient(RawClient client) /// await client.Ticketing.AvailableActions.RetrieveAsync(); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/available-actions", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/available-actions", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs b/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs index d17e8928..c4ce3942 100644 --- a/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs +++ b/src/Merge.Client/Ticketing/Collections/CollectionsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class CollectionsClient @@ -24,7 +22,7 @@ internal CollectionsClient(RawClient client) /// await client.Ticketing.Collections.ListAsync(new CollectionsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CollectionsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,7 +77,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.ParentCollectionId != null) { @@ -97,17 +95,19 @@ public async Task ListAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/collections", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/collections", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -136,7 +136,7 @@ public async Task ListAsync( /// await client.Ticketing.Collections.RetrieveAsync("id", new CollectionsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CollectionsRetrieveRequest request, RequestOptions? options = null, @@ -150,7 +150,7 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.RemoteFields != null) { @@ -160,17 +160,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/collections/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/collections/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Collections/Requests/CollectionsListRequest.cs b/src/Merge.Client/Ticketing/Collections/Requests/CollectionsListRequest.cs index 7abb7aae..dc851568 100644 --- a/src/Merge.Client/Ticketing/Collections/Requests/CollectionsListRequest.cs +++ b/src/Merge.Client/Ticketing/Collections/Requests/CollectionsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CollectionsListRequest diff --git a/src/Merge.Client/Ticketing/Collections/Requests/CollectionsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Collections/Requests/CollectionsRetrieveRequest.cs index fa4e9c98..4320898a 100644 --- a/src/Merge.Client/Ticketing/Collections/Requests/CollectionsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Collections/Requests/CollectionsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CollectionsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Collections/Types/CollectionsListRequestExpand.cs b/src/Merge.Client/Ticketing/Collections/Types/CollectionsListRequestExpand.cs index 18f419d3..b3543755 100644 --- a/src/Merge.Client/Ticketing/Collections/Types/CollectionsListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Collections/Types/CollectionsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CollectionsListRequestExpand { [EnumMember(Value = "parent_collection")] diff --git a/src/Merge.Client/Ticketing/Collections/Types/CollectionsRetrieveRequestExpand.cs b/src/Merge.Client/Ticketing/Collections/Types/CollectionsRetrieveRequestExpand.cs index 3543ff6d..d46d0f91 100644 --- a/src/Merge.Client/Ticketing/Collections/Types/CollectionsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Collections/Types/CollectionsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CollectionsRetrieveRequestExpand { [EnumMember(Value = "parent_collection")] diff --git a/src/Merge.Client/Ticketing/Comments/CommentsClient.cs b/src/Merge.Client/Ticketing/Comments/CommentsClient.cs index 621ab13e..89284858 100644 --- a/src/Merge.Client/Ticketing/Comments/CommentsClient.cs +++ b/src/Merge.Client/Ticketing/Comments/CommentsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class CommentsClient @@ -24,7 +22,7 @@ internal CommentsClient(RawClient client) /// await client.Ticketing.Comments.ListAsync(new CommentsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( CommentsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,7 +73,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteCreatedAfter != null) { @@ -91,17 +89,19 @@ public async Task ListAsync( { _query["ticket_id"] = request.TicketId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/comments", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/comments", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -132,7 +132,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( CommentEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -141,25 +141,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/comments", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/comments", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -188,7 +191,7 @@ public async Task CreateAsync( /// await client.Ticketing.Comments.RetrieveAsync("id", new CommentsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, CommentsRetrieveRequest request, RequestOptions? options = null, @@ -202,19 +205,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/comments/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/comments/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -243,21 +248,23 @@ public async Task RetrieveAsync( /// await client.Ticketing.Comments.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/comments/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/comments/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Comments/Requests/CommentEndpointRequest.cs b/src/Merge.Client/Ticketing/Comments/Requests/CommentEndpointRequest.cs index b9a56152..199719c5 100644 --- a/src/Merge.Client/Ticketing/Comments/Requests/CommentEndpointRequest.cs +++ b/src/Merge.Client/Ticketing/Comments/Requests/CommentEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommentEndpointRequest diff --git a/src/Merge.Client/Ticketing/Comments/Requests/CommentsListRequest.cs b/src/Merge.Client/Ticketing/Comments/Requests/CommentsListRequest.cs index 1422bb24..61f0f14e 100644 --- a/src/Merge.Client/Ticketing/Comments/Requests/CommentsListRequest.cs +++ b/src/Merge.Client/Ticketing/Comments/Requests/CommentsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommentsListRequest diff --git a/src/Merge.Client/Ticketing/Comments/Requests/CommentsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Comments/Requests/CommentsRetrieveRequest.cs index c948903c..db9e8f7e 100644 --- a/src/Merge.Client/Ticketing/Comments/Requests/CommentsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Comments/Requests/CommentsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommentsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Comments/Types/CommentsListRequestExpand.cs b/src/Merge.Client/Ticketing/Comments/Types/CommentsListRequestExpand.cs index 9166376e..05df7074 100644 --- a/src/Merge.Client/Ticketing/Comments/Types/CommentsListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Comments/Types/CommentsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CommentsListRequestExpand { [EnumMember(Value = "contact")] diff --git a/src/Merge.Client/Ticketing/Comments/Types/CommentsRetrieveRequestExpand.cs b/src/Merge.Client/Ticketing/Comments/Types/CommentsRetrieveRequestExpand.cs index 1da02a90..b9bf0bc2 100644 --- a/src/Merge.Client/Ticketing/Comments/Types/CommentsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Comments/Types/CommentsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CommentsRetrieveRequestExpand { [EnumMember(Value = "contact")] diff --git a/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs b/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs index e1f07caa..6be67e1d 100644 --- a/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs +++ b/src/Merge.Client/Ticketing/Contacts/ContactsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class ContactsClient @@ -24,7 +22,7 @@ internal ContactsClient(RawClient client) /// await client.Ticketing.Contacts.ListAsync(new ContactsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ContactsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -51,15 +49,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -75,23 +73,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/contacts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/contacts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -122,7 +122,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TicketingContactEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -131,25 +131,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/contacts", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/contacts", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -178,7 +181,7 @@ public async Task CreateAsync( /// await client.Ticketing.Contacts.RetrieveAsync("id", new ContactsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ContactsRetrieveRequest request, RequestOptions? options = null, @@ -192,19 +195,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/contacts/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/contacts/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -233,21 +238,23 @@ public async Task RetrieveAsync( /// await client.Ticketing.Contacts.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/contacts/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/contacts/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Contacts/Requests/ContactsListRequest.cs b/src/Merge.Client/Ticketing/Contacts/Requests/ContactsListRequest.cs index 3608218a..a0568246 100644 --- a/src/Merge.Client/Ticketing/Contacts/Requests/ContactsListRequest.cs +++ b/src/Merge.Client/Ticketing/Contacts/Requests/ContactsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ContactsListRequest diff --git a/src/Merge.Client/Ticketing/Contacts/Requests/ContactsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Contacts/Requests/ContactsRetrieveRequest.cs index 4167efe6..0bb9dd43 100644 --- a/src/Merge.Client/Ticketing/Contacts/Requests/ContactsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Contacts/Requests/ContactsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ContactsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Contacts/Requests/TicketingContactEndpointRequest.cs b/src/Merge.Client/Ticketing/Contacts/Requests/TicketingContactEndpointRequest.cs index 5cd07a77..cc422829 100644 --- a/src/Merge.Client/Ticketing/Contacts/Requests/TicketingContactEndpointRequest.cs +++ b/src/Merge.Client/Ticketing/Contacts/Requests/TicketingContactEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketingContactEndpointRequest diff --git a/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs b/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs index ad4ceeaf..e16ccd70 100644 --- a/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs +++ b/src/Merge.Client/Ticketing/DeleteAccount/DeleteAccountClient.cs @@ -2,8 +2,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class DeleteAccountClient @@ -28,16 +26,18 @@ public async System.Threading.Tasks.Task DeleteAsync( CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/delete-account", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/delete-account", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); if (response.StatusCode is >= 200 and < 400) { return; diff --git a/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs b/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs index 6003aade..4e524e64 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/FieldMappingClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class FieldMappingClient @@ -24,7 +22,7 @@ internal FieldMappingClient(RawClient client) /// await client.Ticketing.FieldMapping.FieldMappingsRetrieveAsync(new FieldMappingsRetrieveRequest()); /// /// - public async Task FieldMappingsRetrieveAsync( + public async System.Threading.Tasks.Task FieldMappingsRetrieveAsync( FieldMappingsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -33,19 +31,23 @@ public async Task FieldMappingsRetrieveAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/field-mappings", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/field-mappings", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -76,7 +78,7 @@ public async Task FieldMappingsRetrieveAsync( /// { /// TargetFieldName = "example_target_field_name", /// TargetFieldDescription = "this is a example description of the target field", - /// RemoteFieldTraversalPath = new List() { "example_remote_field" }, + /// RemoteFieldTraversalPath = new List<object>() { "example_remote_field" }, /// RemoteMethod = "GET", /// RemoteUrlPath = "/example-url-path", /// CommonModelName = "ExampleCommonModel", @@ -84,7 +86,7 @@ public async Task FieldMappingsRetrieveAsync( /// ); /// /// - public async Task FieldMappingsCreateAsync( + public async System.Threading.Tasks.Task FieldMappingsCreateAsync( CreateFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -93,7 +95,9 @@ public async Task FieldMappingsCreateAsync( var _query = new Dictionary(); if (request.ExcludeRemoteFieldMetadata != null) { - _query["exclude_remote_field_metadata"] = request.ExcludeRemoteFieldMetadata.ToString(); + _query["exclude_remote_field_metadata"] = JsonUtils.Serialize( + request.ExcludeRemoteFieldMetadata.Value + ); } var requestBody = new Dictionary() { @@ -104,18 +108,21 @@ public async Task FieldMappingsCreateAsync( { "remote_url_path", request.RemoteUrlPath }, { "common_model_name", request.CommonModelName }, }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/field-mappings", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/field-mappings", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -144,22 +151,24 @@ public async Task FieldMappingsCreateAsync( /// await client.Ticketing.FieldMapping.FieldMappingsDestroyAsync("field_mapping_id"); /// /// - public async Task FieldMappingsDestroyAsync( + public async System.Threading.Tasks.Task FieldMappingsDestroyAsync( string fieldMappingId, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Delete, - Path = $"ticketing/v1/field-mappings/{fieldMappingId}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Delete, + Path = $"ticketing/v1/field-mappings/{fieldMappingId}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -191,24 +200,27 @@ public async Task FieldMappingsDestroyAsync( /// ); /// /// - public async Task FieldMappingsPartialUpdateAsync( + public async System.Threading.Tasks.Task FieldMappingsPartialUpdateAsync( string fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"ticketing/v1/field-mappings/{fieldMappingId}", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"ticketing/v1/field-mappings/{fieldMappingId}", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -237,7 +249,7 @@ public async Task FieldMappingsPartialUpdateAsync( /// await client.Ticketing.FieldMapping.RemoteFieldsRetrieveAsync(new RemoteFieldsRetrieveRequest()); /// /// - public async Task RemoteFieldsRetrieveAsync( + public async System.Threading.Tasks.Task RemoteFieldsRetrieveAsync( RemoteFieldsRetrieveRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -252,17 +264,19 @@ public async Task RemoteFieldsRetrieveAsync( { _query["include_example_values"] = request.IncludeExampleValues; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/remote-fields", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/remote-fields", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -291,21 +305,23 @@ public async Task RemoteFieldsRetrieveAsync( /// await client.Ticketing.FieldMapping.TargetFieldsRetrieveAsync(); /// /// - public async Task TargetFieldsRetrieveAsync( + public async System.Threading.Tasks.Task TargetFieldsRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/target-fields", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/target-fields", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/FieldMapping/Requests/CreateFieldMappingRequest.cs b/src/Merge.Client/Ticketing/FieldMapping/Requests/CreateFieldMappingRequest.cs index eb7c25d8..4c38fe49 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/Requests/CreateFieldMappingRequest.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/Requests/CreateFieldMappingRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CreateFieldMappingRequest diff --git a/src/Merge.Client/Ticketing/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs b/src/Merge.Client/Ticketing/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs index 1e65cc9d..0d3d45c1 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/Requests/FieldMappingsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs b/src/Merge.Client/Ticketing/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs index 51db739f..52568528 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/Requests/PatchedEditFieldMappingRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PatchedEditFieldMappingRequest diff --git a/src/Merge.Client/Ticketing/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs b/src/Merge.Client/Ticketing/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs index 2462d3a2..e2156449 100644 --- a/src/Merge.Client/Ticketing/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/FieldMapping/Requests/RemoteFieldsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs b/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs index 60505b5f..c3347761 100644 --- a/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs +++ b/src/Merge.Client/Ticketing/ForceResync/ForceResyncClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class ForceResyncClient @@ -24,21 +22,23 @@ internal ForceResyncClient(RawClient client) /// await client.Ticketing.ForceResync.SyncStatusResyncCreateAsync(); /// /// - public async Task> SyncStatusResyncCreateAsync( + public async System.Threading.Tasks.Task> SyncStatusResyncCreateAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/sync-status/resync", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/sync-status/resync", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs b/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs index b7572564..489f7cbf 100644 --- a/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs +++ b/src/Merge.Client/Ticketing/GenerateKey/GenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class GenerateKeyClient @@ -26,23 +24,26 @@ internal GenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( GenerateRemoteKeyRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/generate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/generate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/GenerateKey/Requests/GenerateRemoteKeyRequest.cs b/src/Merge.Client/Ticketing/GenerateKey/Requests/GenerateRemoteKeyRequest.cs index e21394f6..c6fbd12e 100644 --- a/src/Merge.Client/Ticketing/GenerateKey/Requests/GenerateRemoteKeyRequest.cs +++ b/src/Merge.Client/Ticketing/GenerateKey/Requests/GenerateRemoteKeyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record GenerateRemoteKeyRequest diff --git a/src/Merge.Client/Ticketing/Issues/IssuesClient.cs b/src/Merge.Client/Ticketing/Issues/IssuesClient.cs index c90c172b..e6198c1d 100644 --- a/src/Merge.Client/Ticketing/Issues/IssuesClient.cs +++ b/src/Merge.Client/Ticketing/Issues/IssuesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class IssuesClient @@ -24,7 +22,7 @@ internal IssuesClient(RawClient client) /// await client.Ticketing.Issues.ListAsync(new IssuesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( IssuesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -85,7 +83,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.StartDate != null) { @@ -95,17 +93,19 @@ public async Task ListAsync( { _query["status"] = request.Status.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/issues", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/issues", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -134,22 +134,24 @@ public async Task ListAsync( /// await client.Ticketing.Issues.RetrieveAsync("id"); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/issues/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/issues/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Issues/Requests/IssuesListRequest.cs b/src/Merge.Client/Ticketing/Issues/Requests/IssuesListRequest.cs index 8fbe60d4..888efae4 100644 --- a/src/Merge.Client/Ticketing/Issues/Requests/IssuesListRequest.cs +++ b/src/Merge.Client/Ticketing/Issues/Requests/IssuesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record IssuesListRequest diff --git a/src/Merge.Client/Ticketing/Issues/Types/IssuesListRequestStatus.cs b/src/Merge.Client/Ticketing/Issues/Types/IssuesListRequestStatus.cs index 5cf4ccc2..fda08391 100644 --- a/src/Merge.Client/Ticketing/Issues/Types/IssuesListRequestStatus.cs +++ b/src/Merge.Client/Ticketing/Issues/Types/IssuesListRequestStatus.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssuesListRequestStatus { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs b/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs index d7091687..e255efbf 100644 --- a/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs +++ b/src/Merge.Client/Ticketing/LinkToken/LinkTokenClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class LinkTokenClient @@ -27,7 +25,7 @@ internal LinkTokenClient(RawClient client) /// EndUserEmailAddress = "example@gmail.com", /// EndUserOrganizationName = "Test Organization", /// EndUserOriginId = "12345", - /// Categories = new List() + /// Categories = new List<Merge.Client.Ticketing.CategoriesEnum>() /// { /// Merge.Client.Ticketing.CategoriesEnum.Hris, /// Merge.Client.Ticketing.CategoriesEnum.Ats, @@ -36,23 +34,26 @@ internal LinkTokenClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( EndUserDetailsRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/link-token", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/link-token", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/LinkToken/Requests/EndUserDetailsRequest.cs b/src/Merge.Client/Ticketing/LinkToken/Requests/EndUserDetailsRequest.cs index 0d3c2b57..827c3a5c 100644 --- a/src/Merge.Client/Ticketing/LinkToken/Requests/EndUserDetailsRequest.cs +++ b/src/Merge.Client/Ticketing/LinkToken/Requests/EndUserDetailsRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record EndUserDetailsRequest diff --git a/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs b/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs index d2caebe6..a9cc0693 100644 --- a/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs +++ b/src/Merge.Client/Ticketing/LinkedAccounts/LinkedAccountsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class LinkedAccountsClient @@ -24,7 +22,7 @@ internal LinkedAccountsClient(RawClient client) /// await client.Ticketing.LinkedAccounts.ListAsync(new LinkedAccountsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( LinkedAccountsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -65,7 +63,7 @@ public async Task ListAsync( } if (request.IncludeDuplicates != null) { - _query["include_duplicates"] = request.IncludeDuplicates.ToString(); + _query["include_duplicates"] = JsonUtils.Serialize(request.IncludeDuplicates.Value); } if (request.IntegrationName != null) { @@ -77,23 +75,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.Status != null) { _query["status"] = request.Status; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/linked-accounts", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/linked-accounts", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/LinkedAccounts/Requests/LinkedAccountsListRequest.cs b/src/Merge.Client/Ticketing/LinkedAccounts/Requests/LinkedAccountsListRequest.cs index ad392ae3..e8956b06 100644 --- a/src/Merge.Client/Ticketing/LinkedAccounts/Requests/LinkedAccountsListRequest.cs +++ b/src/Merge.Client/Ticketing/LinkedAccounts/Requests/LinkedAccountsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record LinkedAccountsListRequest diff --git a/src/Merge.Client/Ticketing/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs b/src/Merge.Client/Ticketing/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs index f1d72712..9a6973a6 100644 --- a/src/Merge.Client/Ticketing/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs +++ b/src/Merge.Client/Ticketing/LinkedAccounts/Types/LinkedAccountsListRequestCategory.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LinkedAccountsListRequestCategory { [EnumMember(Value = "accounting")] diff --git a/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs b/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs index 6102777e..1089435b 100644 --- a/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs +++ b/src/Merge.Client/Ticketing/Passthrough/PassthroughClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class PassthroughClient @@ -30,23 +28,26 @@ internal PassthroughClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( DataPassthroughRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/passthrough", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/passthrough", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs b/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs index ee841eff..62604365 100644 --- a/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs +++ b/src/Merge.Client/Ticketing/Projects/ProjectsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class ProjectsClient @@ -24,7 +22,7 @@ internal ProjectsClient(RawClient client) /// await client.Ticketing.Projects.ListAsync(new ProjectsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( ProjectsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/projects", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/projects", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ticketing.Projects.RetrieveAsync("id", new ProjectsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, ProjectsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/projects/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/projects/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -167,7 +169,7 @@ public async Task RetrieveAsync( /// await client.Ticketing.Projects.UsersListAsync("parent_id", new ProjectsUsersListRequest()); /// /// - public async Task UsersListAsync( + public async System.Threading.Tasks.Task UsersListAsync( string parentId, ProjectsUsersListRequest request, RequestOptions? options = null, @@ -185,31 +187,33 @@ public async Task UsersListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/projects/{parentId}/users", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/projects/{parentId}/users", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsListRequest.cs b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsListRequest.cs index c4f04b4e..b53f76ae 100644 --- a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsListRequest.cs +++ b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ProjectsListRequest diff --git a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsRetrieveRequest.cs index b4abf993..71def03b 100644 --- a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ProjectsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsUsersListRequest.cs b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsUsersListRequest.cs index fd2efeb2..9f62c96b 100644 --- a/src/Merge.Client/Ticketing/Projects/Requests/ProjectsUsersListRequest.cs +++ b/src/Merge.Client/Ticketing/Projects/Requests/ProjectsUsersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ProjectsUsersListRequest diff --git a/src/Merge.Client/Ticketing/Projects/Types/ProjectsUsersListRequestExpand.cs b/src/Merge.Client/Ticketing/Projects/Types/ProjectsUsersListRequestExpand.cs index 15de3eac..88ede39f 100644 --- a/src/Merge.Client/Ticketing/Projects/Types/ProjectsUsersListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Projects/Types/ProjectsUsersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ProjectsUsersListRequestExpand { [EnumMember(Value = "roles")] diff --git a/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs b/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs index 535c64ff..f33bec51 100644 --- a/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs +++ b/src/Merge.Client/Ticketing/RegenerateKey/RegenerateKeyClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class RegenerateKeyClient @@ -26,23 +24,26 @@ internal RegenerateKeyClient(RawClient client) /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( RemoteKeyForRegenerationRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/regenerate-key", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/regenerate-key", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs b/src/Merge.Client/Ticketing/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs index bb3cdd07..3a627da6 100644 --- a/src/Merge.Client/Ticketing/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs +++ b/src/Merge.Client/Ticketing/RegenerateKey/Requests/RemoteKeyForRegenerationRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteKeyForRegenerationRequest diff --git a/src/Merge.Client/Ticketing/Roles/Requests/RolesListRequest.cs b/src/Merge.Client/Ticketing/Roles/Requests/RolesListRequest.cs index 5416a255..0563d216 100644 --- a/src/Merge.Client/Ticketing/Roles/Requests/RolesListRequest.cs +++ b/src/Merge.Client/Ticketing/Roles/Requests/RolesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RolesListRequest diff --git a/src/Merge.Client/Ticketing/Roles/Requests/RolesRetrieveRequest.cs b/src/Merge.Client/Ticketing/Roles/Requests/RolesRetrieveRequest.cs index 6d071d0c..e21add99 100644 --- a/src/Merge.Client/Ticketing/Roles/Requests/RolesRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Roles/Requests/RolesRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RolesRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Roles/RolesClient.cs b/src/Merge.Client/Ticketing/Roles/RolesClient.cs index b3cefa8c..376d6750 100644 --- a/src/Merge.Client/Ticketing/Roles/RolesClient.cs +++ b/src/Merge.Client/Ticketing/Roles/RolesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class RolesClient @@ -24,7 +22,7 @@ internal RolesClient(RawClient client) /// await client.Ticketing.Roles.ListAsync(new RolesListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( RolesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/roles", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/roles", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ticketing.Roles.RetrieveAsync("id", new RolesRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, RolesRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/roles/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/roles/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Ticketing/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs index c762870b..bcd1f321 100644 --- a/src/Merge.Client/Ticketing/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Ticketing/Scopes/Requests/LinkedAccountCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record LinkedAccountCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs b/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs index 07f68b65..9f6a3bd6 100644 --- a/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs +++ b/src/Merge.Client/Ticketing/Scopes/ScopesClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class ScopesClient @@ -24,21 +22,23 @@ internal ScopesClient(RawClient client) /// await client.Ticketing.Scopes.DefaultScopesRetrieveAsync(); /// /// - public async Task DefaultScopesRetrieveAsync( + public async System.Threading.Tasks.Task DefaultScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/default-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/default-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -67,21 +67,23 @@ public async Task DefaultScopesRetrieveAsync( /// await client.Ticketing.Scopes.LinkedAccountScopesRetrieveAsync(); /// /// - public async Task LinkedAccountScopesRetrieveAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/linked-account-scopes", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/linked-account-scopes", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -111,15 +113,15 @@ public async Task LinkedAccountScopesRetrieveAsync( /// new LinkedAccountCommonModelScopeDeserializerRequest /// { /// CommonModels = - /// new List() + /// new List<Merge.Client.Ticketing.IndividualCommonModelScopeDeserializerRequest>() /// { /// new Merge.Client.Ticketing.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Employee", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Ticketing.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "READ", @@ -138,17 +140,17 @@ public async Task LinkedAccountScopesRetrieveAsync( /// }, /// FieldPermissions = new Merge.Client.Ticketing.FieldPermissionDeserializerRequest /// { - /// EnabledFields = new List() { "avatar", "home_location" }, - /// DisabledFields = new List() { "work_location" }, + /// EnabledFields = new List<object>() { "avatar", "home_location" }, + /// DisabledFields = new List<object>() { "work_location" }, /// }, /// }, /// new Merge.Client.Ticketing.IndividualCommonModelScopeDeserializerRequest /// { /// ModelName = "Benefit", - /// ModelPermissions = new Dictionary< + /// ModelPermissions = new Dictionary< /// string, /// Merge.Client.Ticketing.ModelPermissionDeserializerRequest - /// >() + /// >() /// { /// { /// "WRITE", @@ -164,23 +166,26 @@ public async Task LinkedAccountScopesRetrieveAsync( /// ); /// /// - public async Task LinkedAccountScopesCreateAsync( + public async System.Threading.Tasks.Task LinkedAccountScopesCreateAsync( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/linked-account-scopes", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/linked-account-scopes", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/SyncStatus/Requests/SyncStatusListRequest.cs b/src/Merge.Client/Ticketing/SyncStatus/Requests/SyncStatusListRequest.cs index 1d4cf3bf..ce28a09c 100644 --- a/src/Merge.Client/Ticketing/SyncStatus/Requests/SyncStatusListRequest.cs +++ b/src/Merge.Client/Ticketing/SyncStatus/Requests/SyncStatusListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record SyncStatusListRequest diff --git a/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs b/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs index 320c573b..c83f282e 100644 --- a/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs +++ b/src/Merge.Client/Ticketing/SyncStatus/SyncStatusClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class SyncStatusClient @@ -24,7 +22,7 @@ internal SyncStatusClient(RawClient client) /// await client.Ticketing.SyncStatus.ListAsync(new SyncStatusListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( SyncStatusListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -37,19 +35,21 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/sync-status", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/sync-status", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Tags/Requests/TagsListRequest.cs b/src/Merge.Client/Ticketing/Tags/Requests/TagsListRequest.cs index 0b1101c4..8ab17947 100644 --- a/src/Merge.Client/Ticketing/Tags/Requests/TagsListRequest.cs +++ b/src/Merge.Client/Ticketing/Tags/Requests/TagsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TagsListRequest diff --git a/src/Merge.Client/Ticketing/Tags/Requests/TagsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Tags/Requests/TagsRetrieveRequest.cs index 67430c65..d6d556b7 100644 --- a/src/Merge.Client/Ticketing/Tags/Requests/TagsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Tags/Requests/TagsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TagsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Tags/TagsClient.cs b/src/Merge.Client/Ticketing/Tags/TagsClient.cs index 0cfc5038..d38267b5 100644 --- a/src/Merge.Client/Ticketing/Tags/TagsClient.cs +++ b/src/Merge.Client/Ticketing/Tags/TagsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class TagsClient @@ -24,7 +22,7 @@ internal TagsClient(RawClient client) /// await client.Ticketing.Tags.ListAsync(new TagsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TagsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/tags", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/tags", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ticketing.Tags.RetrieveAsync("id", new TagsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TagsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/tags/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/tags/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Teams/Requests/TeamsListRequest.cs b/src/Merge.Client/Ticketing/Teams/Requests/TeamsListRequest.cs index c2482ae9..c1e75c65 100644 --- a/src/Merge.Client/Ticketing/Teams/Requests/TeamsListRequest.cs +++ b/src/Merge.Client/Ticketing/Teams/Requests/TeamsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TeamsListRequest diff --git a/src/Merge.Client/Ticketing/Teams/Requests/TeamsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Teams/Requests/TeamsRetrieveRequest.cs index 448fd669..c1b169a0 100644 --- a/src/Merge.Client/Ticketing/Teams/Requests/TeamsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Teams/Requests/TeamsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TeamsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Teams/TeamsClient.cs b/src/Merge.Client/Ticketing/Teams/TeamsClient.cs index cf0d1053..77500893 100644 --- a/src/Merge.Client/Ticketing/Teams/TeamsClient.cs +++ b/src/Merge.Client/Ticketing/Teams/TeamsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class TeamsClient @@ -24,7 +22,7 @@ internal TeamsClient(RawClient client) /// await client.Ticketing.Teams.ListAsync(new TeamsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TeamsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -47,15 +45,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -71,23 +69,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/teams", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/teams", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -116,7 +116,7 @@ public async Task ListAsync( /// await client.Ticketing.Teams.RetrieveAsync("id", new TeamsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TeamsRetrieveRequest request, RequestOptions? options = null, @@ -126,19 +126,21 @@ public async Task RetrieveAsync( var _query = new Dictionary(); if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/teams/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/teams/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/TicketingClient.cs b/src/Merge.Client/Ticketing/TicketingClient.cs index 6be42acd..41f3d78b 100644 --- a/src/Merge.Client/Ticketing/TicketingClient.cs +++ b/src/Merge.Client/Ticketing/TicketingClient.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class TicketingClient diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/PatchedTicketEndpointRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/PatchedTicketEndpointRequest.cs index e8146e5f..a879ac2e 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/PatchedTicketEndpointRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/PatchedTicketEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PatchedTicketEndpointRequest diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/TicketEndpointRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/TicketEndpointRequest.cs index af153eca..8b165a85 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/TicketEndpointRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/TicketEndpointRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketEndpointRequest diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsListRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsListRequest.cs index 3215b784..7c89eacd 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsListRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketsListRequest diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRemoteFieldClassesListRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRemoteFieldClassesListRequest.cs index 81315f05..5e153419 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRemoteFieldClassesListRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRemoteFieldClassesListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketsRemoteFieldClassesListRequest diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRetrieveRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRetrieveRequest.cs index 7644afff..3fc409a1 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketsRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsViewersListRequest.cs b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsViewersListRequest.cs index 81315244..7d4a147a 100644 --- a/src/Merge.Client/Ticketing/Tickets/Requests/TicketsViewersListRequest.cs +++ b/src/Merge.Client/Ticketing/Tickets/Requests/TicketsViewersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketsViewersListRequest diff --git a/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs b/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs index b271584f..dd18a23f 100644 --- a/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs +++ b/src/Merge.Client/Ticketing/Tickets/TicketsClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class TicketsClient @@ -24,7 +22,7 @@ internal TicketsClient(RawClient client) /// await client.Ticketing.Tickets.ListAsync(new TicketsListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( TicketsListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -87,19 +85,21 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -115,7 +115,7 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.ParentTicketId != null) { @@ -177,17 +177,19 @@ public async Task ListAsync( { _query["ticket_url"] = request.TicketUrl; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/tickets", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/tickets", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -218,7 +220,7 @@ public async Task ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( TicketEndpointRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -227,25 +229,28 @@ public async Task CreateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/tickets", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/tickets", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -274,7 +279,7 @@ public async Task CreateAsync( /// await client.Ticketing.Tickets.RetrieveAsync("id", new TicketsRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, TicketsRetrieveRequest request, RequestOptions? options = null, @@ -288,11 +293,13 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeRemoteFields != null) { - _query["include_remote_fields"] = request.IncludeRemoteFields.ToString(); + _query["include_remote_fields"] = JsonUtils.Serialize( + request.IncludeRemoteFields.Value + ); } if (request.RemoteFields != null) { @@ -302,17 +309,19 @@ public async Task RetrieveAsync( { _query["show_enum_origins"] = request.ShowEnumOrigins.Value.Stringify(); } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/tickets/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/tickets/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -344,7 +353,7 @@ public async Task RetrieveAsync( /// ); /// /// - public async Task PartialUpdateAsync( + public async System.Threading.Tasks.Task PartialUpdateAsync( string id, PatchedTicketEndpointRequest request, RequestOptions? options = null, @@ -354,25 +363,28 @@ public async Task PartialUpdateAsync( var _query = new Dictionary(); if (request.IsDebugMode != null) { - _query["is_debug_mode"] = request.IsDebugMode.ToString(); + _query["is_debug_mode"] = JsonUtils.Serialize(request.IsDebugMode.Value); } if (request.RunAsync != null) { - _query["run_async"] = request.RunAsync.ToString(); + _query["run_async"] = JsonUtils.Serialize(request.RunAsync.Value); } var requestBody = new Dictionary() { { "model", request.Model } }; - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethodExtensions.Patch, - Path = $"ticketing/v1/tickets/{id}", - Body = requestBody, - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = $"ticketing/v1/tickets/{id}", + Body = requestBody, + Query = _query, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -401,7 +413,7 @@ public async Task PartialUpdateAsync( /// await client.Ticketing.Tickets.ViewersListAsync("ticket_id", new TicketsViewersListRequest()); /// /// - public async Task ViewersListAsync( + public async System.Threading.Tasks.Task ViewersListAsync( string ticketId, TicketsViewersListRequest request, RequestOptions? options = null, @@ -419,31 +431,33 @@ public async Task ViewersListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/tickets/{ticketId}/viewers", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/tickets/{ticketId}/viewers", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -472,22 +486,24 @@ public async Task ViewersListAsync( /// await client.Ticketing.Tickets.MetaPatchRetrieveAsync("id"); /// /// - public async Task MetaPatchRetrieveAsync( + public async System.Threading.Tasks.Task MetaPatchRetrieveAsync( string id, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/tickets/meta/patch/{id}", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/tickets/meta/patch/{id}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -516,21 +532,23 @@ public async Task MetaPatchRetrieveAsync( /// await client.Ticketing.Tickets.MetaPostRetrieveAsync(); /// /// - public async Task MetaPostRetrieveAsync( + public async System.Threading.Tasks.Task MetaPostRetrieveAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/tickets/meta/post", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/tickets/meta/post", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -561,7 +579,7 @@ public async Task MetaPostRetrieveAsync( /// ); /// /// - public async Task RemoteFieldClassesListAsync( + public async System.Threading.Tasks.Task RemoteFieldClassesListAsync( TicketsRemoteFieldClassesListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -574,35 +592,37 @@ public async Task RemoteFieldClassesListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.IsCommonModelField != null) { - _query["is_common_model_field"] = request.IsCommonModelField.ToString(); + _query["is_common_model_field"] = JsonUtils.Serialize(request.IsCommonModelField.Value); } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/tickets/remote-field-classes", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["page_size"] = request.PageSize.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/tickets/remote-field-classes", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestExpand.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestExpand.cs index 129a74eb..a012f255 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsListRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestPriority.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestPriority.cs index 4c455cbf..6b097144 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestPriority.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestPriority.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsListRequestPriority { [EnumMember(Value = "HIGH")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestRemoteFields.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestRemoteFields.cs index 31c011be..edca6288 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestRemoteFields.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsListRequestRemoteFields { [EnumMember(Value = "priority")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestShowEnumOrigins.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestShowEnumOrigins.cs index 0c925514..dc1d79ad 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsListRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsListRequestShowEnumOrigins { [EnumMember(Value = "priority")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestExpand.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestExpand.cs index ab629026..f12f496c 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsRetrieveRequestExpand { [EnumMember(Value = "account")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestRemoteFields.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestRemoteFields.cs index bdf240da..c039b557 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestRemoteFields.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestRemoteFields.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsRetrieveRequestRemoteFields { [EnumMember(Value = "priority")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestShowEnumOrigins.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestShowEnumOrigins.cs index c0d7dbf2..83e3540d 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestShowEnumOrigins.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsRetrieveRequestShowEnumOrigins.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsRetrieveRequestShowEnumOrigins { [EnumMember(Value = "priority")] diff --git a/src/Merge.Client/Ticketing/Tickets/Types/TicketsViewersListRequestExpand.cs b/src/Merge.Client/Ticketing/Tickets/Types/TicketsViewersListRequestExpand.cs index 573ae69e..8709c949 100644 --- a/src/Merge.Client/Ticketing/Tickets/Types/TicketsViewersListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Tickets/Types/TicketsViewersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketsViewersListRequestExpand { [EnumMember(Value = "team")] diff --git a/src/Merge.Client/Ticketing/Types/AccessLevelEnum.cs b/src/Merge.Client/Ticketing/Types/AccessLevelEnum.cs index 42eb4d81..af3e3376 100644 --- a/src/Merge.Client/Ticketing/Types/AccessLevelEnum.cs +++ b/src/Merge.Client/Ticketing/Types/AccessLevelEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccessLevelEnum { [EnumMember(Value = "PRIVATE")] diff --git a/src/Merge.Client/Ticketing/Types/Account.cs b/src/Merge.Client/Ticketing/Types/Account.cs index a2d5118b..5f281890 100644 --- a/src/Merge.Client/Ticketing/Types/Account.cs +++ b/src/Merge.Client/Ticketing/Types/Account.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Account diff --git a/src/Merge.Client/Ticketing/Types/AccountDetails.cs b/src/Merge.Client/Ticketing/Types/AccountDetails.cs index 1bbbc07b..ea4dc065 100644 --- a/src/Merge.Client/Ticketing/Types/AccountDetails.cs +++ b/src/Merge.Client/Ticketing/Types/AccountDetails.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountDetails diff --git a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActions.cs b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActions.cs index 862e0627..3fed7fb9 100644 --- a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActions.cs +++ b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountDetailsAndActions diff --git a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsIntegration.cs b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsIntegration.cs index 44e6a31b..b8d02baa 100644 --- a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsIntegration.cs +++ b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountDetailsAndActionsIntegration diff --git a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsStatusEnum.cs b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsStatusEnum.cs index ed3fdbed..eb706e42 100644 --- a/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsStatusEnum.cs +++ b/src/Merge.Client/Ticketing/Types/AccountDetailsAndActionsStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum AccountDetailsAndActionsStatusEnum { [EnumMember(Value = "COMPLETE")] diff --git a/src/Merge.Client/Ticketing/Types/AccountIntegration.cs b/src/Merge.Client/Ticketing/Types/AccountIntegration.cs index 0cda3136..bf6de787 100644 --- a/src/Merge.Client/Ticketing/Types/AccountIntegration.cs +++ b/src/Merge.Client/Ticketing/Types/AccountIntegration.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountIntegration @@ -14,7 +12,7 @@ public record AccountIntegration public required string Name { get; set; } /// - /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + /// Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> ///
[JsonPropertyName("abbreviated_name")] public string? AbbreviatedName { get; set; } @@ -38,7 +36,7 @@ public record AccountIntegration public string? SquareImage { get; set; } /// - /// The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + /// The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> /// [JsonPropertyName("color")] public string? Color { get; set; } diff --git a/src/Merge.Client/Ticketing/Types/AccountToken.cs b/src/Merge.Client/Ticketing/Types/AccountToken.cs index 9d4cb9f5..c092d6a4 100644 --- a/src/Merge.Client/Ticketing/Types/AccountToken.cs +++ b/src/Merge.Client/Ticketing/Types/AccountToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AccountToken diff --git a/src/Merge.Client/Ticketing/Types/AdvancedMetadata.cs b/src/Merge.Client/Ticketing/Types/AdvancedMetadata.cs index e5c9fd90..7d78c55c 100644 --- a/src/Merge.Client/Ticketing/Types/AdvancedMetadata.cs +++ b/src/Merge.Client/Ticketing/Types/AdvancedMetadata.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AdvancedMetadata diff --git a/src/Merge.Client/Ticketing/Types/AsyncPassthroughReciept.cs b/src/Merge.Client/Ticketing/Types/AsyncPassthroughReciept.cs index 7bc47872..fa3fdbf2 100644 --- a/src/Merge.Client/Ticketing/Types/AsyncPassthroughReciept.cs +++ b/src/Merge.Client/Ticketing/Types/AsyncPassthroughReciept.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AsyncPassthroughReciept diff --git a/src/Merge.Client/Ticketing/Types/Attachment.cs b/src/Merge.Client/Ticketing/Types/Attachment.cs index 264c4925..823adec7 100644 --- a/src/Merge.Client/Ticketing/Types/Attachment.cs +++ b/src/Merge.Client/Ticketing/Types/Attachment.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Attachment diff --git a/src/Merge.Client/Ticketing/Types/AttachmentRequest.cs b/src/Merge.Client/Ticketing/Types/AttachmentRequest.cs index 9bf6ea07..2a21302e 100644 --- a/src/Merge.Client/Ticketing/Types/AttachmentRequest.cs +++ b/src/Merge.Client/Ticketing/Types/AttachmentRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record AttachmentRequest diff --git a/src/Merge.Client/Ticketing/Types/AuditLogEvent.cs b/src/Merge.Client/Ticketing/Types/AuditLogEvent.cs index 15309fcc..3e807532 100644 --- a/src/Merge.Client/Ticketing/Types/AuditLogEvent.cs +++ b/src/Merge.Client/Ticketing/Types/AuditLogEvent.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AuditLogEvent diff --git a/src/Merge.Client/Ticketing/Types/AvailableActions.cs b/src/Merge.Client/Ticketing/Types/AvailableActions.cs index 19f5b0ef..6a9b2058 100644 --- a/src/Merge.Client/Ticketing/Types/AvailableActions.cs +++ b/src/Merge.Client/Ticketing/Types/AvailableActions.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record AvailableActions diff --git a/src/Merge.Client/Ticketing/Types/CategoriesEnum.cs b/src/Merge.Client/Ticketing/Types/CategoriesEnum.cs index 7b283a58..f247e613 100644 --- a/src/Merge.Client/Ticketing/Types/CategoriesEnum.cs +++ b/src/Merge.Client/Ticketing/Types/CategoriesEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoriesEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Ticketing/Types/CategoryEnum.cs b/src/Merge.Client/Ticketing/Types/CategoryEnum.cs index 69012af1..7d6ff146 100644 --- a/src/Merge.Client/Ticketing/Types/CategoryEnum.cs +++ b/src/Merge.Client/Ticketing/Types/CategoryEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CategoryEnum { [EnumMember(Value = "hris")] diff --git a/src/Merge.Client/Ticketing/Types/Collection.cs b/src/Merge.Client/Ticketing/Types/Collection.cs index 9e96ffc8..d255a862 100644 --- a/src/Merge.Client/Ticketing/Types/Collection.cs +++ b/src/Merge.Client/Ticketing/Types/Collection.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Collection diff --git a/src/Merge.Client/Ticketing/Types/CollectionTypeEnum.cs b/src/Merge.Client/Ticketing/Types/CollectionTypeEnum.cs index 08671607..ebd799c8 100644 --- a/src/Merge.Client/Ticketing/Types/CollectionTypeEnum.cs +++ b/src/Merge.Client/Ticketing/Types/CollectionTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum CollectionTypeEnum { [EnumMember(Value = "LIST")] diff --git a/src/Merge.Client/Ticketing/Types/Comment.cs b/src/Merge.Client/Ticketing/Types/Comment.cs index 090705d9..0f26e963 100644 --- a/src/Merge.Client/Ticketing/Types/Comment.cs +++ b/src/Merge.Client/Ticketing/Types/Comment.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Comment diff --git a/src/Merge.Client/Ticketing/Types/CommentRequest.cs b/src/Merge.Client/Ticketing/Types/CommentRequest.cs index a577f1b8..fb10643b 100644 --- a/src/Merge.Client/Ticketing/Types/CommentRequest.cs +++ b/src/Merge.Client/Ticketing/Types/CommentRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record CommentRequest diff --git a/src/Merge.Client/Ticketing/Types/CommentResponse.cs b/src/Merge.Client/Ticketing/Types/CommentResponse.cs index 37ff98ab..76bb45bd 100644 --- a/src/Merge.Client/Ticketing/Types/CommentResponse.cs +++ b/src/Merge.Client/Ticketing/Types/CommentResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommentResponse diff --git a/src/Merge.Client/Ticketing/Types/CommonModelScopeApi.cs b/src/Merge.Client/Ticketing/Types/CommonModelScopeApi.cs index b13d84c3..5e944197 100644 --- a/src/Merge.Client/Ticketing/Types/CommonModelScopeApi.cs +++ b/src/Merge.Client/Ticketing/Types/CommonModelScopeApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommonModelScopeApi diff --git a/src/Merge.Client/Ticketing/Types/CommonModelScopesBodyRequest.cs b/src/Merge.Client/Ticketing/Types/CommonModelScopesBodyRequest.cs index 7ffa9045..9c4d6c87 100644 --- a/src/Merge.Client/Ticketing/Types/CommonModelScopesBodyRequest.cs +++ b/src/Merge.Client/Ticketing/Types/CommonModelScopesBodyRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record CommonModelScopesBodyRequest diff --git a/src/Merge.Client/Ticketing/Types/Contact.cs b/src/Merge.Client/Ticketing/Types/Contact.cs index d770d2af..84db26d7 100644 --- a/src/Merge.Client/Ticketing/Types/Contact.cs +++ b/src/Merge.Client/Ticketing/Types/Contact.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Contact diff --git a/src/Merge.Client/Ticketing/Types/ContactRequest.cs b/src/Merge.Client/Ticketing/Types/ContactRequest.cs index 8328af3b..e8708dc6 100644 --- a/src/Merge.Client/Ticketing/Types/ContactRequest.cs +++ b/src/Merge.Client/Ticketing/Types/ContactRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record ContactRequest diff --git a/src/Merge.Client/Ticketing/Types/DataPassthroughRequest.cs b/src/Merge.Client/Ticketing/Types/DataPassthroughRequest.cs index f90d4b9e..810c35f3 100644 --- a/src/Merge.Client/Ticketing/Types/DataPassthroughRequest.cs +++ b/src/Merge.Client/Ticketing/Types/DataPassthroughRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record DataPassthroughRequest diff --git a/src/Merge.Client/Ticketing/Types/DebugModeLog.cs b/src/Merge.Client/Ticketing/Types/DebugModeLog.cs index 4122c8fe..17634a7e 100644 --- a/src/Merge.Client/Ticketing/Types/DebugModeLog.cs +++ b/src/Merge.Client/Ticketing/Types/DebugModeLog.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record DebugModeLog diff --git a/src/Merge.Client/Ticketing/Types/DebugModelLogSummary.cs b/src/Merge.Client/Ticketing/Types/DebugModelLogSummary.cs index 293b8f73..cd7843c0 100644 --- a/src/Merge.Client/Ticketing/Types/DebugModelLogSummary.cs +++ b/src/Merge.Client/Ticketing/Types/DebugModelLogSummary.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record DebugModelLogSummary diff --git a/src/Merge.Client/Ticketing/Types/EnabledActionsEnum.cs b/src/Merge.Client/Ticketing/Types/EnabledActionsEnum.cs index c5c867fe..aa465216 100644 --- a/src/Merge.Client/Ticketing/Types/EnabledActionsEnum.cs +++ b/src/Merge.Client/Ticketing/Types/EnabledActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EnabledActionsEnum { [EnumMember(Value = "READ")] diff --git a/src/Merge.Client/Ticketing/Types/EncodingEnum.cs b/src/Merge.Client/Ticketing/Types/EncodingEnum.cs index 51c75c3f..2c24a0de 100644 --- a/src/Merge.Client/Ticketing/Types/EncodingEnum.cs +++ b/src/Merge.Client/Ticketing/Types/EncodingEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EncodingEnum { [EnumMember(Value = "RAW")] diff --git a/src/Merge.Client/Ticketing/Types/ErrorValidationProblem.cs b/src/Merge.Client/Ticketing/Types/ErrorValidationProblem.cs index 93d0ede0..05171d60 100644 --- a/src/Merge.Client/Ticketing/Types/ErrorValidationProblem.cs +++ b/src/Merge.Client/Ticketing/Types/ErrorValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ErrorValidationProblem diff --git a/src/Merge.Client/Ticketing/Types/EventTypeEnum.cs b/src/Merge.Client/Ticketing/Types/EventTypeEnum.cs index cfe0a282..bb34170b 100644 --- a/src/Merge.Client/Ticketing/Types/EventTypeEnum.cs +++ b/src/Merge.Client/Ticketing/Types/EventTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum EventTypeEnum { [EnumMember(Value = "CREATED_REMOTE_PRODUCTION_API_KEY")] diff --git a/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApi.cs b/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApi.cs index 8d6fcac8..86c0c471 100644 --- a/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApi.cs +++ b/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApi.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ExternalTargetFieldApi diff --git a/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApiResponse.cs b/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApiResponse.cs index 89a3104e..3b2f5db5 100644 --- a/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApiResponse.cs +++ b/src/Merge.Client/Ticketing/Types/ExternalTargetFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ExternalTargetFieldApiResponse diff --git a/src/Merge.Client/Ticketing/Types/FieldFormatEnum.cs b/src/Merge.Client/Ticketing/Types/FieldFormatEnum.cs index 7ad881b5..eb8a3b7d 100644 --- a/src/Merge.Client/Ticketing/Types/FieldFormatEnum.cs +++ b/src/Merge.Client/Ticketing/Types/FieldFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstance.cs b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstance.cs index 69af7b6d..bb915672 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstance.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstance.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingApiInstance diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteField.cs b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteField.cs index 6ec5bc60..fa4b57c6 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteField.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingApiInstanceRemoteField diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs index 21cf4d6b..5df7f72c 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceResponse.cs b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceResponse.cs index 6499e4a2..43e86dab 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceResponse.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingApiInstanceResponse diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceTargetField.cs b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceTargetField.cs index 37ddc50c..5d10961b 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceTargetField.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingApiInstanceTargetField.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingApiInstanceTargetField diff --git a/src/Merge.Client/Ticketing/Types/FieldMappingInstanceResponse.cs b/src/Merge.Client/Ticketing/Types/FieldMappingInstanceResponse.cs index ffdada1c..4a2c5228 100644 --- a/src/Merge.Client/Ticketing/Types/FieldMappingInstanceResponse.cs +++ b/src/Merge.Client/Ticketing/Types/FieldMappingInstanceResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldMappingInstanceResponse diff --git a/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializer.cs b/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializer.cs index 05aaeae8..a4e6f549 100644 --- a/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializer.cs +++ b/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldPermissionDeserializer diff --git a/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializerRequest.cs b/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializerRequest.cs index ca96adf5..97c929a7 100644 --- a/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Ticketing/Types/FieldPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record FieldPermissionDeserializerRequest diff --git a/src/Merge.Client/Ticketing/Types/FieldTypeEnum.cs b/src/Merge.Client/Ticketing/Types/FieldTypeEnum.cs index ddfaa209..8e3e4f48 100644 --- a/src/Merge.Client/Ticketing/Types/FieldTypeEnum.cs +++ b/src/Merge.Client/Ticketing/Types/FieldTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum FieldTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializer.cs b/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializer.cs index 2dce8679..4e42dee7 100644 --- a/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializer.cs +++ b/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record IndividualCommonModelScopeDeserializer diff --git a/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializerRequest.cs b/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializerRequest.cs index 45f9c5fe..38ddd4f9 100644 --- a/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializerRequest.cs +++ b/src/Merge.Client/Ticketing/Types/IndividualCommonModelScopeDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record IndividualCommonModelScopeDeserializerRequest diff --git a/src/Merge.Client/Ticketing/Types/Issue.cs b/src/Merge.Client/Ticketing/Types/Issue.cs index 4c00247d..506eb624 100644 --- a/src/Merge.Client/Ticketing/Types/Issue.cs +++ b/src/Merge.Client/Ticketing/Types/Issue.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Issue diff --git a/src/Merge.Client/Ticketing/Types/IssueStatusEnum.cs b/src/Merge.Client/Ticketing/Types/IssueStatusEnum.cs index 37df4260..1d579718 100644 --- a/src/Merge.Client/Ticketing/Types/IssueStatusEnum.cs +++ b/src/Merge.Client/Ticketing/Types/IssueStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum IssueStatusEnum { [EnumMember(Value = "ONGOING")] diff --git a/src/Merge.Client/Ticketing/Types/ItemFormatEnum.cs b/src/Merge.Client/Ticketing/Types/ItemFormatEnum.cs index 956d1e32..3a039e75 100644 --- a/src/Merge.Client/Ticketing/Types/ItemFormatEnum.cs +++ b/src/Merge.Client/Ticketing/Types/ItemFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemFormatEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Ticketing/Types/ItemSchema.cs b/src/Merge.Client/Ticketing/Types/ItemSchema.cs index 53d74efd..6b070b5c 100644 --- a/src/Merge.Client/Ticketing/Types/ItemSchema.cs +++ b/src/Merge.Client/Ticketing/Types/ItemSchema.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ItemSchema diff --git a/src/Merge.Client/Ticketing/Types/ItemTypeEnum.cs b/src/Merge.Client/Ticketing/Types/ItemTypeEnum.cs index 44afbf52..d839c786 100644 --- a/src/Merge.Client/Ticketing/Types/ItemTypeEnum.cs +++ b/src/Merge.Client/Ticketing/Types/ItemTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ItemTypeEnum { [EnumMember(Value = "string")] diff --git a/src/Merge.Client/Ticketing/Types/LanguageEnum.cs b/src/Merge.Client/Ticketing/Types/LanguageEnum.cs index 95ae446a..ab950a4b 100644 --- a/src/Merge.Client/Ticketing/Types/LanguageEnum.cs +++ b/src/Merge.Client/Ticketing/Types/LanguageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum LanguageEnum { [EnumMember(Value = "en")] diff --git a/src/Merge.Client/Ticketing/Types/LinkToken.cs b/src/Merge.Client/Ticketing/Types/LinkToken.cs index 622280ee..422c9f9f 100644 --- a/src/Merge.Client/Ticketing/Types/LinkToken.cs +++ b/src/Merge.Client/Ticketing/Types/LinkToken.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record LinkToken diff --git a/src/Merge.Client/Ticketing/Types/LinkedAccountStatus.cs b/src/Merge.Client/Ticketing/Types/LinkedAccountStatus.cs index 904e49f5..f912f773 100644 --- a/src/Merge.Client/Ticketing/Types/LinkedAccountStatus.cs +++ b/src/Merge.Client/Ticketing/Types/LinkedAccountStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record LinkedAccountStatus diff --git a/src/Merge.Client/Ticketing/Types/MetaResponse.cs b/src/Merge.Client/Ticketing/Types/MetaResponse.cs index 3a3c33e2..51b7067f 100644 --- a/src/Merge.Client/Ticketing/Types/MetaResponse.cs +++ b/src/Merge.Client/Ticketing/Types/MetaResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record MetaResponse diff --git a/src/Merge.Client/Ticketing/Types/MethodEnum.cs b/src/Merge.Client/Ticketing/Types/MethodEnum.cs index f8573d84..76f09dae 100644 --- a/src/Merge.Client/Ticketing/Types/MethodEnum.cs +++ b/src/Merge.Client/Ticketing/Types/MethodEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum MethodEnum { [EnumMember(Value = "GET")] diff --git a/src/Merge.Client/Ticketing/Types/ModelOperation.cs b/src/Merge.Client/Ticketing/Types/ModelOperation.cs index d9cdf1c3..68a79851 100644 --- a/src/Merge.Client/Ticketing/Types/ModelOperation.cs +++ b/src/Merge.Client/Ticketing/Types/ModelOperation.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ModelOperation diff --git a/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializer.cs b/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializer.cs index 0fb78948..0b998da2 100644 --- a/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializer.cs +++ b/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializer.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ModelPermissionDeserializer diff --git a/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializerRequest.cs b/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializerRequest.cs index 76c3374b..7838ae6b 100644 --- a/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializerRequest.cs +++ b/src/Merge.Client/Ticketing/Types/ModelPermissionDeserializerRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ModelPermissionDeserializerRequest diff --git a/src/Merge.Client/Ticketing/Types/MultipartFormFieldRequest.cs b/src/Merge.Client/Ticketing/Types/MultipartFormFieldRequest.cs index b2f120a8..a307c9f0 100644 --- a/src/Merge.Client/Ticketing/Types/MultipartFormFieldRequest.cs +++ b/src/Merge.Client/Ticketing/Types/MultipartFormFieldRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record MultipartFormFieldRequest diff --git a/src/Merge.Client/Ticketing/Types/PaginatedAccountDetailsAndActionsList.cs b/src/Merge.Client/Ticketing/Types/PaginatedAccountDetailsAndActionsList.cs index a2983d77..91c2691f 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedAccountDetailsAndActionsList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedAccountDetailsAndActionsList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedAccountDetailsAndActionsList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedAccountList.cs b/src/Merge.Client/Ticketing/Types/PaginatedAccountList.cs index 227c8c8d..a20e5abb 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedAccountList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedAccountList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedAccountList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedAttachmentList.cs b/src/Merge.Client/Ticketing/Types/PaginatedAttachmentList.cs index 24dc4535..6f09c4cc 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedAttachmentList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedAttachmentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedAttachmentList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedAuditLogEventList.cs b/src/Merge.Client/Ticketing/Types/PaginatedAuditLogEventList.cs index 9c8d20b0..192421e5 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedAuditLogEventList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedAuditLogEventList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedAuditLogEventList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedCollectionList.cs b/src/Merge.Client/Ticketing/Types/PaginatedCollectionList.cs index f4adfc69..328803d2 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedCollectionList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedCollectionList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedCollectionList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedCommentList.cs b/src/Merge.Client/Ticketing/Types/PaginatedCommentList.cs index 2d35cb39..25aafc62 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedCommentList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedCommentList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedCommentList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedContactList.cs b/src/Merge.Client/Ticketing/Types/PaginatedContactList.cs index fee41bd7..a390369f 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedContactList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedContactList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedContactList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedIssueList.cs b/src/Merge.Client/Ticketing/Types/PaginatedIssueList.cs index e0bf8db7..d567127e 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedIssueList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedIssueList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedIssueList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedProjectList.cs b/src/Merge.Client/Ticketing/Types/PaginatedProjectList.cs index ec8549ce..dfc88ecd 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedProjectList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedProjectList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedProjectList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedRemoteFieldClassList.cs b/src/Merge.Client/Ticketing/Types/PaginatedRemoteFieldClassList.cs index ccc964aa..86680ffb 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedRemoteFieldClassList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedRemoteFieldClassList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedRemoteFieldClassList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedRoleList.cs b/src/Merge.Client/Ticketing/Types/PaginatedRoleList.cs index e4c5f4c6..80fa4b73 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedRoleList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedRoleList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedRoleList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedSyncStatusList.cs b/src/Merge.Client/Ticketing/Types/PaginatedSyncStatusList.cs index c05faa9c..1f2baae9 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedSyncStatusList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedSyncStatusList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedSyncStatusList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedTagList.cs b/src/Merge.Client/Ticketing/Types/PaginatedTagList.cs index 2d1921ff..edc8ad77 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedTagList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedTagList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedTagList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedTeamList.cs b/src/Merge.Client/Ticketing/Types/PaginatedTeamList.cs index 3b2ec957..5b671261 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedTeamList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedTeamList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedTeamList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedTicketList.cs b/src/Merge.Client/Ticketing/Types/PaginatedTicketList.cs index 86ddd069..fd3fbafa 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedTicketList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedTicketList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedTicketList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedUserList.cs b/src/Merge.Client/Ticketing/Types/PaginatedUserList.cs index b5ba1494..d17baa58 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedUserList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedUserList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedUserList diff --git a/src/Merge.Client/Ticketing/Types/PaginatedViewerList.cs b/src/Merge.Client/Ticketing/Types/PaginatedViewerList.cs index cc07480c..abd3816f 100644 --- a/src/Merge.Client/Ticketing/Types/PaginatedViewerList.cs +++ b/src/Merge.Client/Ticketing/Types/PaginatedViewerList.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PaginatedViewerList diff --git a/src/Merge.Client/Ticketing/Types/PatchedTicketRequest.cs b/src/Merge.Client/Ticketing/Types/PatchedTicketRequest.cs index a6867e59..256c2b0a 100644 --- a/src/Merge.Client/Ticketing/Types/PatchedTicketRequest.cs +++ b/src/Merge.Client/Ticketing/Types/PatchedTicketRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record PatchedTicketRequest diff --git a/src/Merge.Client/Ticketing/Types/PriorityEnum.cs b/src/Merge.Client/Ticketing/Types/PriorityEnum.cs index 3d93cef1..f56a7067 100644 --- a/src/Merge.Client/Ticketing/Types/PriorityEnum.cs +++ b/src/Merge.Client/Ticketing/Types/PriorityEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum PriorityEnum { [EnumMember(Value = "URGENT")] diff --git a/src/Merge.Client/Ticketing/Types/Project.cs b/src/Merge.Client/Ticketing/Types/Project.cs index db409703..4f8a9af5 100644 --- a/src/Merge.Client/Ticketing/Types/Project.cs +++ b/src/Merge.Client/Ticketing/Types/Project.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Project diff --git a/src/Merge.Client/Ticketing/Types/RemoteData.cs b/src/Merge.Client/Ticketing/Types/RemoteData.cs index 47d89c47..79db7942 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteData.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteData.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteData diff --git a/src/Merge.Client/Ticketing/Types/RemoteEndpointInfo.cs b/src/Merge.Client/Ticketing/Types/RemoteEndpointInfo.cs index 33e28275..4df99292 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteEndpointInfo.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteEndpointInfo.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteEndpointInfo diff --git a/src/Merge.Client/Ticketing/Types/RemoteField.cs b/src/Merge.Client/Ticketing/Types/RemoteField.cs index 7192887a..7895af67 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteField.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteField.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteField diff --git a/src/Merge.Client/Ticketing/Types/RemoteFieldApi.cs b/src/Merge.Client/Ticketing/Types/RemoteFieldApi.cs index 35766fc7..ffd80b56 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteFieldApi.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteFieldApi.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldApi diff --git a/src/Merge.Client/Ticketing/Types/RemoteFieldApiResponse.cs b/src/Merge.Client/Ticketing/Types/RemoteFieldApiResponse.cs index e9f58c24..dc504c37 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteFieldApiResponse.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteFieldApiResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldApiResponse diff --git a/src/Merge.Client/Ticketing/Types/RemoteFieldClass.cs b/src/Merge.Client/Ticketing/Types/RemoteFieldClass.cs index e7240235..2f1cd59b 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteFieldClass.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteFieldClass.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldClass diff --git a/src/Merge.Client/Ticketing/Types/RemoteFieldClassFieldChoicesItem.cs b/src/Merge.Client/Ticketing/Types/RemoteFieldClassFieldChoicesItem.cs index 426c5d75..78947f2a 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteFieldClassFieldChoicesItem.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteFieldClassFieldChoicesItem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldClassFieldChoicesItem diff --git a/src/Merge.Client/Ticketing/Types/RemoteFieldRequest.cs b/src/Merge.Client/Ticketing/Types/RemoteFieldRequest.cs index a2d946be..ff61d69f 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteFieldRequest.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteFieldRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteFieldRequest diff --git a/src/Merge.Client/Ticketing/Types/RemoteKey.cs b/src/Merge.Client/Ticketing/Types/RemoteKey.cs index d1e11f58..ff7c84d0 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteKey.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteKey.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteKey diff --git a/src/Merge.Client/Ticketing/Types/RemoteResponse.cs b/src/Merge.Client/Ticketing/Types/RemoteResponse.cs index fbfbeaf5..c4f1360f 100644 --- a/src/Merge.Client/Ticketing/Types/RemoteResponse.cs +++ b/src/Merge.Client/Ticketing/Types/RemoteResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record RemoteResponse diff --git a/src/Merge.Client/Ticketing/Types/RequestFormatEnum.cs b/src/Merge.Client/Ticketing/Types/RequestFormatEnum.cs index 0a0b2445..dcde5538 100644 --- a/src/Merge.Client/Ticketing/Types/RequestFormatEnum.cs +++ b/src/Merge.Client/Ticketing/Types/RequestFormatEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RequestFormatEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Ticketing/Types/ResponseTypeEnum.cs b/src/Merge.Client/Ticketing/Types/ResponseTypeEnum.cs index 3e9daa25..4f9989d6 100644 --- a/src/Merge.Client/Ticketing/Types/ResponseTypeEnum.cs +++ b/src/Merge.Client/Ticketing/Types/ResponseTypeEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum ResponseTypeEnum { [EnumMember(Value = "JSON")] diff --git a/src/Merge.Client/Ticketing/Types/Role.cs b/src/Merge.Client/Ticketing/Types/Role.cs index 2165890e..55d06875 100644 --- a/src/Merge.Client/Ticketing/Types/Role.cs +++ b/src/Merge.Client/Ticketing/Types/Role.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Role diff --git a/src/Merge.Client/Ticketing/Types/RoleEnum.cs b/src/Merge.Client/Ticketing/Types/RoleEnum.cs index c123382d..d9cd9cb7 100644 --- a/src/Merge.Client/Ticketing/Types/RoleEnum.cs +++ b/src/Merge.Client/Ticketing/Types/RoleEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum RoleEnum { [EnumMember(Value = "ADMIN")] diff --git a/src/Merge.Client/Ticketing/Types/SelectiveSyncConfigurationsUsageEnum.cs b/src/Merge.Client/Ticketing/Types/SelectiveSyncConfigurationsUsageEnum.cs index d7888286..0748b36f 100644 --- a/src/Merge.Client/Ticketing/Types/SelectiveSyncConfigurationsUsageEnum.cs +++ b/src/Merge.Client/Ticketing/Types/SelectiveSyncConfigurationsUsageEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SelectiveSyncConfigurationsUsageEnum { [EnumMember(Value = "IN_NEXT_SYNC")] diff --git a/src/Merge.Client/Ticketing/Types/SyncStatus.cs b/src/Merge.Client/Ticketing/Types/SyncStatus.cs index f411e768..09b4edc9 100644 --- a/src/Merge.Client/Ticketing/Types/SyncStatus.cs +++ b/src/Merge.Client/Ticketing/Types/SyncStatus.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record SyncStatus diff --git a/src/Merge.Client/Ticketing/Types/SyncStatusStatusEnum.cs b/src/Merge.Client/Ticketing/Types/SyncStatusStatusEnum.cs index c1d79e34..d6132241 100644 --- a/src/Merge.Client/Ticketing/Types/SyncStatusStatusEnum.cs +++ b/src/Merge.Client/Ticketing/Types/SyncStatusStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum SyncStatusStatusEnum { [EnumMember(Value = "SYNCING")] diff --git a/src/Merge.Client/Ticketing/Types/Tag.cs b/src/Merge.Client/Ticketing/Types/Tag.cs index 66ef1996..a2f5e654 100644 --- a/src/Merge.Client/Ticketing/Types/Tag.cs +++ b/src/Merge.Client/Ticketing/Types/Tag.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Tag diff --git a/src/Merge.Client/Ticketing/Types/Team.cs b/src/Merge.Client/Ticketing/Types/Team.cs index 34d0acc3..8b160f9a 100644 --- a/src/Merge.Client/Ticketing/Types/Team.cs +++ b/src/Merge.Client/Ticketing/Types/Team.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record Team diff --git a/src/Merge.Client/Ticketing/Types/Ticket.cs b/src/Merge.Client/Ticketing/Types/Ticket.cs index a3358b84..f3250045 100644 --- a/src/Merge.Client/Ticketing/Types/Ticket.cs +++ b/src/Merge.Client/Ticketing/Types/Ticket.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Ticket diff --git a/src/Merge.Client/Ticketing/Types/TicketAccessEnum.cs b/src/Merge.Client/Ticketing/Types/TicketAccessEnum.cs index ace8f920..81c64ce9 100644 --- a/src/Merge.Client/Ticketing/Types/TicketAccessEnum.cs +++ b/src/Merge.Client/Ticketing/Types/TicketAccessEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketAccessEnum { [EnumMember(Value = "ALL")] diff --git a/src/Merge.Client/Ticketing/Types/TicketActionsEnum.cs b/src/Merge.Client/Ticketing/Types/TicketActionsEnum.cs index cc761d76..ebdc5cf7 100644 --- a/src/Merge.Client/Ticketing/Types/TicketActionsEnum.cs +++ b/src/Merge.Client/Ticketing/Types/TicketActionsEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketActionsEnum { [EnumMember(Value = "VIEW")] diff --git a/src/Merge.Client/Ticketing/Types/TicketRequest.cs b/src/Merge.Client/Ticketing/Types/TicketRequest.cs index 72d81787..f49af52a 100644 --- a/src/Merge.Client/Ticketing/Types/TicketRequest.cs +++ b/src/Merge.Client/Ticketing/Types/TicketRequest.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketRequest diff --git a/src/Merge.Client/Ticketing/Types/TicketResponse.cs b/src/Merge.Client/Ticketing/Types/TicketResponse.cs index 03342a86..80662c7e 100644 --- a/src/Merge.Client/Ticketing/Types/TicketResponse.cs +++ b/src/Merge.Client/Ticketing/Types/TicketResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketResponse diff --git a/src/Merge.Client/Ticketing/Types/TicketStatusEnum.cs b/src/Merge.Client/Ticketing/Types/TicketStatusEnum.cs index 18219365..ac3aaf76 100644 --- a/src/Merge.Client/Ticketing/Types/TicketStatusEnum.cs +++ b/src/Merge.Client/Ticketing/Types/TicketStatusEnum.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum TicketStatusEnum { [EnumMember(Value = "OPEN")] diff --git a/src/Merge.Client/Ticketing/Types/TicketingAttachmentResponse.cs b/src/Merge.Client/Ticketing/Types/TicketingAttachmentResponse.cs index 42f8e0eb..fea148cf 100644 --- a/src/Merge.Client/Ticketing/Types/TicketingAttachmentResponse.cs +++ b/src/Merge.Client/Ticketing/Types/TicketingAttachmentResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketingAttachmentResponse diff --git a/src/Merge.Client/Ticketing/Types/TicketingContactResponse.cs b/src/Merge.Client/Ticketing/Types/TicketingContactResponse.cs index f416f6fa..be2d5470 100644 --- a/src/Merge.Client/Ticketing/Types/TicketingContactResponse.cs +++ b/src/Merge.Client/Ticketing/Types/TicketingContactResponse.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record TicketingContactResponse diff --git a/src/Merge.Client/Ticketing/Types/User.cs b/src/Merge.Client/Ticketing/Types/User.cs index 3e2b4bfd..1cc269ae 100644 --- a/src/Merge.Client/Ticketing/Types/User.cs +++ b/src/Merge.Client/Ticketing/Types/User.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record User diff --git a/src/Merge.Client/Ticketing/Types/ValidationProblemSource.cs b/src/Merge.Client/Ticketing/Types/ValidationProblemSource.cs index 52dc59ab..1388bf80 100644 --- a/src/Merge.Client/Ticketing/Types/ValidationProblemSource.cs +++ b/src/Merge.Client/Ticketing/Types/ValidationProblemSource.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record ValidationProblemSource diff --git a/src/Merge.Client/Ticketing/Types/Viewer.cs b/src/Merge.Client/Ticketing/Types/Viewer.cs index 6d08af48..d582dd9f 100644 --- a/src/Merge.Client/Ticketing/Types/Viewer.cs +++ b/src/Merge.Client/Ticketing/Types/Viewer.cs @@ -2,8 +2,6 @@ using Merge.Client.Core; using OneOf; -#nullable enable - namespace Merge.Client.Ticketing; public record Viewer diff --git a/src/Merge.Client/Ticketing/Types/WarningValidationProblem.cs b/src/Merge.Client/Ticketing/Types/WarningValidationProblem.cs index 97d46a22..ba999666 100644 --- a/src/Merge.Client/Ticketing/Types/WarningValidationProblem.cs +++ b/src/Merge.Client/Ticketing/Types/WarningValidationProblem.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record WarningValidationProblem diff --git a/src/Merge.Client/Ticketing/Types/WebhookReceiver.cs b/src/Merge.Client/Ticketing/Types/WebhookReceiver.cs index 64191902..f4b44512 100644 --- a/src/Merge.Client/Ticketing/Types/WebhookReceiver.cs +++ b/src/Merge.Client/Ticketing/Types/WebhookReceiver.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record WebhookReceiver diff --git a/src/Merge.Client/Ticketing/Users/Requests/UsersListRequest.cs b/src/Merge.Client/Ticketing/Users/Requests/UsersListRequest.cs index 89d926f3..f8414a85 100644 --- a/src/Merge.Client/Ticketing/Users/Requests/UsersListRequest.cs +++ b/src/Merge.Client/Ticketing/Users/Requests/UsersListRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record UsersListRequest diff --git a/src/Merge.Client/Ticketing/Users/Requests/UsersRetrieveRequest.cs b/src/Merge.Client/Ticketing/Users/Requests/UsersRetrieveRequest.cs index 692f3dec..5d1efb37 100644 --- a/src/Merge.Client/Ticketing/Users/Requests/UsersRetrieveRequest.cs +++ b/src/Merge.Client/Ticketing/Users/Requests/UsersRetrieveRequest.cs @@ -1,7 +1,5 @@ using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record UsersRetrieveRequest diff --git a/src/Merge.Client/Ticketing/Users/Types/UsersListRequestExpand.cs b/src/Merge.Client/Ticketing/Users/Types/UsersListRequestExpand.cs index b30fe370..6c9f4f35 100644 --- a/src/Merge.Client/Ticketing/Users/Types/UsersListRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Users/Types/UsersListRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum UsersListRequestExpand { [EnumMember(Value = "roles")] diff --git a/src/Merge.Client/Ticketing/Users/Types/UsersRetrieveRequestExpand.cs b/src/Merge.Client/Ticketing/Users/Types/UsersRetrieveRequestExpand.cs index be864d55..2142e0e4 100644 --- a/src/Merge.Client/Ticketing/Users/Types/UsersRetrieveRequestExpand.cs +++ b/src/Merge.Client/Ticketing/Users/Types/UsersRetrieveRequestExpand.cs @@ -2,11 +2,9 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; -[JsonConverter(typeof(StringEnumSerializer))] +[JsonConverter(typeof(EnumSerializer))] public enum UsersRetrieveRequestExpand { [EnumMember(Value = "roles")] diff --git a/src/Merge.Client/Ticketing/Users/UsersClient.cs b/src/Merge.Client/Ticketing/Users/UsersClient.cs index b9354d58..3d131bef 100644 --- a/src/Merge.Client/Ticketing/Users/UsersClient.cs +++ b/src/Merge.Client/Ticketing/Users/UsersClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class UsersClient @@ -24,7 +22,7 @@ internal UsersClient(RawClient client) /// await client.Ticketing.Users.ListAsync(new UsersListRequest()); /// /// - public async Task ListAsync( + public async System.Threading.Tasks.Task ListAsync( UsersListRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default @@ -55,15 +53,15 @@ public async Task ListAsync( } if (request.IncludeDeletedData != null) { - _query["include_deleted_data"] = request.IncludeDeletedData.ToString(); + _query["include_deleted_data"] = JsonUtils.Serialize(request.IncludeDeletedData.Value); } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); } if (request.IncludeShellData != null) { - _query["include_shell_data"] = request.IncludeShellData.ToString(); + _query["include_shell_data"] = JsonUtils.Serialize(request.IncludeShellData.Value); } if (request.ModifiedAfter != null) { @@ -79,23 +77,25 @@ public async Task ListAsync( } if (request.PageSize != null) { - _query["page_size"] = request.PageSize.ToString(); + _query["page_size"] = request.PageSize.Value.ToString(); } if (request.RemoteId != null) { _query["remote_id"] = request.RemoteId; } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/users", - Query = _query, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/users", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -124,7 +124,7 @@ public async Task ListAsync( /// await client.Ticketing.Users.RetrieveAsync("id", new UsersRetrieveRequest()); /// /// - public async Task RetrieveAsync( + public async System.Threading.Tasks.Task RetrieveAsync( string id, UsersRetrieveRequest request, RequestOptions? options = null, @@ -138,19 +138,21 @@ public async Task RetrieveAsync( } if (request.IncludeRemoteData != null) { - _query["include_remote_data"] = request.IncludeRemoteData.ToString(); - } - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = $"ticketing/v1/users/{id}", - Query = _query, - Options = options, - }, - cancellationToken - ); + _query["include_remote_data"] = JsonUtils.Serialize(request.IncludeRemoteData.Value); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = $"ticketing/v1/users/{id}", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { diff --git a/src/Merge.Client/Ticketing/WebhookReceivers/Requests/WebhookReceiverRequest.cs b/src/Merge.Client/Ticketing/WebhookReceivers/Requests/WebhookReceiverRequest.cs index 4938c069..8a065616 100644 --- a/src/Merge.Client/Ticketing/WebhookReceivers/Requests/WebhookReceiverRequest.cs +++ b/src/Merge.Client/Ticketing/WebhookReceivers/Requests/WebhookReceiverRequest.cs @@ -1,8 +1,6 @@ using System.Text.Json.Serialization; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public record WebhookReceiverRequest diff --git a/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs b/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs index 3c0adec6..c123d24c 100644 --- a/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs +++ b/src/Merge.Client/Ticketing/WebhookReceivers/WebhookReceiversClient.cs @@ -3,8 +3,6 @@ using System.Threading; using Merge.Client.Core; -#nullable enable - namespace Merge.Client.Ticketing; public partial class WebhookReceiversClient @@ -24,21 +22,23 @@ internal WebhookReceiversClient(RawClient client) /// await client.Ticketing.WebhookReceivers.ListAsync(); /// /// - public async Task> ListAsync( + public async System.Threading.Tasks.Task> ListAsync( RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Get, - Path = "ticketing/v1/webhook-receivers", - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "ticketing/v1/webhook-receivers", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) { @@ -69,23 +69,26 @@ public async Task> ListAsync( /// ); /// /// - public async Task CreateAsync( + public async System.Threading.Tasks.Task CreateAsync( WebhookReceiverRequest request, RequestOptions? options = null, CancellationToken cancellationToken = default ) { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "ticketing/v1/webhook-receivers", - Body = request, - Options = options, - }, - cancellationToken - ); + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = "ticketing/v1/webhook-receivers", + Body = request, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); var responseBody = await response.Raw.Content.ReadAsStringAsync(); if (response.StatusCode is >= 200 and < 400) {