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 @@ -9,6 +9,7 @@ public partial interface IScaleAIClient
/// Authorize using bearer authentication.
/// </summary>
/// <param name="apiKey"></param>

public void AuthorizeUsingBearer(
string apiKey);
}
Expand Down
34 changes: 34 additions & 0 deletions src/libs/ScaleAI/Generated/ScaleAI.PathBuilder.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,40 @@ public PathBuilder AddOptionalParameter<T>(
return this;
}

/// <summary>
/// Adds a pre-serialized query string fragment to the URL.
/// </summary>
/// <param name="value">The serialized query string value.</param>
/// <returns>The current <see cref="PathBuilder"/> instance.</returns>
public PathBuilder AddRawQueryString(
string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return this;
}

value = value.TrimStart('?', '&');
if (value.Length == 0)
{
return this;
}

if (_firstParameter)
{
_stringBuilder.Append('?');
_firstParameter = false;
}
else
{
_stringBuilder.Append('&');
}

_stringBuilder.Append(value);

return this;
}

/// <summary>
/// Returns the constructed URL as a string.
/// </summary>
Expand Down
29 changes: 27 additions & 2 deletions src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.AddTaskTags.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_AddTaskTagsSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_AddTaskTagsSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_AddTaskTagsSecurityRequirement0,
};
partial void PrepareAddTaskTagsArguments(
global::System.Net.Http.HttpClient httpClient,
ref string taskId,
Expand Down Expand Up @@ -46,9 +65,15 @@ partial void ProcessAddTaskTagsResponseContent(
taskId: ref taskId,
request: request);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_AddTaskTagsSecurityRequirements,
operationName: "AddTaskTagsAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: $"/task/{taskId}/tags",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -58,7 +83,7 @@ partial void ProcessAddTaskTagsResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_AssignTeammatesSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_AssignTeammatesSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_AssignTeammatesSecurityRequirement0,
};
partial void PrepareAssignTeammatesArguments(
global::System.Net.Http.HttpClient httpClient,
global::ScaleAI.AssignTeamRequest request);
Expand Down Expand Up @@ -41,9 +60,15 @@ partial void ProcessAssignTeammatesResponseContent(
httpClient: HttpClient,
request: request);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_AssignTeammatesSecurityRequirements,
operationName: "AssignTeammatesAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: "/studio/assignments/add",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -53,7 +78,7 @@ partial void ProcessAssignTeammatesResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@ namespace ScaleAI
{
public sealed partial class ScaleAIClient
{

/// <inheritdoc/>
public void AuthorizeUsingBearer(
string apiKey)
{
apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey));

Authorizations.Clear();
for (var i = Authorizations.Count - 1; i >= 0; i--)
{
var __authorization = Authorizations[i];
if (__authorization.Type == "Http" &&
__authorization.Name == "Bearer")
{
Authorizations.RemoveAt(i);
}
}

Authorizations.Add(new global::ScaleAI.EndPointAuthorization
{
Type = "Http",
Expand Down
29 changes: 27 additions & 2 deletions src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CancelTask.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_CancelTaskSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_CancelTaskSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_CancelTaskSecurityRequirement0,
};
partial void PrepareCancelTaskArguments(
global::System.Net.Http.HttpClient httpClient,
ref string taskId,
Expand Down Expand Up @@ -43,12 +62,18 @@ partial void ProcessCancelTaskResponseContent(
taskId: ref taskId,
clearUniqueId: ref clearUniqueId);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_CancelTaskSecurityRequirements,
operationName: "CancelTaskAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: $"/task/{taskId}/cancel",
baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("clear_unique_id", clearUniqueId?.ToString().ToLowerInvariant())
;
;
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -58,7 +83,7 @@ partial void ProcessCancelTaskResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace ScaleAI
public sealed partial class ScaleAIClient
{
/// <inheritdoc cref="ScaleAIClient(global::System.Net.Http.HttpClient?, global::System.Uri?, global::System.Collections.Generic.List{global::ScaleAI.EndPointAuthorization}?, bool)"/>

public ScaleAIClient(
string apiKey,
global::System.Net.Http.HttpClient? httpClient = null,
Expand Down
29 changes: 27 additions & 2 deletions src/libs/ScaleAI/Generated/ScaleAI.ScaleAIClient.CreateBatch.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_CreateBatchSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_CreateBatchSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_CreateBatchSecurityRequirement0,
};
partial void PrepareCreateBatchArguments(
global::System.Net.Http.HttpClient httpClient,
global::ScaleAI.CreateBatchRequest request);
Expand Down Expand Up @@ -41,9 +60,15 @@ partial void ProcessCreateBatchResponseContent(
httpClient: HttpClient,
request: request);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_CreateBatchSecurityRequirements,
operationName: "CreateBatchAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: "/batches",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -53,7 +78,7 @@ partial void ProcessCreateBatchResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_CreateProjectSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_CreateProjectSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_CreateProjectSecurityRequirement0,
};
partial void PrepareCreateProjectArguments(
global::System.Net.Http.HttpClient httpClient,
global::ScaleAI.CreateProjectRequest request);
Expand Down Expand Up @@ -41,9 +60,15 @@ partial void ProcessCreateProjectResponseContent(
httpClient: HttpClient,
request: request);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_CreateProjectSecurityRequirements,
operationName: "CreateProjectAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: "/projects",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -53,7 +78,7 @@ partial void ProcessCreateProjectResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ namespace ScaleAI
{
public partial class ScaleAIClient
{


private static readonly global::ScaleAI.EndPointSecurityRequirement s_CreateProjectGroupSecurityRequirement0 =
new global::ScaleAI.EndPointSecurityRequirement
{
Authorizations = new global::ScaleAI.EndPointAuthorizationRequirement[]
{ new global::ScaleAI.EndPointAuthorizationRequirement
{
Type = "Http",
Location = "Header",
Name = "Bearer",
FriendlyName = "Bearer",
},
},
};
private static readonly global::ScaleAI.EndPointSecurityRequirement[] s_CreateProjectGroupSecurityRequirements =
new global::ScaleAI.EndPointSecurityRequirement[]
{ s_CreateProjectGroupSecurityRequirement0,
};
partial void PrepareCreateProjectGroupArguments(
global::System.Net.Http.HttpClient httpClient,
ref string projectName,
Expand Down Expand Up @@ -46,9 +65,15 @@ partial void ProcessCreateProjectGroupResponseContent(
projectName: ref projectName,
request: request);


var __authorizations = global::ScaleAI.EndPointSecurityResolver.ResolveAuthorizations(
availableAuthorizations: Authorizations,
securityRequirements: s_CreateProjectGroupSecurityRequirements,
operationName: "CreateProjectGroupAsync");

var __pathBuilder = new global::ScaleAI.PathBuilder(
path: $"/studio/projects/{projectName}/groups",
baseUri: HttpClient.BaseAddress);
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
Expand All @@ -58,7 +83,7 @@ partial void ProcessCreateProjectGroupResponseContent(
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
foreach (var __authorization in __authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
Expand Down
Loading