From da7267af2789e49243d138e15261ddb0d407eeec Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Fri, 14 Aug 2026 14:36:24 +0530 Subject: [PATCH 1/7] updated readme seo aeo --- README.md | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96c6a09..6f31220 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,26 @@ # FastPix Java SDK +[![Maven Central](https://img.shields.io/maven-central/v/io.fastpix/sdk)](https://central.sonatype.com/artifact/io.fastpix/sdk) +[![license](https://img.shields.io/github/license/FastPix/fastpix-java)](https://github.com/FastPix/fastpix-java/blob/main/LICENSE) +[![Java 11+](https://img.shields.io/badge/Java-11%2B-007396?logo=openjdk&logoColor=white)](https://www.oracle.com/java/) + A robust, type-safe Java SDK designed for seamless integration with the FastPix API platform. +The FastPix Java SDK is a type-safe Java client for the FastPix video API. From any Java 11+ application (Maven or Gradle) you can upload and manage videos, run live streams and simulcasts, create and secure playback IDs, manage playlists and signing keys, pull video analytics (views, metrics, dimensions, and errors), and drive in-video AI features such as subtitles, chapters, summaries, and content moderation - with both synchronous and asynchronous APIs. + +**Works with:** Java 11+ 路 Maven and Gradle 路 sync and async (CompletableFuture / Reactive Streams) 路 Spring Boot and any JVM app 路 Maven Central `io.fastpix:sdk` + +馃摉 **Docs:** https://fastpix.com/docs/language-sdks/java-sdk  路  馃殌 **Free account:** https://dashboard.fastpix.com + +
+ ## Introduction The FastPix Java SDK simplifies integration with the FastPix platform. It provides a clean, type-safe interface for secure and efficient communication with the FastPix API, enabling easy management of media uploads, live streaming, on鈥慸emand content, playlists, video analytics, and signing keys for secure access and token management. It is intended for use with Java 11 and above. +
+ ## Prerequisites ### Environment and Version Support @@ -19,6 +33,8 @@ The FastPix Java SDK simplifies integration with the FastPix platform. It provid > Pro Tip: We recommend using Java 17+ for optimal performance and the latest language features. +
+ ### Getting Started with FastPix To get started with the FastPix Java SDK, ensure you have the following: @@ -38,6 +54,8 @@ export FASTPIX_PASSWORD="your-secret-key" > Security Note: Never commit your credentials to version control. Use environment variables or secure credential management systems. +
+ ## Table of Contents * [FastPix Java SDK](#fastpix-java-sdk) @@ -50,8 +68,12 @@ export FASTPIX_PASSWORD="your-secret-key" * [Server Selection](#server-selection) * [Custom HTTP Client](#custom-http-client) * [Debugging](#debugging) + * [FAQ](#faq) + * [Which FastPix SDK should I use?](#which-fastpix-sdk-should-i-use) * [Development](#development) +
+ ## Setup ### Installation @@ -106,6 +128,8 @@ If you wish to build from source and publish the SDK artifact to your local Mave gradlew.bat publishToMavenLocal -Pskip.signing ``` +
+ ### Initialization Initialize the FastPix SDK with your credentials: @@ -138,6 +162,20 @@ FastPixSDK sdk = FastPixSDK.builder() .build(); ``` +
+ +### Verify Installation + +Run a simple API request to confirm your credentials and SDK configuration are working correctly. + +```java +sdk.manageVideos() + .list() + .call(); +``` + +
+ ## Example Usage > **Note:** In the examples below, `package hello.world;` is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is at `src/main/java/com/example/MyApp.java`, use `package com.example;`). @@ -189,6 +227,8 @@ public class Application { } ``` +
+ ## Asynchronous Support The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture`][comp-fut] and [Reactive Streams `Publisher`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library. @@ -292,6 +332,8 @@ public class Application { [comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html [reactive-streams]: https://www.reactive-streams.org/ +
+ ## Available Resources and Operations Comprehensive Java SDK for FastPix platform integration with full API coverage. @@ -441,6 +483,8 @@ Enhance video content with AI-powered features including moderation, summarizati +
+ ## Retries Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. @@ -569,6 +613,18 @@ public class Application { } ``` +
+ +## Rate Limits + +The FastPix API enforces rate limits to help maintain platform stability. + +When a rate limit is exceeded, the API returns an HTTP `429 Too Many Requests` response. + +We recommend using the SDK retry functionality described in the Retries section to automatically handle temporary rate limiting and transient failures. + +
+ ## Error Handling [`FastpixException`](./src/main/java/models/errors/FastpixException.java) is the base class for all HTTP error responses. It has the following properties: @@ -649,6 +705,8 @@ public class Application { } ``` +
+ ### Error Classes **Primary error:** @@ -669,6 +727,8 @@ many more subclasses in the JDK platform). +
+ ## Server Selection ### Override Server URL Per-Client @@ -723,6 +783,8 @@ public class Application { } ``` +
+ ## Custom HTTP Client The Java SDK makes API calls using an `HTTPClient` that wraps the native @@ -841,6 +903,8 @@ public class Application { +
+ ## Debugging ### Debug & Logging @@ -895,6 +959,8 @@ Configure logging levels in your `logback.xml`: - **Streaming**: Stream initialization, item processing, closure - **Hooks**: Hook execution counts, operation IDs, exceptions +
+ #### Legacy Debug Logging For backward compatibility, you can still use the legacy debug logging method: @@ -929,7 +995,75 @@ Response body: Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this option does not log request/response bodies. -# Development +
+ +## FAQ + +**How do I install the FastPix Java SDK?** + +Add `io.fastpix:sdk` to your build - `implementation 'io.fastpix:sdk:'` for Gradle, or the equivalent `` for Maven. See [Setup](#setup) and [Installation](#installation). + +**How do I authenticate the SDK?** + +FastPix uses Basic Auth: build a `Security` with your access token as `username` and secret key as `password`, then pass it to `FastPixSDK.builder()`. See [Initialization](#initialization). + +**How do I upload a video in Java?** + +Create media from a URL or a direct upload through `sdk.inputVideos()`. See [Example Usage](#example-usage) and [Available Resources and Operations](#available-resources-and-operations). + +**Does the SDK support async / reactive?** + +Yes - it provides asynchronous APIs using `CompletableFuture` and Reactive Streams `Publisher`, so it integrates with Reactor, RxJava, and other reactive libraries. See [Asynchronous Support](#asynchronous-support). + +**How do I start a live stream?** + +Use the Live API resources to create and manage streams, simulcasts, and live playback IDs. See [Available Resources and Operations](#available-resources-and-operations). + +**How do I get video analytics and metrics in Java?** + +The Video Data API exposes metrics, views, dimensions, and errors for quality-of-experience monitoring. See [Available Resources and Operations](#available-resources-and-operations). + +**How do I handle API errors?** + +Catch `FastpixException` (the base class for HTTP error responses); it exposes the message, status code, headers, and body. See [Error Handling](#error-handling). + +**How do I configure automatic retries?** + +Provide a `RetryConfig` per call or at SDK initialization to control the backoff strategy. See [Retries](#retries). + +**How do I use a custom HTTP client, proxy, or timeout?** + +Provide your own `HTTPClient` implementation (custom executors, SSL context, connection pools, hooks) or wrap the default. See [Custom HTTP Client](#custom-http-client). + +**How do I enable debug logging?** + +The SDK logs through SLF4j; you can also use `enableHTTPDebugLogging(true)`. See [Debugging](#debugging). + +**Which Java versions are supported?** + +Java 11 and above (JDK). See [Prerequisites](#prerequisites). + +
+ +## Which FastPix SDK should I use? + +FastPix publishes a server SDK for every major backend language, each generated from the same API specification: + +| Language | Repo | Install | +|---|---|---| +| **Java** (this repo) | [fastpix-java](https://github.com/FastPix/fastpix-java) | `io.fastpix:sdk` (Maven/Gradle) | +| Node.js / TypeScript | [node-sdk](https://github.com/FastPix/node-sdk) | `npm install @fastpix/fastpix-node` | +| Python | [fastpix-python](https://github.com/FastPix/fastpix-python) | `pip install fastpix-python` | +| PHP | [fastpix-php](https://github.com/FastPix/fastpix-php) | `composer require fastpix/sdk` | +| Go | [fastpix-go](https://github.com/FastPix/fastpix-go) | `go get github.com/FastPix/fastpix-go` | +| C# / .NET | [fastpix-sdk-csharp](https://github.com/FastPix/fastpix-sdk-csharp) | `dotnet add package Fastpix` | +| Ruby | [fastpix-ruby](https://github.com/FastPix/fastpix-ruby) | `gem install fastpixapi` | + +To upload and play the media these SDKs create, use the FastPix browser libraries: [web-uploads-sdk](https://github.com/FastPix/web-uploads-sdk), [react-web-uploader](https://github.com/FastPix/react-web-uploader), and [web-player-component](https://github.com/FastPix/web-player-component). Browse everything in the [FastPix organization](https://github.com/orgs/FastPix/repositories). + +
+ +## Development This Java SDK is programmatically generated from our API specifications. Any manual modifications to internal files will be overwritten during subsequent generation cycles. @@ -940,3 +1074,10 @@ We value community contributions and feedback. Feel free to submit pull requests For comprehensive understanding of each API's functionality, including detailed request and response specifications, parameter descriptions, and additional examples, please refer to the [FastPix API Reference](https://fastpix.com/docs/product-os-api/overview). The API reference offers complete documentation for all available endpoints and features, enabling developers to integrate and leverage FastPix APIs effectively. + +## Support + +- Documentation: https://fastpix.com/docs +- API Reference: https://fastpix.com/docs/platform-api/overview +- GitHub Issues: https://github.com/FastPix/fastpix-java/issues +- Dashboard: https://dashboard.fastpix.com \ No newline at end of file From c39b5e6b570daf251e301f70eede87c759703127 Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Wed, 19 Aug 2026 21:09:39 +0530 Subject: [PATCH 2/7] Fix formatting in Table of Contents section --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f31220..87191d5 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ export FASTPIX_PASSWORD="your-secret-key" ## Table of Contents -* [FastPix Java SDK](#fastpix-java-sdk) + * [FastPix Java SDK](#fastpix-java-sdk) * [Setup](#setup) * [Example Usage](#example-usage) * [Asynchronous Support](#asynchronous-support) @@ -1080,4 +1080,4 @@ The API reference offers complete documentation for all available endpoints and - Documentation: https://fastpix.com/docs - API Reference: https://fastpix.com/docs/platform-api/overview - GitHub Issues: https://github.com/FastPix/fastpix-java/issues -- Dashboard: https://dashboard.fastpix.com \ No newline at end of file +- Dashboard: https://dashboard.fastpix.com From 03eca2d9604029d3608449573656c5f4ab313bba Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Thu, 20 Aug 2026 17:42:13 +0530 Subject: [PATCH 3/7] Update FastpixException link in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 87191d5..167cb9a 100644 --- a/README.md +++ b/README.md @@ -627,7 +627,7 @@ We recommend using the SDK retry functionality described in the Retries section ## Error Handling -[`FastpixException`](./src/main/java/models/errors/FastpixException.java) is the base class for all HTTP error responses. It has the following properties: +[`FastpixException`](https://github.com/FastPix/fastpix-java/blob/main/src/main/java/io/fastpix/sdk/models/errors/FastpixException.java) is the base class for all HTTP error responses. It has the following properties: | Method | Type | Description | | ---------------- | --------------------------- | ------------------------------------------------------------------------ | @@ -710,7 +710,7 @@ public class Application { ### Error Classes **Primary error:** -* [`FastpixException`](./src/main/java/models/errors/FastpixException.java): The base class for HTTP error responses. +* [`FastpixException`](https://github.com/FastPix/fastpix-java/blob/main/src/main/java/io/fastpix/sdk/models/errors/FastpixException.java): The base class for HTTP error responses.
Less common errors @@ -721,7 +721,7 @@ public class Application { `IOException` include `java.net.ConnectException`, `java.net.SocketTimeoutException`, `EOFException` (there are many more subclasses in the JDK platform). -**Inherit from [`FastpixException`](./src/main/java/models/errors/FastpixException.java)**: +**Inherit from [`FastpixException`](https://github.com/FastPix/fastpix-java/blob/main/src/main/java/io/fastpix/sdk/models/errors/FastpixException.java)**: * Additional error classes may be defined for specific error scenarios. From 73299dd15c813917aeee639a5972a779faad60f2 Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Thu, 20 Aug 2026 18:44:08 +0530 Subject: [PATCH 4/7] Remove Rate Limits section from README Removed the Rate Limits section from the README. --- README.md | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0f44cac..c712aad 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The FastPix Java SDK simplifies integration with the FastPix platform. It provid
-## Prerequisites +## Before you begin ### Environment and Version Support @@ -58,9 +58,10 @@ export FASTPIX_PASSWORD="your-secret-key" ## Table of Contents - * [FastPix Java SDK](#fastpix-java-sdk) +* [FastPix Java SDK](#fastpix-java-sdk) * [Setup](#setup) * [Example Usage](#example-usage) + * [Verify your integration](#verify-your-integration) * [Asynchronous Support](#asynchronous-support) * [Available Resources and Operations](#available-resources-and-operations) * [Retries](#retries) @@ -229,6 +230,33 @@ public class Application {
+### Verify your integration + +Run the example above to verify that your FastPix Java SDK integration is working. + +A successful response includes: + +```json +{ + "success": true, + "data": { + "id": "..." + } +} +``` +The `data.id value` is the unique media ID assigned to the uploaded media. + +If the request fails, check that: + +- Your FastPix access token and secret key are correct. +- Your credentials belong to the same FastPix workspace. +- Your environment variables are set correctly. +- The io.fastpix:sdk dependency is declared in your Maven or Gradle build and resolved on the classpath. +- You have an active internet connection. + +> Security: +> Never commit your access token or secret key to version control. Use environment variables or a secure credential-management system. + ## Asynchronous Support The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture`][comp-fut] and [Reactive Streams `Publisher`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library. @@ -615,15 +643,6 @@ public class Application {
-## Rate Limits - -The FastPix API enforces rate limits to help maintain platform stability. - -When a rate limit is exceeded, the API returns an HTTP `429 Too Many Requests` response. - -We recommend using the SDK retry functionality described in the Retries section to automatically handle temporary rate limiting and transient failures. - -
## Error Handling @@ -1041,7 +1060,7 @@ The SDK logs through SLF4j; you can also use `enableHTTPDebugLogging(true)`. See **Which Java versions are supported?** -Java 11 and above (JDK). See [Prerequisites](#prerequisites). +Java 11 and above (JDK). See [Before you begin](#before-you-begin).
From 615ff075e424b1d94ae29f7cb5d10a663b41a24d Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Thu, 20 Aug 2026 18:45:36 +0530 Subject: [PATCH 5/7] Remove Verify Installation section from README Removed the 'Verify Installation' section with API request example. --- README.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/README.md b/README.md index c712aad..e58bd38 100644 --- a/README.md +++ b/README.md @@ -165,18 +165,6 @@ FastPixSDK sdk = FastPixSDK.builder()
-### Verify Installation - -Run a simple API request to confirm your credentials and SDK configuration are working correctly. - -```java -sdk.manageVideos() - .list() - .call(); -``` - -
- ## Example Usage > **Note:** In the examples below, `package hello.world;` is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is at `src/main/java/com/example/MyApp.java`, use `package com.example;`). From fb6dac565b05ff565a4c36d2979588b592990fc2 Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Thu, 27 Aug 2026 21:22:18 +0530 Subject: [PATCH 6/7] Revise README for improved structure and clarity Updated the README to enhance clarity and organization, including sections on SDK usage, authentication, and environment requirements. --- README.md | 269 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 154 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index e58bd38..d4445d6 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,34 @@ The FastPix Java SDK is a type-safe Java client for the FastPix video API. From
+## Start here -## Introduction +If you are using the FastPix Java SDK for the first time, follow these steps in order: -The FastPix Java SDK simplifies integration with the FastPix platform. It provides a clean, type-safe interface for secure and efficient communication with the FastPix API, enabling easy management of media uploads, live streaming, on鈥慸emand content, playlists, video analytics, and signing keys for secure access and token management. It is intended for use with Java 11 and above. +1. [Check your Java version](#check-your-java-version) +2. [Add the SDK to your project](#add-the-sdk-to-your-project) +3. [Configure authentication](#configure-authentication) +4. [Initialize the FastPix client](#initialize-the-fastpix-client) +5. [Create your first media](#create-your-first-media) +6. [Verify your integration](#verify-your-integration) +7. [Understand the media workflow](#understand-the-media-workflow) -
+Do not skip the verification steps. If a build, dependency, or authentication problem occurs, fix it before continuing to the next API operation. + +--- + +### Before you begin -## Before you begin +To use the SDK, make sure you have: -### Environment and Version Support +- Java 11 or later (JDK). +- Maven or Gradle. +- Internet access. +- A FastPix account. +- A FastPix Access Token. +- A FastPix Secret Key. + +#### Environment and Version Support | Requirement | Version | Description | |---|---:|---| @@ -33,18 +51,16 @@ The FastPix Java SDK simplifies integration with the FastPix platform. It provid > Pro Tip: We recommend using Java 17+ for optimal performance and the latest language features. -
+FastPix uses Basic Authentication: -### Getting Started with FastPix +| SDK value | FastPix credential | +|---|---| +| `username` | Access Token | +| `password` | Secret Key | -To get started with the FastPix Java SDK, ensure you have the following: +Follow the steps in the [Authentication with Basic Auth](https://fastpix.com/docs/getting-started/activate-your-account) guide to obtain your credentials. -- The FastPix APIs are authenticated using a **Username** and a **Password**. You must generate these credentials to use the SDK. -- Follow the steps in the [Authentication with Basic Auth](https://fastpix.com/docs/getting-started/activate-your-account) guide to obtain your credentials. - -### Environment Variables (Optional) - -Configure your FastPix credentials using environment variables for enhanced security and convenience: +Optionally, store your credentials as environment variables: ```bash # Set your FastPix credentials @@ -54,32 +70,41 @@ export FASTPIX_PASSWORD="your-secret-key" > Security Note: Never commit your credentials to version control. Use environment variables or secure credential management systems. -
+--- + +## Check your Java version + +Confirm your Java version before you add the SDK: + +```bash +java -version +``` + +The output is similar to: + +```text +openjdk version "17.0.8" 2023-07-18 +``` + +If your version is earlier than Java 11, install a supported JDK before continuing. + +Confirm your build tool is available: -## Table of Contents +```bash +mvn -version +``` -* [FastPix Java SDK](#fastpix-java-sdk) - * [Setup](#setup) - * [Example Usage](#example-usage) - * [Verify your integration](#verify-your-integration) - * [Asynchronous Support](#asynchronous-support) - * [Available Resources and Operations](#available-resources-and-operations) - * [Retries](#retries) - * [Error Handling](#error-handling) - * [Server Selection](#server-selection) - * [Custom HTTP Client](#custom-http-client) - * [Debugging](#debugging) - * [FAQ](#faq) - * [Which FastPix SDK should I use?](#which-fastpix-sdk-should-i-use) - * [Development](#development) +or: -
+```bash +gradle -version +``` -## Setup +
-### Installation +## Add the SDK to your project -Install the FastPix Java SDK using your preferred build tool: +Install the FastPix Java SDK using your preferred build tool. #### Gradle @@ -103,16 +128,36 @@ Add the dependency to your `pom.xml`: ``` -### Building from Source +> **Note:** The examples in this README pretty-print API responses with Jackson (`JSON.getMapper()` and `SerializationFeature`). The SDK declares `jackson-databind` at `runtime` scope, so to compile these examples add it to your build at compile scope: +> +> Maven: +> +> ```xml +> +> com.fasterxml.jackson.core +> jackson-databind +> 2.18.2 +> +> ``` +> +> Gradle: +> +> ```groovy +> implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2' +> ``` + +#### Build from source (optional) After cloning the git repository to your file system, you can build the SDK artifact from source to the `build` directory by running: **On Unix/Linux/macOS:** + ```bash ./gradlew build ``` **On Windows:** + ```bash gradlew.bat build ``` @@ -120,18 +165,40 @@ gradlew.bat build If you wish to build from source and publish the SDK artifact to your local Maven repository, use: **On Unix/Linux/macOS:** + ```bash ./gradlew publishToMavenLocal -Pskip.signing ``` **On Windows:** + ```bash gradlew.bat publishToMavenLocal -Pskip.signing ```
-### Initialization +## Configure authentication + +FastPix uses Basic Authentication. Set your Access Token and Secret Key as environment variables so they stay out of your source code: + +```bash +export FASTPIX_USERNAME="your-access-token" +export FASTPIX_PASSWORD="your-secret-key" +``` + +Confirm both variables are set, without printing their values. + +**On Unix/Linux/macOS:** + +```bash +[ -n "$FASTPIX_USERNAME" ] && echo "Access Token: set" || echo "Access Token: missing" +[ -n "$FASTPIX_PASSWORD" ] && echo "Secret Key: set" || echo "Secret Key: missing" +``` + +
+ +## Initialize the FastPix client Initialize the FastPix SDK with your credentials: @@ -139,7 +206,6 @@ Initialize the FastPix SDK with your credentials: // Import required classes from the FastPix SDK import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.Security; - FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") @@ -154,7 +220,6 @@ Or using environment variables: // Import required classes from the FastPix SDK import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.Security; - FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username(System.getenv("FASTPIX_USERNAME")) // Your Access Token @@ -163,16 +228,21 @@ FastPixSDK sdk = FastPixSDK.builder() .build(); ``` +### What this code does + +`FastPixSDK.builder()` creates the top-level SDK client, and the `Security` object holds the credentials used to authenticate API requests. Building the client does not call the API. A request happens only when you call an operation, such as `sdk.inputVideos().create().request(req).call()`. +
-## Example Usage +## Create your first media + +The easiest way to verify your integration is to create media from a publicly accessible video URL. FastPix provides a sample video at `https://static.fastpix.com/fp-sample-video.mp4`. > **Note:** In the examples below, `package hello.world;` is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is at `src/main/java/com/example/MyApp.java`, use `package com.example;`). ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -182,18 +252,14 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) throws Exception { - FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") .password("your-secret-key") .build()) .build(); - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -202,11 +268,9 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CreateMediaResponse res = sdk.inputVideos().create() .request(req) .call(); - if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); @@ -216,6 +280,12 @@ public class Application { } ``` +Compile and run `Application` with your build tool or IDE. For a Maven project with the [exec-maven-plugin](https://www.mojohaus.org/exec-maven-plugin/), run: + +```bash +mvn -q compile exec:java -Dexec.mainClass="hello.world.Application" +``` +
### Verify your integration @@ -232,6 +302,7 @@ A successful response includes: } } ``` + The `data.id value` is the unique media ID assigned to the uploaded media. If the request fails, check that: @@ -245,6 +316,35 @@ If the request fails, check that: > Security: > Never commit your access token or secret key to version control. Use environment variables or a secure credential-management system. +
+ +## Understand the media workflow + +Creating media is usually the first operation in an on-demand video workflow. You carry the media ID from one call to the next. + +FastPix media workflow: create media returns a media ID, retrieve the media, check status until ready, create a playback ID, then play the video. + +A playback ID is created separately, only when you need playback access. + +
+ +## Next steps + +After verifying your integration, you can use the SDK to: + +- Manage media: list, retrieve, update, and delete media. +- Create playback IDs: generate playback access for your media. +- Manage live streams: create and manage live streaming sessions. +- Create playlists: organize media into playlists. +- Manage signing keys: create and manage keys for secure playback. +- Analyze video performance: retrieve metrics, views, dimensions, and errors. +- Use in-video AI: generate subtitles, summaries, chapters, and named entities. +- Manage media tracks: add, update, and delete audio or subtitle tracks. + +See [Available Resources and Operations](#available-resources-and-operations) for the complete list. + +
+ ## Asynchronous Support The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture`][comp-fut] and [Reactive Streams `Publisher`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library. @@ -267,11 +367,13 @@ Asynchronous operations provide several key benefits: The SDK returns [Reactive Streams `Publisher`][reactive-streams] instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams. **Why Reactive Streams over JDK Flow?** + - **Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams - **Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java - **Better interoperability**: Seamless integration without additional adapters for most use cases **Integration with Popular Libraries:** + - **Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types - **RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration - **Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration @@ -279,11 +381,12 @@ The SDK returns [Reactive Streams `Publisher`][reactive-streams] instances fo - **Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration **For JDK Flow API Integration:** + If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters: + ```java // Convert Reactive Streams Publisher to Flow Publisher Flow.Publisher flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher); - // Convert Flow Publisher to Reactive Streams Publisher Publisher reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher); ``` @@ -297,7 +400,6 @@ For standard single-response operations, the SDK returns `CompletableFuture` ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.util.List; import java.util.Map; @@ -308,11 +410,8 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.async.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) { - AsyncFastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") @@ -320,7 +419,6 @@ public class Application { .build()) .build() .async(); - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -329,11 +427,9 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CompletableFuture resFut = sdk.inputVideos().create() .request(req) .call(); - resFut.thenAccept(res -> { if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); @@ -471,30 +567,24 @@ Enhance video content with AI-powered features including moderation, summarizati - [Enable Moderation](docs/sdks/invideoaifeatures/README.md#updatemoderation) - Activate content moderation and safety checks #### Media Clips - - [Get Media Clips](docs/sdks/videos/README.md#getmediaclips) - Retrieve all clips associated with a source media - [List Live Clips](docs/sdks/videos/README.md#listliveclips) - Get all clips of a live stream #### Subtitles - - [Generate Subtitles](docs/sdks/managevideos/README.md#generatesubtitles) - Create automatic subtitles for media #### Media Tracks - - [Add Track](docs/sdks/managevideos/README.md#addtrack) - Add audio or subtitle tracks to media - [Update Track](docs/sdks/videos/README.md#updatetrack) - Modify existing audio or subtitle tracks - [Delete Track](docs/sdks/managevideos/README.md#deletetrack) - Remove audio or subtitle tracks #### Access Control - - [Update Source Access](docs/sdks/managevideos/README.md#updatesourceaccess) - Control access permissions for media source #### Format Support - - [Update MP4 Support](docs/sdks/videos/README.md#updatemp4support) - Configure MP4 download capabilities #### Video Summary - - [Get Summary](docs/sdks/managevideos/README.md#getsummary) - Retrieve AI-generated video summary @@ -510,7 +600,6 @@ To change the default retry strategy for a single API call, you can provide a `R ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -523,18 +612,14 @@ import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.BackoffStrategy; import io.fastpix.sdk.utils.RetryConfig; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) throws Exception { - FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") .password("your-secret-key") .build()) .build(); - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -543,7 +628,6 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CreateMediaResponse res = sdk.inputVideos().create() .request(req) .retryConfig(RetryConfig.builder() @@ -557,7 +641,6 @@ public class Application { .build()) .build()) .call(); - if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); @@ -572,7 +655,6 @@ If you'd like to override the default retry strategy for all operations that sup ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -585,11 +667,8 @@ import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.BackoffStrategy; import io.fastpix.sdk.utils.RetryConfig; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) throws Exception { - FastPixSDK sdk = FastPixSDK.builder() .retryConfig(RetryConfig.builder() .backoff(BackoffStrategy.builder() @@ -606,7 +685,6 @@ public class Application { .password("your-secret-key") .build()) .build(); - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -615,11 +693,9 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CreateMediaResponse res = sdk.inputVideos().create() .request(req) .call(); - if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); @@ -631,7 +707,6 @@ public class Application {
- ## Error Handling [`FastpixException`](https://github.com/FastPix/fastpix-java/blob/main/src/main/java/io/fastpix/sdk/models/errors/FastpixException.java) is the base class for all HTTP error responses. It has the following properties: @@ -650,7 +725,6 @@ public class Application { ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.io.UncheckedIOException; import java.lang.Exception; @@ -661,11 +735,8 @@ import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.errors.FastpixException; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) throws Exception { - FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") @@ -673,7 +744,6 @@ public class Application { .build()) .build(); try { - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -682,22 +752,18 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CreateMediaResponse res = sdk.inputVideos().create() .request(req) .call(); - if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); System.out.println(mapper.writeValueAsString(res.createMediaSuccessResponse().get())); } } catch (FastpixException ex) { // all SDK exceptions inherit from FastpixException - // ex.toString() provides a detailed error message including // HTTP status code, headers, and error payload (if any) System.out.println(ex); - // Base exception fields var rawResponse = ex.rawResponse(); var headers = ex.headers(); @@ -729,7 +795,6 @@ public class Application { many more subclasses in the JDK platform). **Inherit from [`FastpixException`](https://github.com/FastPix/fastpix-java/blob/main/src/main/java/io/fastpix/sdk/models/errors/FastpixException.java)**: - * Additional error classes may be defined for specific error scenarios.
@@ -745,7 +810,6 @@ The default server can be overridden globally using the `.serverURL(String serve ```java // Package declaration - adjust to match your project's directory structure package hello.world; - // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -755,11 +819,8 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; - public class Application { - public static void main(String[] args) throws Exception { - FastPixSDK sdk = FastPixSDK.builder() .serverURL("https://api.fastpix.com/v1/") .security(Security.builder() @@ -767,7 +828,6 @@ public class Application { .password("your-secret-key") .build()) .build(); - CreateMediaRequest req = CreateMediaRequest.builder() .inputs(List.of( Input.of(PullVideoInput.builder() @@ -776,11 +836,9 @@ public class Application { .metadata(Map.ofEntries( Map.entry("key1", "value1"))) .build(); - CreateMediaResponse res = sdk.inputVideos().create() .request(req) .call(); - if (res.createMediaSuccessResponse().isPresent()) { var mapper = JSON.getMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); @@ -814,14 +872,12 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.utils.HTTPClient; import io.fastpix.sdk.utils.FastpixHTTPClient; import io.fastpix.sdk.utils.Utils; - import java.io.IOException; import java.net.URISyntaxException; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.InputStream; import java.time.Duration; - public class Application { public static void main(String[] args) { // Create a custom HTTP client with hooks @@ -848,7 +904,6 @@ public class Application { } } }; - FastPixSDK sdk = FastPixSDK.builder() .client(httpClient) .build(); @@ -867,7 +922,6 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.utils.HTTPClient; import io.fastpix.sdk.utils.Blob; import io.fastpix.sdk.utils.ResponseWithBody; - import java.io.IOException; import java.net.URISyntaxException; import java.net.http.HttpClient; @@ -877,7 +931,6 @@ import java.io.InputStream; import java.time.Duration; import java.util.concurrent.Executors; import java.util.concurrent.CompletableFuture; - public class Application { public static void main(String[] args) { // Custom HTTP client with custom configuration @@ -887,12 +940,10 @@ public class Application { .connectTimeout(Duration.ofSeconds(30)) // .sslContext(customSslContext) // Add custom SSL context if needed .build(); - @Override public HttpResponse send(HttpRequest request) throws IOException, URISyntaxException, InterruptedException { return client.send(request, HttpResponse.BodyHandlers.ofInputStream()); } - @Override public CompletableFuture> sendAsync(HttpRequest request) { // Convert response to HttpResponse for async operations @@ -900,7 +951,6 @@ public class Application { .thenApply(resp -> new ResponseWithBody<>(resp, Blob::from)); } }; - FastPixSDK sdk = FastPixSDK.builder() .client(customHttpClient) .build(); @@ -943,7 +993,6 @@ Configure logging levels in your `logback.xml`: %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - @@ -982,6 +1031,7 @@ FastPixSDK sdk = FastPixSDK.builder() > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production. Example output: + ``` Sending request: http://localhost:35123/bearer#global GET Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-fastpix-user-agent=[fastpix-sdk/java 0.0.1 internal 0.1.0 io.fastpix.sdk]} @@ -1007,47 +1057,36 @@ Another option is to set the System property `-Djdk.httpclient.HttpClient.log=al ## FAQ **How do I install the FastPix Java SDK?** - -Add `io.fastpix:sdk` to your build - `implementation 'io.fastpix:sdk:'` for Gradle, or the equivalent `` for Maven. See [Setup](#setup) and [Installation](#installation). +Add `io.fastpix:sdk` to your build - `implementation 'io.fastpix:sdk:'` for Gradle, or the equivalent `` for Maven. See [Add the SDK to your project](#add-the-sdk-to-your-project). **How do I authenticate the SDK?** - -FastPix uses Basic Auth: build a `Security` with your access token as `username` and secret key as `password`, then pass it to `FastPixSDK.builder()`. See [Initialization](#initialization). +FastPix uses Basic Auth: build a `Security` with your access token as `username` and secret key as `password`, then pass it to `FastPixSDK.builder()`. See [Configure authentication](#configure-authentication). **How do I upload a video in Java?** - -Create media from a URL or a direct upload through `sdk.inputVideos()`. See [Example Usage](#example-usage) and [Available Resources and Operations](#available-resources-and-operations). +Create media from a URL or a direct upload through `sdk.inputVideos()`. See [Create your first media](#create-your-first-media) and [Available Resources and Operations](#available-resources-and-operations). **Does the SDK support async / reactive?** - Yes - it provides asynchronous APIs using `CompletableFuture` and Reactive Streams `Publisher`, so it integrates with Reactor, RxJava, and other reactive libraries. See [Asynchronous Support](#asynchronous-support). **How do I start a live stream?** - Use the Live API resources to create and manage streams, simulcasts, and live playback IDs. See [Available Resources and Operations](#available-resources-and-operations). **How do I get video analytics and metrics in Java?** - The Video Data API exposes metrics, views, dimensions, and errors for quality-of-experience monitoring. See [Available Resources and Operations](#available-resources-and-operations). **How do I handle API errors?** - Catch `FastpixException` (the base class for HTTP error responses); it exposes the message, status code, headers, and body. See [Error Handling](#error-handling). **How do I configure automatic retries?** - Provide a `RetryConfig` per call or at SDK initialization to control the backoff strategy. See [Retries](#retries). **How do I use a custom HTTP client, proxy, or timeout?** - Provide your own `HTTPClient` implementation (custom executors, SSL context, connection pools, hooks) or wrap the default. See [Custom HTTP Client](#custom-http-client). **How do I enable debug logging?** - The SDK logs through SLF4j; you can also use `enableHTTPDebugLogging(true)`. See [Debugging](#debugging). **Which Java versions are supported?** - Java 11 and above (JDK). See [Before you begin](#before-you-begin).
From 7d2cd65cf1bfd4eae63f469b7a4d4c93576c6b37 Mon Sep 17 00:00:00 2001 From: ashutoshkhainar33-star Date: Fri, 28 Aug 2026 19:14:12 +0530 Subject: [PATCH 7/7] Update SDK version to 1.0.5 in README --- README.md | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d4445d6..c8b63dd 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Add the dependency to your `build.gradle`: ```groovy dependencies { - implementation 'io.fastpix:sdk:1.0.4' + implementation 'io.fastpix:sdk:1.0.5' } ``` @@ -124,40 +124,20 @@ Add the dependency to your `pom.xml`: io.fastpix sdk - 1.0.4 + 1.0.5 ``` -> **Note:** The examples in this README pretty-print API responses with Jackson (`JSON.getMapper()` and `SerializationFeature`). The SDK declares `jackson-databind` at `runtime` scope, so to compile these examples add it to your build at compile scope: -> -> Maven: -> -> ```xml -> -> com.fasterxml.jackson.core -> jackson-databind -> 2.18.2 -> -> ``` -> -> Gradle: -> -> ```groovy -> implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2' -> ``` - #### Build from source (optional) After cloning the git repository to your file system, you can build the SDK artifact from source to the `build` directory by running: **On Unix/Linux/macOS:** - ```bash ./gradlew build ``` **On Windows:** - ```bash gradlew.bat build ``` @@ -165,13 +145,11 @@ gradlew.bat build If you wish to build from source and publish the SDK artifact to your local Maven repository, use: **On Unix/Linux/macOS:** - ```bash ./gradlew publishToMavenLocal -Pskip.signing ``` **On Windows:** - ```bash gradlew.bat publishToMavenLocal -Pskip.signing ``` @@ -190,7 +168,6 @@ export FASTPIX_PASSWORD="your-secret-key" Confirm both variables are set, without printing their values. **On Unix/Linux/macOS:** - ```bash [ -n "$FASTPIX_USERNAME" ] && echo "Access Token: set" || echo "Access Token: missing" [ -n "$FASTPIX_PASSWORD" ] && echo "Secret Key: set" || echo "Secret Key: missing" @@ -206,6 +183,7 @@ Initialize the FastPix SDK with your credentials: // Import required classes from the FastPix SDK import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.Security; + FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username("your-access-token") @@ -220,6 +198,7 @@ Or using environment variables: // Import required classes from the FastPix SDK import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.Security; + FastPixSDK sdk = FastPixSDK.builder() .security(Security.builder() .username(System.getenv("FASTPIX_USERNAME")) // Your Access Token @@ -243,6 +222,7 @@ The easiest way to verify your integration is to create media from a publicly ac ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -252,6 +232,7 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) throws Exception { FastPixSDK sdk = FastPixSDK.builder() @@ -387,6 +368,7 @@ If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use ```java // Convert Reactive Streams Publisher to Flow Publisher Flow.Publisher flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher); + // Convert Flow Publisher to Reactive Streams Publisher Publisher reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher); ``` @@ -400,6 +382,7 @@ For standard single-response operations, the SDK returns `CompletableFuture` ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.util.List; import java.util.Map; @@ -410,6 +393,7 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.async.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) { AsyncFastPixSDK sdk = FastPixSDK.builder() @@ -600,6 +584,7 @@ To change the default retry strategy for a single API call, you can provide a `R ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -612,6 +597,7 @@ import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.BackoffStrategy; import io.fastpix.sdk.utils.RetryConfig; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) throws Exception { FastPixSDK sdk = FastPixSDK.builder() @@ -655,6 +641,7 @@ If you'd like to override the default retry strategy for all operations that sup ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -667,6 +654,7 @@ import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.BackoffStrategy; import io.fastpix.sdk.utils.RetryConfig; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) throws Exception { FastPixSDK sdk = FastPixSDK.builder() @@ -725,6 +713,7 @@ public class Application { ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.io.UncheckedIOException; import java.lang.Exception; @@ -735,6 +724,7 @@ import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.errors.FastpixException; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) throws Exception { FastPixSDK sdk = FastPixSDK.builder() @@ -810,6 +800,7 @@ The default server can be overridden globally using the `.serverURL(String serve ```java // Package declaration - adjust to match your project's directory structure package hello.world; + // Import required classes from the FastPix SDK import java.lang.Exception; import java.util.List; @@ -819,6 +810,7 @@ import io.fastpix.sdk.FastPixSDK; import io.fastpix.sdk.models.components.*; import io.fastpix.sdk.models.operations.CreateMediaResponse; import io.fastpix.sdk.utils.JSON; + public class Application { public static void main(String[] args) throws Exception { FastPixSDK sdk = FastPixSDK.builder() @@ -878,6 +870,7 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.InputStream; import java.time.Duration; + public class Application { public static void main(String[] args) { // Create a custom HTTP client with hooks @@ -931,6 +924,7 @@ import java.io.InputStream; import java.time.Duration; import java.util.concurrent.Executors; import java.util.concurrent.CompletableFuture; + public class Application { public static void main(String[] args) { // Custom HTTP client with custom configuration