Skip to main content

Yasminaai C# Library

fern shield nuget shield The Yasminaai C# library provides convenient access to the Yasminaai APIs from C#.

Table of Contents

Requirements

This SDK requires:

Installation

Reference

A full reference for this library is available here.

Usage

Instantiate and use the client with the following:

Environments

This SDK allows you to configure different environments for API requests.

Exception Handling

When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error will be thrown.

Advanced

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). Which status codes are retried depends on the retryStatusCodes generator configuration: legacy (current default): retries on
  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (All server errors, including 500)
recommended: retries on
  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 502 (Bad Gateway)
  • 503 (Service Unavailable)
  • 504 (Gateway Timeout)
Use the MaxRetries request option to configure this behavior.

Timeouts

The SDK defaults to a 30 second timeout. Use the Timeout option to configure this behavior.

Raw Response

Access raw HTTP response data (status code, headers, URL) alongside parsed response data using the .WithRawResponse() method.

Additional Headers

If you would like to send additional headers as part of the request, use the AdditionalHeaders request option.

Additional Query Parameters

If you would like to send additional query parameters as part of the request, use the AdditionalQueryParameters request option.

Forward Compatible Enums

This SDK uses forward-compatible enums that can handle unknown values gracefully.

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us! On the other hand, contributions to the README are always very welcome!