### Creating a Workspace Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Example of how to create a new workspace using the Seatsio client with a company admin key. ```APIDOC ## Creating a workspace ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Workspaces.CreateAsync("a workspace"); ``` ``` -------------------------------- ### Creating a Chart and an Event with Company Admin Key Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Demonstrates creating a chart and then an event associated with that chart, using a company admin key and a workspace public key. ```APIDOC ## Creating a chart and an event with the company admin key ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), "", ""); // workspace public key can be found on https://app.seats.io/workspace-settings var chart = await client.Charts.CreateAsync(); var evnt = await client.Events.CreateAsync(chart.Key); ``` ``` -------------------------------- ### Initialize Seatsio Client Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Instantiate the SeatsioClient with your region and workspace secret key. Ensure the region matches your Seats.io account region. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); ... ``` -------------------------------- ### Create a Chart and an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Demonstrates how to create a new chart and then create an event associated with that chart using the SeatsioClient. ```csharp using SeatsioDotNet; using SeatsioDotNet.Charts; using SeatsioDotNet.Events; var client = new SeatsioClient(Region.EU(), ""); var chart = await client.Charts.CreateAsync(); var evnt = await client.Events.CreateAsync(chart.Key); ``` -------------------------------- ### Create Chart and Event with Company Admin Key Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Create a chart and then an event associated with that chart using the company admin key. Requires both company admin and workspace public keys. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), "", ""); // workspace public key can be found on https://app.seats.io/workspace-settings var chart = await client.Charts.CreateAsync(); var evnt = await client.Events.CreateAsync(chart.Key); ``` -------------------------------- ### Use Custom HttpClient Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Instantiate the SeatsioClient with a pre-configured HttpClient, such as one created by IHttpClientFactory. ```csharp var httpClient = factory.CreateClient(); new SeatsioClient(Region.EU(), "", httpClient); ``` -------------------------------- ### Using a Custom HttpClient Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Shows how to integrate the Seatsio SDK with a custom `HttpClient`, including enabling exponential backoff with `SeatsioMessageHandler`. ```APIDOC ## Using a custom HttpClient You can pass in a custom `HttpClient` (e.g. one that was created by a `IHttpClientFactory`): ```csharp var httpClient = factory.CreateClient(); new SeatsioClient(Region.EU(), "", httpClient); ``` To enable exponential backoff in case of rate limit exceeded errors, you'll need to pass in the `SeatsioMessageHandler` when creating the HTTP client: ```csharp var httpClient = new HttpClient(new SeatsioMessageHandler(maxRetries)); ``` Alternatively, you can implement your own retry logic. There's an example in [CustomHttpClientTest.cs](SeatsioDotNet.Test/CustomHttpClientTest.cs). ``` -------------------------------- ### Create Workspace Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Create a new workspace using the company admin key. This is a prerequisite for certain operations that require a specific workspace context. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Workspaces.CreateAsync("a workspace"); ``` -------------------------------- ### Listing Charts Page by Page Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Demonstrates how to list charts in a paginated manner, including fetching the first page, the next page, and the previous page. ```APIDOC ## Listing Charts Page by Page E.g. to show charts in a paginated list on a dashboard. ```csharp // ... user initially opens the screen ... var firstPage = await client.Charts.ListFirstPageAsync(); foreach (var chart in firstPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` ```csharp // ... user clicks on 'next page' button ... var nextPage = await client.Charts.ListPageAfterAsync(firstPage.NextPageStartsAfter); foreach (var chart in nextPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` ```csharp // ... user clicks on 'previous page' button ... var previousPage = await client.Charts.ListPageBeforeAsync(nextPage.PreviousPageEndsBefore); foreach (var chart in previousPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` ``` -------------------------------- ### Use Custom HttpClient with SeatsioMessageHandler Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Integrate exponential backoff for rate limiting by passing SeatsioMessageHandler when creating a custom HttpClient. ```csharp var httpClient = new HttpClient(new SeatsioMessageHandler(maxRetries)); ``` -------------------------------- ### Rate Limiting - Exponential Backoff Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Details the SDK's support for exponential backoff to handle rate limiting (429 errors), including how to configure the maximum number of retries. ```APIDOC ## Rate limiting - exponential backoff This library supports [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff). When you send too many concurrent requests, the server returns an error `429 - Too Many Requests`. The client reacts to this by waiting for a while, and then retrying the request. If the request still fails with an error `429`, it waits a little longer, and try again. By default this happens 5 times, before giving up (after approximately 15 seconds). We throw a `RateLimitExceededException` (which is a subclass of `SeatsioException`) when exponential backoff eventually fails. To change the maximum number of retries, create the `SeatsioClient` as follows: ```csharp var client = new SeatsioClient(Region.EU(), "").SetMaxRetries(3); ``` Passing in 0 disables exponential backoff completely. In that case, the client will never retry a failed request. ``` -------------------------------- ### Book Objects for an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Books specified objects for an event. Requires the event key and an array of object IDs to book. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Events.BookAsync(, new [] { "A-1", "A-2"}); ``` -------------------------------- ### Error Handling Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Explains how the SDK handles API errors, throwing a `SeatsioException` that includes error details and a request ID. ```APIDOC ## Error handling When an API call results in a 4xx or 5xx error (e.g. when a chart could not be found), a SeatsioException is thrown. This exception contains a message string describing what went wrong, and also two other properties: - `Errors`: a list of errors that the server returned. In most cases, this list will contain only one element. - `RequestId`: the identifier of the request you made. Please mention this to us when you have questions, as it will make debugging easier. ``` -------------------------------- ### Book Held Objects for an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Books objects that have previously been held. Requires the event key, object IDs, and the hold token. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Events.BookAsync(, new [] { "A-1", "A-2"}, ); ``` -------------------------------- ### List Charts Paginated - First Page Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Retrieve the first page of charts. Use this when a user initially opens a screen displaying charts. ```csharp // ... user initially opens the screen ... var firstPage = await client.Charts.ListFirstPageAsync(); foreach (var chart in firstPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` -------------------------------- ### List All Charts Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Fetches all charts available in the workspace. Note that `ListAllAsync()` returns an `IAsyncEnumerable` and may perform multiple API calls to retrieve all charts page by page. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); var charts = await client.Charts.ListAllAsync(); foreach (var chart in charts) { Console.WriteLine("Chart " + chart.Key); } ``` -------------------------------- ### Retrieve Object Information from an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Retrieves detailed information for specific objects within an event, such as category and status. Requires the event key and an array of object IDs. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); var objectInfos = await Client.Events.RetrieveObjectInfosAsync(evnt.Key, new string[] {"A-1", "A-2"}); Console.WriteLine(objectInfos["A-1"].CategoryKey); Console.WriteLine(objectInfos["A-1"].CategoryLabel); Console.WriteLine(objectInfos["A-1"].Status); Console.WriteLine(objectInfos["A-2"].CategoryKey); Console.WriteLine(objectInfos["A-2"].CategoryLabel); Console.WriteLine(objectInfos["A-2"].Status); ``` -------------------------------- ### Retrieve Published Chart Version Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Fetches the published version of a chart, including its drawing details like venue type and categories. Requires the chart key. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); var drawing = await client.Charts.RetrievePublishedVersionAsync(); Console.WriteLine(drawing.VenueType); ``` -------------------------------- ### Configure Max Retries for Rate Limiting Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Set the maximum number of retries for requests that fail due to rate limiting (429 Too Many Requests). A value of 0 disables exponential backoff. ```csharp var client = new SeatsioClient(Region.EU(), "").SetMaxRetries(3); ``` -------------------------------- ### List Charts Paginated - Next Page Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Retrieve the next page of charts using the `NextPageStartsAfter` token from the previous page. Use this when a user clicks a 'next page' button. ```csharp // ... user clicks on 'next page' button ... var nextPage = await client.Charts.ListPageAfterAsync(firstPage.NextPageStartsAfter); foreach (var chart in nextPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` -------------------------------- ### List Categories of a Chart Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Retrieves a list of all categories associated with a specific chart. Requires the chart key. ```csharp var client = new SeatsioClient(Region.EU(), ""); IEnumerable categoryList = await client.Charts.ListCategoriesAsync(); foreach (var category in categoryList) { Console.Write(category.Label); } ``` -------------------------------- ### Release Objects for an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Releases specified objects for an event. Requires the event key and an array of object IDs to release. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Events.ReleaseAsync(, new [] { "A-1", "A-2"}); ``` -------------------------------- ### List Charts Paginated - Previous Page Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Retrieve the previous page of charts using the `PreviousPageEndsBefore` token from a subsequent page. Use this when a user clicks a 'previous page' button. ```csharp // ... user clicks on 'previous page' button ... var previousPage = await client.Charts.ListPageBeforeAsync(nextPage.PreviousPageEndsBefore); foreach (var chart in previousPage.Items) { Console.WriteLine("Chart " + chart.Key); } ``` -------------------------------- ### Change Object Status in an Event Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Changes the status of specified objects within an event. Requires the event key, object IDs, and the desired new status. ```csharp using SeatsioDotNet; var client = new SeatsioClient(Region.EU(), ""); await client.Events.ChangeObjectStatusAsync("""", new [] { "A-1", "A-2"}, "unavailable"); ``` -------------------------------- ### Update a Chart Category Source: https://github.com/seatsio/seatsio-dotnet/blob/master/README.md Updates an existing category within a chart. Requires the chart key, category ID, and parameters for the update (label, color, enabled status). ```csharp var client = new SeatsioClient(Region.EU(), ""); await Client.Charts.UpdateCategoryAsync(chart.Key, 1, new CategoryUpdateParams("Updated label", "#bbbbbb", true)); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.