Compare commits
3 Commits
4c6342a989
..
v9.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
| f890fce7c9 | |||
| d8b9fd7664 | |||
| 6d1d165aba |
@@ -6,6 +6,7 @@ client/dist
|
||||
|
||||
.vs/
|
||||
.user
|
||||
.kiota.log
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name 3CX TAPI
|
||||
// @namespace http://cp-solutions.at
|
||||
// @version 9.3.1
|
||||
// @version 9.4.0
|
||||
// @author Daniel Triendl <d.triendl@cp-solutions.at>
|
||||
// @copyright Copyright CP Solutions GmbH
|
||||
// @source https://source.cp-austria.at/CPATRD/3cx_tapi.git
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "3cx-tapi",
|
||||
"description": "3CX CP Tapi and Projectmanager integration",
|
||||
"version": "9.3.1",
|
||||
"version": "9.4.0",
|
||||
"author": {
|
||||
"name": "Daniel Triendl",
|
||||
"email": "d.triendl@cp-solutions.at"
|
||||
|
||||
+16
-1
@@ -1,10 +1,17 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.5.11612.153 insiders
|
||||
VisualStudioVersion = 18.5.11612.153
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPATapi.Server", "src\CPATapi.Server\CPATapi.Server.csproj", "{7879A024-A074-FE67-0546-8668213BFA99}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPATapi.Client", "src\CPATapi.Client\CPATapi.Client.csproj", "{C60C2505-6D82-4058-9392-FA3C8F57FF8A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7879A024-A074-FE67-0546-8668213BFA99} = {7879A024-A074-FE67-0546-8668213BFA99}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPATapi.Client.Tests", "test\CPATapi.Client.Tests\CPATapi.Client.Tests.csproj", "{17F37791-4F68-46D5-8CF5-5F1736F6776E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +22,14 @@ Global
|
||||
{7879A024-A074-FE67-0546-8668213BFA99}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7879A024-A074-FE67-0546-8668213BFA99}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7879A024-A074-FE67-0546-8668213BFA99}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C60C2505-6D82-4058-9392-FA3C8F57FF8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C60C2505-6D82-4058-9392-FA3C8F57FF8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C60C2505-6D82-4058-9392-FA3C8F57FF8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C60C2505-6D82-4058-9392-FA3C8F57FF8A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{17F37791-4F68-46D5-8CF5-5F1736F6776E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{17F37791-4F68-46D5-8CF5-5F1736F6776E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{17F37791-4F68-46D5-8CF5-5F1736F6776E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{17F37791-4F68-46D5-8CF5-5F1736F6776E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Availability.Item;
|
||||
using CPATapi.Client.Availability.Users;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
namespace CPATapi.Client.Availability
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \Availability
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class AvailabilityRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The users property</summary>
|
||||
public global::CPATapi.Client.Availability.Users.UsersRequestBuilder Users
|
||||
{
|
||||
get => new global::CPATapi.Client.Availability.Users.UsersRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>Gets an item from the CPATapi.Client.Availability.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder"/></returns>
|
||||
public global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder this[string position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
urlTplParams.Add("user", position);
|
||||
return new global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.AvailabilityRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public AvailabilityRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.AvailabilityRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public AvailabilityRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability", rawUrl)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,86 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Models;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System;
|
||||
namespace CPATapi.Client.Availability.Item
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \Availability\{user}
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithUserItemRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithUserItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability/{user}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithUserItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability/{user}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Models.Availability"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<global::CPATapi.Client.Models.Availability?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<global::CPATapi.Client.Models.Availability> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
return await RequestAdapter.SendAsync<global::CPATapi.Client.Models.Availability>(requestInfo, global::CPATapi.Client.Models.Availability.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
|
||||
requestInfo.Configure(requestConfiguration);
|
||||
requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9");
|
||||
return requestInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::CPATapi.Client.Availability.Item.WithUserItemRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithUserItemRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,86 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System;
|
||||
namespace CPATapi.Client.Availability.Users
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \Availability\users
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class UsersRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.Users.UsersRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public UsersRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability/users", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Availability.Users.UsersRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public UsersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Availability/users", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<string></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<string>?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<string>> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var collectionResult = await RequestAdapter.SendPrimitiveCollectionAsync<string>(requestInfo, default, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
|
||||
requestInfo.Configure(requestConfiguration);
|
||||
requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9");
|
||||
return requestInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Availability.Users.UsersRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::CPATapi.Client.Availability.Users.UsersRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::CPATapi.Client.Availability.Users.UsersRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class UsersRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageId>CPATapi.Client</PackageId>
|
||||
<Authors>Daniel Triendl</Authors>
|
||||
<Company>CP Solutions GmbH</Company>
|
||||
<Version>9.4.0</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Kiota.Bundle" Version="1.22.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="kiota generate -l CSharp -c CPATapiClient -n CPATapi.Client -d ..\CPATapi.Server\CPATapi.Server.json -o .\" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,61 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Availability;
|
||||
using CPATapi.Client.CallerId;
|
||||
using CPATapi.Client.Contact;
|
||||
using CPATapi.Client.Search;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using Microsoft.Kiota.Serialization.Form;
|
||||
using Microsoft.Kiota.Serialization.Json;
|
||||
using Microsoft.Kiota.Serialization.Multipart;
|
||||
using Microsoft.Kiota.Serialization.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
namespace CPATapi.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point of the SDK, exposes the configuration and the fluent API.
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CPATapiClient : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>The Availability property</summary>
|
||||
public global::CPATapi.Client.Availability.AvailabilityRequestBuilder Availability
|
||||
{
|
||||
get => new global::CPATapi.Client.Availability.AvailabilityRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The CallerId property</summary>
|
||||
public global::CPATapi.Client.CallerId.CallerIdRequestBuilder CallerId
|
||||
{
|
||||
get => new global::CPATapi.Client.CallerId.CallerIdRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The Contact property</summary>
|
||||
public global::CPATapi.Client.Contact.ContactRequestBuilder Contact
|
||||
{
|
||||
get => new global::CPATapi.Client.Contact.ContactRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>The Search property</summary>
|
||||
public global::CPATapi.Client.Search.SearchRequestBuilder Search
|
||||
{
|
||||
get => new global::CPATapi.Client.Search.SearchRequestBuilder(PathParameters, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.CPATapiClient"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CPATapiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary<string, object>())
|
||||
{
|
||||
ApiClientBuilder.RegisterDefaultSerializer<JsonSerializationWriterFactory>();
|
||||
ApiClientBuilder.RegisterDefaultSerializer<TextSerializationWriterFactory>();
|
||||
ApiClientBuilder.RegisterDefaultSerializer<FormSerializationWriterFactory>();
|
||||
ApiClientBuilder.RegisterDefaultSerializer<MultipartSerializationWriterFactory>();
|
||||
ApiClientBuilder.RegisterDefaultDeserializer<JsonParseNodeFactory>();
|
||||
ApiClientBuilder.RegisterDefaultDeserializer<TextParseNodeFactory>();
|
||||
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,48 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.CallerId.Item;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
namespace CPATapi.Client.CallerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \CallerId
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class CallerIdRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>Gets an item from the CPATapi.Client.CallerId.item collection</summary>
|
||||
/// <param name="position">Unique identifier of the item</param>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder"/></returns>
|
||||
public global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder this[string position]
|
||||
{
|
||||
get
|
||||
{
|
||||
var urlTplParams = new Dictionary<string, object>(PathParameters);
|
||||
urlTplParams.Add("number", position);
|
||||
return new global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder(urlTplParams, RequestAdapter);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.CallerId.CallerIdRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CallerIdRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/CallerId", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.CallerId.CallerIdRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public CallerIdRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/CallerId", rawUrl)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,91 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Models;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System;
|
||||
namespace CPATapi.Client.CallerId.Item
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \CallerId\{number}
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithNumberItemRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithNumberItemRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/CallerId/{number}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public WithNumberItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/CallerId/{number}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Models.TapiContact"/></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
/// <exception cref="global::CPATapi.Client.Models.ProblemDetails">When receiving a 404 status code</exception>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<global::CPATapi.Client.Models.TapiContact?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<global::CPATapi.Client.Models.TapiContact> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>>
|
||||
{
|
||||
{ "404", global::CPATapi.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
|
||||
};
|
||||
return await RequestAdapter.SendAsync<global::CPATapi.Client.Models.TapiContact>(requestInfo, global::CPATapi.Client.Models.TapiContact.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
|
||||
requestInfo.Configure(requestConfiguration);
|
||||
requestInfo.Headers.TryAdd("Accept", "application/json, text/plain;q=0.9");
|
||||
return requestInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::CPATapi.Client.CallerId.Item.WithNumberItemRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class WithNumberItemRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,87 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Models;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System;
|
||||
namespace CPATapi.Client.Contact
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \Contact
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class ContactRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Contact.ContactRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ContactRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Contact", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Contact.ContactRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public ContactRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Contact", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::CPATapi.Client.Models.TapiContact></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::CPATapi.Client.Models.TapiContact>?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::CPATapi.Client.Models.TapiContact>> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::CPATapi.Client.Models.TapiContact>(requestInfo, global::CPATapi.Client.Models.TapiContact.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
|
||||
requestInfo.Configure(requestConfiguration);
|
||||
requestInfo.Headers.TryAdd("Accept", "application/json");
|
||||
return requestInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Contact.ContactRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::CPATapi.Client.Contact.ContactRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::CPATapi.Client.Contact.ContactRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class ContactRequestBuilderGetRequestConfiguration : RequestConfiguration<DefaultQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,69 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System;
|
||||
namespace CPATapi.Client.Models
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class Availability : IAdditionalDataHolder, IParsable
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
|
||||
public IDictionary<string, object> AdditionalData { get; set; }
|
||||
/// <summary>The loggedIn property</summary>
|
||||
public bool? LoggedIn { get; set; }
|
||||
/// <summary>The user property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? User { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string User { get; set; }
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Models.Availability"/> and sets the default values.
|
||||
/// </summary>
|
||||
public Availability()
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates a new instance of the appropriate class based on discriminator value
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Models.Availability"/></returns>
|
||||
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
|
||||
public static global::CPATapi.Client.Models.Availability CreateFromDiscriminatorValue(IParseNode parseNode)
|
||||
{
|
||||
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
|
||||
return new global::CPATapi.Client.Models.Availability();
|
||||
}
|
||||
/// <summary>
|
||||
/// The deserialization information for the current model
|
||||
/// </summary>
|
||||
/// <returns>A IDictionary<string, Action<IParseNode>></returns>
|
||||
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
|
||||
{
|
||||
return new Dictionary<string, Action<IParseNode>>
|
||||
{
|
||||
{ "loggedIn", n => { LoggedIn = n.GetBoolValue(); } },
|
||||
{ "user", n => { User = n.GetStringValue(); } },
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// Serializes information the current object
|
||||
/// </summary>
|
||||
/// <param name="writer">Serialization writer to use to serialize this model</param>
|
||||
public virtual void Serialize(ISerializationWriter writer)
|
||||
{
|
||||
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
|
||||
writer.WriteBoolValue("loggedIn", LoggedIn);
|
||||
writer.WriteStringValue("user", User);
|
||||
writer.WriteAdditionalData(AdditionalData);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,108 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System;
|
||||
namespace CPATapi.Client.Models
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class ProblemDetails : ApiException, IAdditionalDataHolder, IParsable
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
|
||||
public IDictionary<string, object> AdditionalData { get; set; }
|
||||
/// <summary>The detail property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? Detail { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string Detail { get; set; }
|
||||
#endif
|
||||
/// <summary>The instance property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? Instance { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string Instance { get; set; }
|
||||
#endif
|
||||
/// <summary>The primary error message.</summary>
|
||||
public override string Message { get => base.Message; }
|
||||
/// <summary>The status property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public UntypedNode? Status { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public UntypedNode Status { get; set; }
|
||||
#endif
|
||||
/// <summary>The title property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? Title { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string Title { get; set; }
|
||||
#endif
|
||||
/// <summary>The type property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? Type { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string Type { get; set; }
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Models.ProblemDetails"/> and sets the default values.
|
||||
/// </summary>
|
||||
public ProblemDetails()
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates a new instance of the appropriate class based on discriminator value
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Models.ProblemDetails"/></returns>
|
||||
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
|
||||
public static global::CPATapi.Client.Models.ProblemDetails CreateFromDiscriminatorValue(IParseNode parseNode)
|
||||
{
|
||||
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
|
||||
return new global::CPATapi.Client.Models.ProblemDetails();
|
||||
}
|
||||
/// <summary>
|
||||
/// The deserialization information for the current model
|
||||
/// </summary>
|
||||
/// <returns>A IDictionary<string, Action<IParseNode>></returns>
|
||||
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
|
||||
{
|
||||
return new Dictionary<string, Action<IParseNode>>
|
||||
{
|
||||
{ "detail", n => { Detail = n.GetStringValue(); } },
|
||||
{ "instance", n => { Instance = n.GetStringValue(); } },
|
||||
{ "status", n => { Status = n.GetObjectValue<UntypedNode>(UntypedNode.CreateFromDiscriminatorValue); } },
|
||||
{ "title", n => { Title = n.GetStringValue(); } },
|
||||
{ "type", n => { Type = n.GetStringValue(); } },
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// Serializes information the current object
|
||||
/// </summary>
|
||||
/// <param name="writer">Serialization writer to use to serialize this model</param>
|
||||
public virtual void Serialize(ISerializationWriter writer)
|
||||
{
|
||||
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
|
||||
writer.WriteStringValue("detail", Detail);
|
||||
writer.WriteStringValue("instance", Instance);
|
||||
writer.WriteObjectValue<UntypedNode>("status", Status);
|
||||
writer.WriteStringValue("title", Title);
|
||||
writer.WriteStringValue("type", Type);
|
||||
writer.WriteAdditionalData(AdditionalData);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,105 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System;
|
||||
namespace CPATapi.Client.Models
|
||||
{
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class TapiContact : IAdditionalDataHolder, IParsable
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
/// <summary>Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.</summary>
|
||||
public IDictionary<string, object> AdditionalData { get; set; }
|
||||
/// <summary>The tD_ID property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? TDID { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string TDID { get; set; }
|
||||
#endif
|
||||
/// <summary>The tD_MEDIUM property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? TDMEDIUM { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string TDMEDIUM { get; set; }
|
||||
#endif
|
||||
/// <summary>The tD_NAME property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? TDNAME { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string TDNAME { get; set; }
|
||||
#endif
|
||||
/// <summary>The tD_NUMBER property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? TDNUMBER { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string TDNUMBER { get; set; }
|
||||
#endif
|
||||
/// <summary>The tD_NUMBER_TAPI property</summary>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public string? TDNUMBERTAPI { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
public string TDNUMBERTAPI { get; set; }
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Models.TapiContact"/> and sets the default values.
|
||||
/// </summary>
|
||||
public TapiContact()
|
||||
{
|
||||
AdditionalData = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates a new instance of the appropriate class based on discriminator value
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Models.TapiContact"/></returns>
|
||||
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
|
||||
public static global::CPATapi.Client.Models.TapiContact CreateFromDiscriminatorValue(IParseNode parseNode)
|
||||
{
|
||||
if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
|
||||
return new global::CPATapi.Client.Models.TapiContact();
|
||||
}
|
||||
/// <summary>
|
||||
/// The deserialization information for the current model
|
||||
/// </summary>
|
||||
/// <returns>A IDictionary<string, Action<IParseNode>></returns>
|
||||
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
|
||||
{
|
||||
return new Dictionary<string, Action<IParseNode>>
|
||||
{
|
||||
{ "tD_ID", n => { TDID = n.GetStringValue(); } },
|
||||
{ "tD_MEDIUM", n => { TDMEDIUM = n.GetStringValue(); } },
|
||||
{ "tD_NAME", n => { TDNAME = n.GetStringValue(); } },
|
||||
{ "tD_NUMBER", n => { TDNUMBER = n.GetStringValue(); } },
|
||||
{ "tD_NUMBER_TAPI", n => { TDNUMBERTAPI = n.GetStringValue(); } },
|
||||
};
|
||||
}
|
||||
/// <summary>
|
||||
/// Serializes information the current object
|
||||
/// </summary>
|
||||
/// <param name="writer">Serialization writer to use to serialize this model</param>
|
||||
public virtual void Serialize(ISerializationWriter writer)
|
||||
{
|
||||
if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
|
||||
writer.WriteStringValue("tD_ID", TDID);
|
||||
writer.WriteStringValue("tD_MEDIUM", TDMEDIUM);
|
||||
writer.WriteStringValue("tD_NAME", TDNAME);
|
||||
writer.WriteStringValue("tD_NUMBER", TDNUMBER);
|
||||
writer.WriteStringValue("tD_NUMBER_TAPI", TDNUMBERTAPI);
|
||||
writer.WriteAdditionalData(AdditionalData);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,102 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0618
|
||||
using CPATapi.Client.Models;
|
||||
using Microsoft.Kiota.Abstractions.Extensions;
|
||||
using Microsoft.Kiota.Abstractions.Serialization;
|
||||
using Microsoft.Kiota.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System;
|
||||
namespace CPATapi.Client.Search
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds and executes requests for operations under \Search
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class SearchRequestBuilder : BaseRequestBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Search.SearchRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="pathParameters">Path parameters for the request</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public SearchRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search{?query*}", pathParameters)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="global::CPATapi.Client.Search.SearchRequestBuilder"/> and sets the default values.
|
||||
/// </summary>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
|
||||
public SearchRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/Search{?query*}", rawUrl)
|
||||
{
|
||||
}
|
||||
/// <returns>A List<global::CPATapi.Client.Models.TapiContact></returns>
|
||||
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public async Task<List<global::CPATapi.Client.Models.TapiContact>?> GetAsync(Action<RequestConfiguration<global::CPATapi.Client.Search.SearchRequestBuilder.SearchRequestBuilderGetQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public async Task<List<global::CPATapi.Client.Models.TapiContact>> GetAsync(Action<RequestConfiguration<global::CPATapi.Client.Search.SearchRequestBuilder.SearchRequestBuilderGetQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = ToGetRequestInformation(requestConfiguration);
|
||||
var collectionResult = await RequestAdapter.SendCollectionAsync<global::CPATapi.Client.Models.TapiContact>(requestInfo, global::CPATapi.Client.Models.TapiContact.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
|
||||
return collectionResult?.AsList();
|
||||
}
|
||||
/// <returns>A <see cref="RequestInformation"/></returns>
|
||||
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::CPATapi.Client.Search.SearchRequestBuilder.SearchRequestBuilderGetQueryParameters>>? requestConfiguration = default)
|
||||
{
|
||||
#nullable restore
|
||||
#else
|
||||
public RequestInformation ToGetRequestInformation(Action<RequestConfiguration<global::CPATapi.Client.Search.SearchRequestBuilder.SearchRequestBuilderGetQueryParameters>> requestConfiguration = default)
|
||||
{
|
||||
#endif
|
||||
var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
|
||||
requestInfo.Configure(requestConfiguration);
|
||||
requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9");
|
||||
return requestInfo;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="global::CPATapi.Client.Search.SearchRequestBuilder"/></returns>
|
||||
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
|
||||
public global::CPATapi.Client.Search.SearchRequestBuilder WithUrl(string rawUrl)
|
||||
{
|
||||
return new global::CPATapi.Client.Search.SearchRequestBuilder(rawUrl, RequestAdapter);
|
||||
}
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
#pragma warning disable CS1591
|
||||
public partial class SearchRequestBuilderGetQueryParameters
|
||||
#pragma warning restore CS1591
|
||||
{
|
||||
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
|
||||
#nullable enable
|
||||
[QueryParameter("query")]
|
||||
public string? Query { get; set; }
|
||||
#nullable restore
|
||||
#else
|
||||
[QueryParameter("query")]
|
||||
public string Query { get; set; }
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// Configuration for the request such as headers, query parameters, and middleware options.
|
||||
/// </summary>
|
||||
[Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
|
||||
public partial class SearchRequestBuilderGetRequestConfiguration : RequestConfiguration<global::CPATapi.Client.Search.SearchRequestBuilder.SearchRequestBuilderGetQueryParameters>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618
|
||||
@@ -0,0 +1,53 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Kiota.Abstractions.Authentication;
|
||||
using Microsoft.Kiota.Http.HttpClientLibrary;
|
||||
|
||||
namespace CPATapi.Client;
|
||||
|
||||
public static class ServiceExtensions
|
||||
{
|
||||
public static IServiceCollection AddCPATapiClient(this IServiceCollection services, Action<IServiceProvider, HttpClient> configureOptions)
|
||||
{
|
||||
services.AddKiotaHandlers();
|
||||
services.AddHttpClient<CPATapiClientFactory>((sp, client) =>
|
||||
{
|
||||
configureOptions.Invoke(sp, client);
|
||||
}).AttachKiotaHandlers();
|
||||
services.AddTransient(sp => sp.GetRequiredService<CPATapiClientFactory>().GetClient());
|
||||
return services;
|
||||
}
|
||||
|
||||
private static IServiceCollection AddKiotaHandlers(this IServiceCollection services)
|
||||
{
|
||||
var handlers = KiotaClientFactory.GetDefaultHandlerActivatableTypes();
|
||||
foreach (var handler in handlers)
|
||||
{
|
||||
if (services.All(s => s.ServiceType != handler))
|
||||
{
|
||||
services.AddScoped(handler);
|
||||
}
|
||||
}
|
||||
return services;
|
||||
}
|
||||
|
||||
private static IHttpClientBuilder AttachKiotaHandlers(this IHttpClientBuilder builder)
|
||||
{
|
||||
var handlers = KiotaClientFactory.GetDefaultHandlerActivatableTypes();
|
||||
foreach (var handler in handlers)
|
||||
{
|
||||
builder.AddHttpMessageHandler((sp) => (DelegatingHandler)sp.GetRequiredService(handler));
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
internal class CPATapiClientFactory(HttpClient httpClient)
|
||||
{
|
||||
private readonly HttpClient _httpClient = httpClient;
|
||||
private readonly AnonymousAuthenticationProvider _authenticationProvider = new();
|
||||
|
||||
public CPATapiClient GetClient()
|
||||
{
|
||||
return new CPATapiClient(new HttpClientRequestAdapter(_authenticationProvider, httpClient: _httpClient));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"descriptionHash": "1B47F98D82C5E24FB3ABEDB3BF90615424A8F19620EA2621D23B7FC69F4F7BF27D512A11098EF4D8940C7D243DEEB59C0CA038264430AD9150B612F5046C8146",
|
||||
"descriptionLocation": "../CPATapi.Server/CPATapi.Server.json",
|
||||
"lockFileVersion": "1.0.0",
|
||||
"kiotaVersion": "1.30.0",
|
||||
"clientClassName": "CPATapiClient",
|
||||
"typeAccessModifier": "Public",
|
||||
"clientNamespaceName": "CPATapi.Client",
|
||||
"language": "CSharp",
|
||||
"usesBackingStore": false,
|
||||
"excludeBackwardCompatible": false,
|
||||
"includeAdditionalData": true,
|
||||
"disableSSLValidation": false,
|
||||
"serializers": [
|
||||
"Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory",
|
||||
"Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory",
|
||||
"Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory",
|
||||
"Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory"
|
||||
],
|
||||
"deserializers": [
|
||||
"Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory",
|
||||
"Microsoft.Kiota.Serialization.Text.TextParseNodeFactory",
|
||||
"Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
|
||||
],
|
||||
"structuredMimeTypes": [
|
||||
"application/json",
|
||||
"text/plain;q=0.9",
|
||||
"application/x-www-form-urlencoded;q=0.2",
|
||||
"multipart/form-data;q=0.1"
|
||||
],
|
||||
"includePatterns": [],
|
||||
"excludePatterns": [],
|
||||
"disabledValidationRules": []
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
CPATapi.Server.json
|
||||
@@ -7,16 +7,23 @@
|
||||
<UserSecretsId>a7b40068-a2f6-4c63-bbd9-0fd346908fb0</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<OpenApiDocumentsDirectory>.</OpenApiDocumentsDirectory>
|
||||
<Version>9.4.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Dapper" Version="2.1.72" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="10.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.9.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.7" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -14,6 +14,8 @@ builder.Services.AddSerilog(config =>
|
||||
.WriteTo.Console();
|
||||
});
|
||||
|
||||
builder.Services.AddOpenApi();
|
||||
|
||||
builder.Services.AddTransient<ITapiDirectoryRepository, TapiDirectoryRepository>();
|
||||
builder.Services.AddTransient<IZeitConsensRepository, ZeitConsensRepository>();
|
||||
|
||||
@@ -28,6 +30,12 @@ if (app.Environment.IsDevelopment())
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.MapOpenApi();
|
||||
app.UseSwaggerUI(options =>
|
||||
{
|
||||
options.SwaggerEndpoint("/openapi/v1.json", "v1");
|
||||
});
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "contact",
|
||||
"launchUrl": "swagger/index.html",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
|
||||
<PackageReference Include="NUnit" Version="4.3.2" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.7.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\CPATapi.Client\CPATapi.Client.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="NUnit.Framework" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,45 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace CPATapi.Client.Tests;
|
||||
|
||||
public class CPATapiClientTests
|
||||
{
|
||||
private IServiceScope CreateServices()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
services.AddCPATapiClient(((provider, client) =>
|
||||
{
|
||||
client.BaseAddress = new Uri("https://3cxtapi.cp-austria.at/");
|
||||
}));
|
||||
var sp = services.BuildServiceProvider();
|
||||
return sp.CreateScope();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestContactsGet()
|
||||
{
|
||||
using var scope = CreateServices();
|
||||
var client = scope.ServiceProvider.GetRequiredService<CPATapiClient>();
|
||||
var contacts = await client.Contact.GetAsync();
|
||||
Assert.That(contacts, Is.Not.Null);
|
||||
Assert.That(contacts, Is.Not.Empty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestAvailabilityGet()
|
||||
{
|
||||
using var scope = CreateServices();
|
||||
var client = scope.ServiceProvider.GetRequiredService<CPATapiClient>();
|
||||
var availability = await client.Availability["CPATRD"].GetAsync();
|
||||
Assert.That(availability, Is.Not.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task TestAvailabilityGetUnknown()
|
||||
{
|
||||
using var scope = CreateServices();
|
||||
var client = scope.ServiceProvider.GetRequiredService<CPATapiClient>();
|
||||
var availability = await client.Availability["Unknown"].GetAsync();
|
||||
Assert.That(availability, Is.Not.Null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user