Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ partial void ProcessAdminCreateBotResponse(
string? xMultipleIntegrations = default,
global::Botpress.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
await AdminCreateBotAsResponseAsync(
xWorkspaceId: xWorkspaceId,
xMultipleIntegrations: xMultipleIntegrations,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);
}
/// <summary>
/// Create bot
/// </summary>
/// <param name="xWorkspaceId"></param>
/// <param name="xMultipleIntegrations"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Botpress.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Botpress.AutoSDKHttpResponse> AdminCreateBotAsResponseAsync(
string xWorkspaceId,
string? xMultipleIntegrations = default,
global::Botpress.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -81,6 +102,7 @@ partial void ProcessAdminCreateBotResponse(

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::Botpress.PathBuilder(
path: "/v1/admin/bots",
baseUri: HttpClient.BaseAddress);
Expand Down Expand Up @@ -162,6 +184,8 @@ partial void ProcessAdminCreateBotResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -172,6 +196,11 @@ partial void ProcessAdminCreateBotResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::Botpress.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Botpress.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -189,6 +218,8 @@ partial void ProcessAdminCreateBotResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -198,8 +229,7 @@ partial void ProcessAdminCreateBotResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Botpress.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -208,6 +238,11 @@ partial void ProcessAdminCreateBotResponse(
__attempt < __maxAttempts &&
global::Botpress.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::Botpress.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::Botpress.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Botpress.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -224,14 +259,15 @@ partial void ProcessAdminCreateBotResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Botpress.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -271,6 +307,8 @@ partial void ProcessAdminCreateBotResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -291,6 +329,8 @@ partial void ProcessAdminCreateBotResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
//
Expand Down Expand Up @@ -344,6 +384,10 @@ partial void ProcessAdminCreateBotResponse(
{
__response.EnsureSuccessStatusCode();

return new global::Botpress.AutoSDKHttpResponse(
statusCode: __response.StatusCode,
headers: global::Botpress.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
Expand All @@ -365,6 +409,10 @@ partial void ProcessAdminCreateBotResponse(
try
{
__response.EnsureSuccessStatusCode();
return new global::Botpress.AutoSDKHttpResponse(
statusCode: __response.StatusCode,
headers: global::Botpress.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ partial void ProcessAdminCreateIntegrationResponse(
string? xMultipleIntegrations = default,
global::Botpress.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
await AdminCreateIntegrationAsResponseAsync(
xWorkspaceId: xWorkspaceId,
xMultipleIntegrations: xMultipleIntegrations,
requestOptions: requestOptions,
cancellationToken: cancellationToken
).ConfigureAwait(false);
}
/// <summary>
/// Create integration
/// </summary>
/// <param name="xWorkspaceId"></param>
/// <param name="xMultipleIntegrations"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Botpress.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::Botpress.AutoSDKHttpResponse> AdminCreateIntegrationAsResponseAsync(
string xWorkspaceId,
string? xMultipleIntegrations = default,
global::Botpress.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -81,6 +102,7 @@ partial void ProcessAdminCreateIntegrationResponse(

global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{

var __pathBuilder = new global::Botpress.PathBuilder(
path: "/v1/admin/integrations",
baseUri: HttpClient.BaseAddress);
Expand Down Expand Up @@ -162,6 +184,8 @@ partial void ProcessAdminCreateIntegrationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
Expand All @@ -172,6 +196,11 @@ partial void ProcessAdminCreateIntegrationResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
var __retryDelay = global::Botpress.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: null,
attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Botpress.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
Expand All @@ -189,6 +218,8 @@ partial void ProcessAdminCreateIntegrationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
Expand All @@ -198,8 +229,7 @@ partial void ProcessAdminCreateIntegrationResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Botpress.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand All @@ -208,6 +238,11 @@ partial void ProcessAdminCreateIntegrationResponse(
__attempt < __maxAttempts &&
global::Botpress.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
var __retryDelay = global::Botpress.AutoSDKRequestOptionsSupport.GetRetryDelay(
clientOptions: Options,
requestOptions: requestOptions,
response: __response,
attempt: __attempt);
await global::Botpress.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Botpress.AutoSDKRequestOptionsSupport.CreateHookContext(
Expand All @@ -224,14 +259,15 @@ partial void ProcessAdminCreateIntegrationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
retryDelay: __retryDelay,
retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Botpress.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
clientOptions: Options,
requestOptions: requestOptions,
retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
Expand Down Expand Up @@ -271,6 +307,8 @@ partial void ProcessAdminCreateIntegrationResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
Expand All @@ -291,6 +329,8 @@ partial void ProcessAdminCreateIntegrationResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
retryDelay: null,
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
//
Expand Down Expand Up @@ -344,6 +384,10 @@ partial void ProcessAdminCreateIntegrationResponse(
{
__response.EnsureSuccessStatusCode();

return new global::Botpress.AutoSDKHttpResponse(
statusCode: __response.StatusCode,
headers: global::Botpress.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
Expand All @@ -365,6 +409,10 @@ partial void ProcessAdminCreateIntegrationResponse(
try
{
__response.EnsureSuccessStatusCode();
return new global::Botpress.AutoSDKHttpResponse(
statusCode: __response.StatusCode,
headers: global::Botpress.AutoSDKHttpResponse.CreateHeaders(__response),
requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
Expand Down
Loading