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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#nullable enable

namespace Descript
{
public partial interface IApiEndpointsClient
{
/// <summary>
/// Get project details<br/>
/// Get a detailed project summary including all media files and compositions.<br/>
/// Returns the project's id, name, drive_id, a map of media files (keyed by<br/>
/// display path) with type and duration, and a list of compositions with id,<br/>
/// name, duration, and media type.<br/>
/// Use this to inspect a project's contents before editing or importing media.
/// </summary>
/// <param name="projectId"></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::Descript.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Descript.GetProjectResponse> GetProjectAsync(
global::System.Guid projectId,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#nullable enable

namespace Descript
{
public partial interface IApiEndpointsClient
{
/// <summary>
/// List projects<br/>
/// List projects accessible to the authenticated user within a drive.<br/>
/// The drive is determined from the access token.<br/>
/// Results are paginated. Use the `cursor` from the response `pagination.next_cursor`<br/>
/// to fetch subsequent pages.
/// </summary>
/// <param name="name"></param>
/// <param name="createdBy"></param>
/// <param name="createdAfter"></param>
/// <param name="createdBefore"></param>
/// <param name="updatedAfter"></param>
/// <param name="updatedBefore"></param>
/// <param name="sort">
/// Default Value: created_at
/// </param>
/// <param name="direction">
/// Default Value: desc
/// </param>
/// <param name="cursor"></param>
/// <param name="limit">
/// Default Value: 20
/// </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::Descript.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Descript.ListProjectsResponse> ListProjectsAsync(
string? name = default,
global::System.Guid? createdBy = default,
global::System.DateTime? createdAfter = default,
global::System.DateTime? createdBefore = default,
global::System.DateTime? updatedAfter = default,
global::System.DateTime? updatedBefore = default,
global::Descript.ListProjectsSort? sort = default,
global::Descript.ListProjectsDirection? direction = default,
string? cursor = default,
int? limit = default,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#nullable enable

namespace Descript
{
public partial interface IApiEndpointsClient
{
/// <summary>
/// Publish project media<br/>
/// Publish a project composition to create a shareable link and download the exported file.<br/>
/// Publishes a specific composition from a project, rendering the output as video or audio<br/>
/// at the specified resolution. When the job completes successfully the result contains both:<br/>
/// - `share_url`: a public URL that can be used to view the published content on Descript's share site.<br/>
/// - `download_url`: a time-limited signed URL to download the exported media file directly,<br/>
/// along with `download_url_expires_at` indicating when the link expires.<br/>
/// ### Async Operations<br/>
/// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,<br/>
/// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.<br/>
/// ### Dynamic webhook<br/>
/// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.<br/>
/// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob).
/// </summary>
/// <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::Descript.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Descript.PublishJobResponse> PublishJobAsync(

global::Descript.PublishJobRequest request,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Publish project media<br/>
/// Publish a project composition to create a shareable link and download the exported file.<br/>
/// Publishes a specific composition from a project, rendering the output as video or audio<br/>
/// at the specified resolution. When the job completes successfully the result contains both:<br/>
/// - `share_url`: a public URL that can be used to view the published content on Descript's share site.<br/>
/// - `download_url`: a time-limited signed URL to download the exported media file directly,<br/>
/// along with `download_url_expires_at` indicating when the link expires.<br/>
/// ### Async Operations<br/>
/// Publish jobs run in the background and return a `job_id`. Monitor progress via the [GET /jobs/{job_id}](#operation/getJob) endpoint,<br/>
/// which returns the `share_url`, `download_url`, and `download_url_expires_at` fields once the job finishes.<br/>
/// ### Dynamic webhook<br/>
/// If `callback_url` is provided, Descript will POST the job status to that URL when the job completes or fails.<br/>
/// The payload will match the format returned by [GET /jobs/{job_id}](#operation/getJob).
/// </summary>
/// <param name="projectId">
/// The ID of the project to publish.<br/>
/// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb
/// </param>
/// <param name="compositionId">
/// The ID of the composition within the project to publish.<br/>
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5
/// </param>
/// <param name="mediaType">
/// Media type of the published output.<br/>
/// Default Value: Video
/// </param>
/// <param name="resolution">
/// Resolution for the published output. Only applicable when media_type is Video.
/// </param>
/// <param name="callbackUrl">
/// Optional webhook URL to call when the job completes or fails.<br/>
/// Descript will POST the job status (same format as [GET /jobs/{job_id}](#operation/getJob)) to this URL.<br/>
/// Example: https://example.com/webhooks/descript/job_callback
/// </param>
/// <param name="accessLevel">
/// Desired access level for the published share page.<br/>
/// If omitted, the drive's configured default is used.<br/>
/// Returns 403 if the requested level is not permitted by the drive's publish settings<br/>
/// (e.g. requesting `public` when search engine indexing is disabled).
/// </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::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Descript.PublishJobResponse> PublishJobAsync(
global::System.Guid projectId,
global::System.Guid? compositionId = default,
global::Descript.PublishJobRequestMediaType? mediaType = default,
global::Descript.PublishJobRequestResolution? resolution = default,
string? callbackUrl = default,
global::Descript.PublishJobRequestAccessLevel? accessLevel = default,
global::Descript.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Descript.JsonConverters
{
/// <inheritdoc />
public sealed class GetProjectResponseMediaFilesTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Descript.GetProjectResponseMediaFilesType>
{
/// <inheritdoc />
public override global::Descript.GetProjectResponseMediaFilesType 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::Descript.GetProjectResponseMediaFilesTypeExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

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

namespace Descript.JsonConverters
{
/// <inheritdoc />
public sealed class GetProjectResponseMediaFilesTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Descript.GetProjectResponseMediaFilesType?>
{
/// <inheritdoc />
public override global::Descript.GetProjectResponseMediaFilesType? 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::Descript.GetProjectResponseMediaFilesTypeExtensions.ToEnum(stringValue);
}

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

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Descript.GetProjectResponseMediaFilesType? 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::Descript.GetProjectResponseMediaFilesTypeExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,21 @@ public class JobStatusJsonConverter : global::System.Text.Json.Serialization.Jso
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.AgentJobStatus)}");
agent = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
global::Descript.PublishJobStatus? publish = default;
if (discriminator?.JobType == global::Descript.JobStatusDiscriminatorJobType.Publish)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishJobStatus), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Descript.PublishJobStatus> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::Descript.PublishJobStatus)}");
publish = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}

var __value = new global::Descript.JobStatus(
discriminator?.JobType,
importProjectMedia,

agent
agent,

publish
);

return __value;
Expand All @@ -67,6 +76,12 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.AgentJobStatus).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Agent!, typeInfo);
}
else if (value.IsPublish)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Descript.PublishJobStatus), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Descript.PublishJobStatus?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Descript.PublishJobStatus).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Publish!, typeInfo);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Descript.JsonConverters
{
/// <inheritdoc />
public sealed class ListProjectsDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Descript.ListProjectsDirection>
{
/// <inheritdoc />
public override global::Descript.ListProjectsDirection 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::Descript.ListProjectsDirectionExtensions.ToEnum(stringValue) ?? default;
}

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

return default;
}

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

writer.WriteStringValue(global::Descript.ListProjectsDirectionExtensions.ToValueString(value));
}
}
}
Loading