SkylabStudio 0.0.3
See the version list below for details.
dotnet add package SkylabStudio --version 0.0.3
NuGet\Install-Package SkylabStudio -Version 0.0.3
<PackageReference Include="SkylabStudio" Version="0.0.3" />
paket add SkylabStudio --version 0.0.3
#r "nuget: SkylabStudio, 0.0.3"
// Install SkylabStudio as a Cake Addin #addin nuget:?package=SkylabStudio&version=0.0.3 // Install SkylabStudio as a Cake Tool #tool nuget:?package=SkylabStudio&version=0.0.3
Skylab Studio .NET Client
.NET client to interface with Skylab Studio Public API
Installation
$ nuget install SkylabStudio
Example Usage
For all examples, assume:
using SkylabStudio;
var apiClient = new StudioClient("YOUR_SKYLAB_API_TOKEN");
// Example Job Processing Flow with Callback
// CREATE PROFILE
dynamic profile = await apiClient.CreateProfile(new { name = $"Test Profile", enable_crop = false, enable_color = true });
// CREATE JOB
var jobName = $"test-job";
dynamic job = await apiClient.CreateJob(new { name = jobName, profile_id = profile.id.Value });
// UPLOAD PHOTO
string filePath = "/path/to/photo";
dynamic res = await apiClient.UploadJobPhoto(filePath, job.id.Value);
// QUEUE JOB
dynamic queuedJob = await apiClient.QueueJob(job.id.Value, new { callback_url = "YOUR_CALLBACK_ENDPOINT" });
// NOTE: Once the job is queued, it will get processed then complete
// We will send a response to the specified callback_url with the output photo download urls
Error Handling
By default, the API calls return a JSON (JObject) response object no matter the type of response.
Endpoints
List all jobs
api.ListJobs();
Create job
api.CreateJob(new { name = "Test Job", profileId = 123 });
For all payload options, consult the API documentation.
Get job
api.GetJob(jobId);
Update job
api.UpdateJob(jobId, new { name = "Updated Job Name" });
For all payload options, consult the API documentation.
Queue job
api.QueueJob(jobId, new { callback_url = "http://your.endpoint/"});
Delete job
api.DeleteJob(jobId);
Cancel job
api.CancelJob(jobId);
Jobs in front
Use after queueing job to check number of jobs ahead of yours
api.JobsInFront(jobId);
List all profiles
api.ListProfiles();
Create profile
api.CreateProfile(new { name = $"New Profile", enable_crop = false, enable_color = true });
For all payload options, consult the API documentation.
Get profile
api.GetProfile(profileId);
Update profile
api.UpdateProfile(profileId, new { name = $"Test Profile", enable_crop = false, enable_color = true });
For all payload options, consult the API documentation.
List all photos
api.ListPhotos();
Get photo
api.GetPhoto(photoId);
Upload photo
This function handles validating a photo, creating a photo object and uploading it to your job/profile's s3 bucket.
api.UploadJobPhoto("/path/to/photo", jobId);
OR
api.UploadProfilePhoto("/path/to/photo", profileId);
If upload fails, the photo object is deleted for you. If upload succeeds and you later decide you no longer want to include that image, use api.DeletePhoto(photoId) to remove it.
Delete photo
This will remove the photo from the job/profile's bucket. Useful for when you've accidentally uploaded an image that you'd like removed.
api.DeletePhoto(photoId);
Validate hmac headers
Applicable if you utilize the job callback url. Use to validate the job payload integrity.
secretKey (string): Obtain from Skylab
jobJson (string): Stringified json object obtained from callback PATCH request
requestTimestamp (string): Obtained from callback PATCH request header 'X-Skylab-Timestamp'
signature (string): Signature generated by Skylab to compare. Obtained from callback PATCH request header 'X-Skylab-Signature'
Returns True or False based on whether or not the signatures match.
api.ValidateHmacHeaders(secretKey, jobJson, requestTimestamp, signature);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 is compatible. net471 was computed. net472 is compatible. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.7.2
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.8
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.0
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
-
net6.0
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
-
net7.0
- Microsoft.AspNet.WebApi.SelfHost (>= 5.3.0)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.14 | 85 | 10/7/2024 |
0.0.13 | 111 | 6/21/2024 |
0.0.12 | 113 | 6/17/2024 |
0.0.11 | 144 | 3/12/2024 |
0.0.10 | 128 | 3/8/2024 |
0.0.9 | 138 | 3/2/2024 |
0.0.8 | 129 | 3/1/2024 |
0.0.7 | 127 | 2/29/2024 |
0.0.6 | 143 | 2/23/2024 |
0.0.5 | 130 | 2/21/2024 |
0.0.4 | 125 | 1/31/2024 |
0.0.3 | 193 | 11/9/2023 |
0.0.2 | 154 | 10/27/2023 |
0.0.1 | 129 | 10/26/2023 |