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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#nullable enable

namespace Vercel
{
public partial interface IProjectsClient
{
/// <summary>
/// Upload a project avatar<br/>
/// Upload an image as the avatar of the project identified by `idOrName`. The request body is the raw bytes of a JPG, PNG, or SVG image; the `Content-Type` header must declare which. SVG payloads are sanitized and optimized server-side before storage. The final SHA-1 of the stored bytes becomes the project's `avatar` value.
/// </summary>
/// <param name="idOrName">
/// The unique project identifier or the project name.
/// </param>
/// <param name="teamId">
/// Example: team_1a2b3c4d5e6f7g8h9i0j1k2l
/// </param>
/// <param name="slug">
/// Example: my-team-url-slug
/// </param>
/// <param name="request"></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::Vercel.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Vercel.UploadProjectAvatarResponse> UploadProjectAvatarAsync(
string idOrName,

byte[] request,
string? teamId = default,
string? slug = default,
global::Vercel.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Upload a project avatar<br/>
/// Upload an image as the avatar of the project identified by `idOrName`. The request body is the raw bytes of a JPG, PNG, or SVG image; the `Content-Type` header must declare which. SVG payloads are sanitized and optimized server-side before storage. The final SHA-1 of the stored bytes becomes the project's `avatar` value.
/// </summary>
/// <param name="idOrName">
/// The unique project identifier or the project name.
/// </param>
/// <param name="teamId">
/// Example: team_1a2b3c4d5e6f7g8h9i0j1k2l
/// </param>
/// <param name="slug">
/// Example: my-team-url-slug
/// </param>
/// <param name="request"></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::Vercel.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Vercel.AutoSDKHttpResponse<global::Vercel.UploadProjectAvatarResponse>> UploadProjectAvatarAsResponseAsync(
string idOrName,

byte[] request,
string? teamId = default,
string? slug = default,
global::Vercel.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment>
public sealed class UploadProjectAvatarResponseAbuseBlockActionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockAction>
{
/// <inheritdoc />
public override global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment Read(
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockAction Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataIte
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentExtensions.ToEnum(stringValue) ?? default;
return global::Vercel.UploadProjectAvatarResponseAbuseBlockActionExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment)numValue;
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockAction)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment);
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockAction);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,12 +42,12 @@ public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataIte
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment value,
global::Vercel.UploadProjectAvatarResponseAbuseBlockAction value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentExtensions.ToValueString(value));
writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockActionExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment?>
public sealed class UploadProjectAvatarResponseAbuseBlockActionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockAction?>
{
/// <inheritdoc />
public override global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment? Read(
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockAction? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataIte
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentExtensions.ToEnum(stringValue);
return global::Vercel.UploadProjectAvatarResponseAbuseBlockActionExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment)numValue;
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockAction)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment?);
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockAction?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,7 +42,7 @@ public sealed class CreateIntegrationStoreDirectResponseStoreProjectsMetadataIte
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironment? value,
global::Vercel.UploadProjectAvatarResponseAbuseBlockAction? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -53,7 +53,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::Vercel.CreateIntegrationStoreDirectResponseStoreProjectsMetadataItemEnvironmentExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockActionExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action>
{
/// <inheritdoc />
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action?>
{
/// <inheritdoc />
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1Action? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant1ActionExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action>
{
/// <inheritdoc />
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Vercel.JsonConverters
{
/// <inheritdoc />
public sealed class UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action?>
{
/// <inheritdoc />
public override global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2Action? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Vercel.UploadProjectAvatarResponseAbuseBlockHistoryItemVariant2ActionExtensions.ToValueString(value.Value));
}
}
}
}
Loading