-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14a1fe6
commit da56a8b
Showing
31 changed files
with
2,161 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
...Admin/Realms/Item/Organizations/Item/IdentityProviders/IdentityProvidersRequestBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
// <auto-generated/> | ||
using Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.Item; | ||
using Keycloak.AuthServices.Sdk.Kiota.Admin.Models; | ||
using Microsoft.Kiota.Abstractions.Serialization; | ||
using Microsoft.Kiota.Abstractions; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
using System; | ||
namespace Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders | ||
{ | ||
/// <summary> | ||
/// Builds and executes requests for operations under \admin\realms\{realm}\organizations\{id}\identity-providers | ||
/// </summary> | ||
public class IdentityProvidersRequestBuilder : BaseRequestBuilder | ||
{ | ||
/// <summary>Gets an item from the Keycloak.AuthServices.Sdk.Kiota.Admin.admin.realms.item.organizations.item.identityProviders.item collection</summary> | ||
/// <param name="position">Unique identifier of the item</param> | ||
/// <returns>A <see cref="Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.Item.WithAliasItemRequestBuilder"/></returns> | ||
public Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.Item.WithAliasItemRequestBuilder this[string position] | ||
{ | ||
get | ||
{ | ||
var urlTplParams = new Dictionary<string, object>(PathParameters); | ||
urlTplParams.Add("alias", position); | ||
return new Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.Item.WithAliasItemRequestBuilder(urlTplParams, RequestAdapter); | ||
} | ||
} | ||
/// <summary> | ||
/// Instantiates a new <see cref="Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.IdentityProvidersRequestBuilder"/> 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 IdentityProvidersRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/admin/realms/{realm}/organizations/{id}/identity-providers", pathParameters) | ||
{ | ||
} | ||
/// <summary> | ||
/// Instantiates a new <see cref="Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.IdentityProvidersRequestBuilder"/> 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 IdentityProvidersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/admin/realms/{realm}/organizations/{id}/identity-providers", rawUrl) | ||
{ | ||
} | ||
/// <summary> | ||
/// Returns all identity providers associated with the organization | ||
/// </summary> | ||
/// <returns>A List<Keycloak.AuthServices.Sdk.Kiota.Admin.Models.IdentityProviderRepresentation></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<Keycloak.AuthServices.Sdk.Kiota.Admin.Models.IdentityProviderRepresentation>?> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#nullable restore | ||
#else | ||
public async Task<List<Keycloak.AuthServices.Sdk.Kiota.Admin.Models.IdentityProviderRepresentation>> GetAsync(Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#endif | ||
var requestInfo = ToGetRequestInformation(requestConfiguration); | ||
var collectionResult = await RequestAdapter.SendCollectionAsync<Keycloak.AuthServices.Sdk.Kiota.Admin.Models.IdentityProviderRepresentation>(requestInfo, Keycloak.AuthServices.Sdk.Kiota.Admin.Models.IdentityProviderRepresentation.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); | ||
return collectionResult?.ToList(); | ||
} | ||
/// <summary> | ||
/// Adds, or associates, an existing identity provider with the organization. If no identity provider is found, or if it is already associated with the organization, an error response is returned | ||
/// </summary> | ||
/// <returns>A <see cref="Stream"/></returns> | ||
/// <param name="body">The request body</param> | ||
/// <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<Stream?> PostAsync(string body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#nullable restore | ||
#else | ||
public async Task<Stream> PostAsync(string body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default, CancellationToken cancellationToken = default) | ||
{ | ||
#endif | ||
if(string.IsNullOrEmpty(body)) throw new ArgumentNullException(nameof(body)); | ||
var requestInfo = ToPostRequestInformation(body, requestConfiguration); | ||
return await RequestAdapter.SendPrimitiveAsync<Stream>(requestInfo, default, cancellationToken).ConfigureAwait(false); | ||
} | ||
/// <summary> | ||
/// Returns all identity providers associated with the organization | ||
/// </summary> | ||
/// <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> | ||
/// Adds, or associates, an existing identity provider with the organization. If no identity provider is found, or if it is already associated with the organization, an error response is returned | ||
/// </summary> | ||
/// <returns>A <see cref="RequestInformation"/></returns> | ||
/// <param name="body">The request body</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 RequestInformation ToPostRequestInformation(string body, Action<RequestConfiguration<DefaultQueryParameters>>? requestConfiguration = default) | ||
{ | ||
#nullable restore | ||
#else | ||
public RequestInformation ToPostRequestInformation(string body, Action<RequestConfiguration<DefaultQueryParameters>> requestConfiguration = default) | ||
{ | ||
#endif | ||
if(string.IsNullOrEmpty(body)) throw new ArgumentNullException(nameof(body)); | ||
var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); | ||
requestInfo.Configure(requestConfiguration); | ||
requestInfo.SetContentFromScalar(RequestAdapter, "application/json", body); | ||
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="Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.IdentityProvidersRequestBuilder"/></returns> | ||
/// <param name="rawUrl">The raw URL to use for the request builder.</param> | ||
public Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.IdentityProvidersRequestBuilder WithUrl(string rawUrl) | ||
{ | ||
return new Keycloak.AuthServices.Sdk.Kiota.Admin.Admin.Realms.Item.Organizations.Item.IdentityProviders.IdentityProvidersRequestBuilder(rawUrl, RequestAdapter); | ||
} | ||
} | ||
} |
Oops, something went wrong.