Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ProccesHttpTimeToLive into ProccesHttp setcontext #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -97,7 +97,7 @@ await context.SetVariableAsync(settings.ResponseStatusVariable,
if (!string.IsNullOrWhiteSpace(settings.ResponseBodyVariable) &&
!string.IsNullOrWhiteSpace(responseBody))
{
await context.SetVariableAsync(settings.ResponseBodyVariable, responseBody, cancellationToken);
await context.SetVariableAsync(settings.ResponseBodyVariable, responseBody, cancellationToken, settings.ProccesHttpTimeToLive);
}

if (!isSuccessStatusCode)
Expand Down Expand Up @@ -143,7 +143,7 @@ private void PushStatusCodeWarning(IContext context, int statusCode)
}

/// <summary>
/// Add 'X-Blip-User' header to request, with current user identity as its value, if there is
/// Add 'X-Blip-User' header to request, with current user identity as its value, if there is
/// a configuration variable 'processHttpAddUserToRequestHeader' set to true
/// </summary>
/// <param name="httpRequestMessage"></param>
Expand All @@ -157,7 +157,7 @@ private void AddUserToHeaders(HttpRequestMessage httpRequestMessage, IContext co
}

/// <summary>
/// Add 'X-Blip-Bot' header to request with the Bot's name as its value, if there is
/// Add 'X-Blip-Bot' header to request with the Bot's name as its value, if there is
/// a configuration variable 'processHttpAddBotIdentityToRequestHeader' set to true
/// </summary>
/// <param name="httpRequestMessage"></param>
Expand Down
38 changes: 38 additions & 0 deletions src/Take.Blip.Builder/Actions/ProcessHttp/ProcessHttpSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,62 @@

namespace Take.Blip.Builder.Actions.ProcessHttp
{
/// <summary>
/// Represents the settings required for processing an HTTP request.
/// </summary>
public class ProcessHttpSettings : IValidable
{
/// <summary>
/// Gets or sets the HTTP method (e.g., GET, POST).
/// </summary>
public string Method { get; set; }

/// <summary>
/// Gets or sets the URI for the HTTP request.
/// </summary>
public Uri Uri { get; set; }

/// <summary>
/// Gets or sets the headers for the HTTP request.
/// </summary>
public Dictionary<string, string> Headers { get; set; }

/// <summary>
/// Gets or sets the body of the HTTP request.
/// </summary>
public string Body { get; set; }

/// <summary>
/// Gets or sets the variable to store the response body.
/// </summary>
public string ResponseBodyVariable { get; set; }

/// <summary>
/// Gets or sets the variable to store the response status.
/// </summary>
public string ResponseStatusVariable { get; set; }

/// <summary>
/// Gets or sets the timeout for the HTTP request.
/// </summary>
public TimeSpan? RequestTimeout { get; set; }

/// <summary>
/// Gets or sets the current state ID.
/// </summary>
public string currentStateId { get; set; }

/// <summary>
/// Gets or sets the time-to-live for the HTTP process.
/// </summary>
public TimeSpan ProccesHttpTimeToLive { get; set; }

/// <summary>
/// Validates the settings to ensure required values are provided.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown when a required setting value is missing.
/// </exception>
public void Validate()
{
if (Uri == null)
Expand Down
Loading